Skip to content

Commit

Permalink
GL: try to fix v210 shader
Browse files Browse the repository at this point in the history
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
c243789).
  • Loading branch information
MartinPulec committed Nov 14, 2023
1 parent 0b9ee8e commit 691cb0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video_display/gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 691cb0f

Please sign in to comment.