summaryrefslogtreecommitdiff
path: root/src/qcam/assets/shader
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-30 19:55:05 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-04 12:04:53 +0300
commitdbd937e37500ea62e2967fd6669158aee92841c3 (patch)
treefe121aa57ef43729dbdc9f0cf85d2fd6709cab35 /src/qcam/assets/shader
parent351abecdb9a5c0423bddaf507c48b3129adcd0a0 (diff)
qcam: Fix YUV planar fragment shaders
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 <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/shader')
-rw-r--r--src/qcam/assets/shader/YUV_2_planes.frag2
-rw-r--r--src/qcam/assets/shader/YUV_3_planes.frag2
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 da8dbcc5..1d5d1206 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 e754129d..8f788e90 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);
}