From patchwork Fri Sep 30 16:57:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17473 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 2F3FEC0DA4 for ; Fri, 30 Sep 2022 16:57:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8753662839; Fri, 30 Sep 2022 18:57:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664557055; bh=PZ+X8hHJsRFoazT2JkWoL7CfMvFzoXwDzH5ePzmNAB0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JvQZbQKW/CaJBVfCKbwPi9iNftTZAjmnHwkfbQxk0S2I+1xH7I7H1hyhXcX1YrM43 FuVjO0VLTbi0E4PwnVvbnzUQTBiHKIuaDqbmyTh5KB29xz0FfrCKQUd1qcjQyoZEji DS2kVHrVbxzGbUwbpSSi/ZD1TvanUpO67ZTAvbtW2nJIMIUc1+1UdlTcb6q2N6/iAS 0r7IKjCT8kUYbdCznpBcZ2+5G9uBj7InSC2XSyMigW28mDft7GvpNLC81cj3iEPwMj re9pQB/KiFhXAvZwlt4PqAMkLadZChR32BASkyBB/CxX5lXsCrrUirB2mJw/k5o1tk 8hcoBziSHvBjQ== 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 7971261FB1 for ; Fri, 30 Sep 2022 18:57:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VN3bFtme"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C5F4047C; Fri, 30 Sep 2022 18:57:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664557053; bh=PZ+X8hHJsRFoazT2JkWoL7CfMvFzoXwDzH5ePzmNAB0=; h=From:To:Cc:Subject:Date:From; b=VN3bFtme2Jvcr+vy7Bn2BYqYwQgiGH5B7WwISeHQoiGsjfpFc7JsO+FlGu79UIPul Lip0W8ov3+uvLUa+VjYvnIitUxkqcT1b36cZIcqAybNLWk++m98Icrkgpe+waBj03g P4ymwQ6cXcS9a28gRB0LD6WaaxR7++uYTGQ3k60E= To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Sep 2022 19:57:31 +0300 Message-Id: <20220930165731.9063-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: Fix YUV planar fragment shaders 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Commit 251f0534b74b ("qcam: viewfinder_gl: Take color space into account for YUV rendering") introduced compilation failures in the YUV semi-planar and planar fragment shaders due to a bad copy & paste. Fix it. Fixes: 251f0534b74b ("qcam: viewfinder_gl: Take color space into account for YUV rendering") Reported-by: Kieran Bingham Signed-off-by: Laurent Pinchart Tested-by: Kieran Bingham Reviewed-by: Umang Jain --- Kieran, This should fix the issue you have reported. I haven't tested the patch yet, could you give it a try ? --- src/qcam/assets/shader/YUV_2_planes.frag | 2 +- src/qcam/assets/shader/YUV_3_planes.frag | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qcam/assets/shader/YUV_2_planes.frag b/src/qcam/assets/shader/YUV_2_planes.frag index da8dbcc5f801..1d5d1206248f 100644 --- a/src/qcam/assets/shader/YUV_2_planes.frag +++ b/src/qcam/assets/shader/YUV_2_planes.frag @@ -36,7 +36,7 @@ void main(void) #error Invalid pattern #endif - vec3 rgb = yuv2rgb_matrix * (vec3(y, uv) - yuv2rgb_offset); + vec3 rgb = yuv2rgb_matrix * (yuv - yuv2rgb_offset); gl_FragColor = vec4(rgb, 1.0); } diff --git a/src/qcam/assets/shader/YUV_3_planes.frag b/src/qcam/assets/shader/YUV_3_planes.frag index e754129d74d1..8f788e90a6f8 100644 --- a/src/qcam/assets/shader/YUV_3_planes.frag +++ b/src/qcam/assets/shader/YUV_3_planes.frag @@ -30,7 +30,7 @@ void main(void) yuv.y = texture2D(tex_u, textureOut).r; yuv.z = texture2D(tex_v, textureOut).r; - vec3 rgb = yuv2rgb_matrix * (vec3(y, uv) - yuv2rgb_offset); + vec3 rgb = yuv2rgb_matrix * (yuv - yuv2rgb_offset); gl_FragColor = vec4(rgb, 1.0); }