From 742b677da7989a63bef00d412df36bc0252d2969 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 15 Nov 2022 11:19:12 +0100 Subject: [PATCH] GL: fixed odd UYVY pixel width fixed rendering `-t testcard:size=47x32:codec=UYVY` --- src/video_display/gl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index 5e8f6fd3c..722c27afc 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -106,8 +106,10 @@ uniform sampler2D image; uniform float imageWidth; void main() { + float imageWidthRaw; + imageWidthRaw = float((int(imageWidth) + 1) / 2 * 2); vec4 yuv; - yuv.rgba = texture2D(image, gl_TexCoord[0].xy).grba; + yuv.rgba = texture2D(image, vec2(gl_TexCoord[0].x / imageWidthRaw * imageWidth, gl_TexCoord[0].y)).grba; if(gl_TexCoord[0].x * imageWidth / 2.0 - floor(gl_TexCoord[0].x * imageWidth / 2.0) > 0.5) yuv.r = yuv.a; yuv.r = Y_SCALED_PLACEHOLDER * (yuv.r - 0.0625);