From 691cb0fb9216409fd92cbbc72a956c1269924245 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 14 Nov 2023 16:46:23 +0100 Subject: [PATCH] GL: try to fix v210 shader refer to GH-359 It is expected that the value should been slightly above a pixel index, eg. 0.0001 for first and 1919.0001 for the last in FHD. However, using round (but not floor!) before converting the value to int seem to help, which would imply that the actual pixel value might have fallen below the actual pixel value. But in that case, replacing 0.4999 for 0.5 should not have helped, but it did (reverting the commit c2437894f). --- src/video_display/gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index 3f4b99d34..d0e8c6ce1 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -210,7 +210,7 @@ void main(void) { // interpolate (0,1) texcoords to [0,719] int texcoordDenormX; - texcoordDenormX = int(gl_TexCoord[0].x * imageWidth - .4999); + texcoordDenormX = int(round(gl_TexCoord[0].x * imageWidth - .4999)); // 0 1 1 2 3 3 4 5 5 6 7 7 etc. int yOffset;