From patchwork Wed Sep 16 14:52:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9636 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C51BEC3B5B for ; Wed, 16 Sep 2020 14:53:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3DBC862E75; Wed, 16 Sep 2020 16:53:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vFjOt3S1"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F96F60533 for ; Wed, 16 Sep 2020 16:53:42 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D048726B; Wed, 16 Sep 2020 16:53:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600268009; bh=yEgsAs3AzirGL9og+s70y83IpSqif5unamp7nXIbx4g=; h=From:To:Cc:Subject:Date:From; b=vFjOt3S1fSuNLLAfs8Pm6H4upCHH7PBqt5FLscTq8h2Hy2O+nZpE3tCB2Vx2g0SOt ZNXJ1aVoMqx4CR8iyLlnpOQGyOgA9cAdQgS44hUTOnr7crnZRHJ/Rrud6yyXaRHYkG pH3B+4363H9QRBuJrBc0ankid9Db5j/KnXbjYGAA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 16 Sep 2020 17:52:47 +0300 Message-Id: <20200916145254.1644-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/7] qcam: Accelerate packed YUV rendering with OpenGL X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series adds a shader to convert packed YUV formats to RGB. It has been developed as I reviewed Show's OpenGL support work, to help me understand the OpenGL and GLSL code. The series starts with a few cleanups in patches 1/7 to 3/7. It then renames shader files in 4/7 to prepare for packed YUV support, and adds support for preprocessor macros in the shaders in 5/7. Patch 6/7 uses macros to select the YUV pattern in the semi-planar fragment shader, instead of duplicating the shader code. Finally, patch 7/7 adds a fragment shader for YUYV. Laurent Pinchart (7): qcam: Remove unneeded './' file prefix in *.qrc qcam: viewfinder_gl: Don't store texture IDs in class members qcam: viewfinder_gl: Hardcode the vertex shader file name qcam: viewfinder_gl: Rename shader files qcam: viewfinder_gl: Support #define in shaders qcam: viewfinder_gl: Merge the semi-planar UV and VU shaders qcam: viewfinder_gl: Add shader to render packed YUV formats src/qcam/assets/feathericons/feathericons.qrc | 12 +- src/qcam/assets/shader/NV_2_planes_VU_f.glsl | 32 ---- .../{NV_vertex_shader.glsl => YUV.vert} | 2 +- ...V_2_planes_UV_f.glsl => YUV_2_planes.frag} | 9 +- .../{NV_3_planes_f.glsl => YUV_3_planes.frag} | 2 +- src/qcam/assets/shader/YUV_packed.frag | 82 +++++++++++ src/qcam/assets/shader/shaders.qrc | 8 +- src/qcam/viewfinder_gl.cpp | 137 +++++++++++++----- src/qcam/viewfinder_gl.h | 18 +-- 9 files changed, 212 insertions(+), 90 deletions(-) delete mode 100644 src/qcam/assets/shader/NV_2_planes_VU_f.glsl rename src/qcam/assets/shader/{NV_vertex_shader.glsl => YUV.vert} (79%) rename src/qcam/assets/shader/{NV_2_planes_UV_f.glsl => YUV_2_planes.frag} (68%) rename src/qcam/assets/shader/{NV_3_planes_f.glsl => YUV_3_planes.frag} (90%) create mode 100644 src/qcam/assets/shader/YUV_packed.frag