renderer/opengl: fix issue with cell bg alignment on some systems (#7783)

Discussed in #7714, fix confirmed by user as working.

Okay, so, what the hell? This implies that on this user's system,
something that *should* be an integer multiple of the cell width, when
divided by the cell width, is giving some epsilon less than the proper
result. I can only guess that this is driver or hardware weirdness,
possibly the fragcoord is being converted from a low precision float in
NDC to the fragment-space coordinate so we're not actually getting an
integer multiple, and the epsilon less is actually before the division?

Regardless, switching it back to use halves for pixel coordinates fixes
this and shouldn't break the math at all, since `floor((n * k + 0.5)/k)`
should always yield `n` just like without the `+ 0.5`.
pull/7788/head
Qwerasd 2025-07-03 10:05:52 -06:00 committed by GitHub
commit ffbba3e460
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#include "common.glsl"
// Position the origin to the upper left
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;
layout(origin_upper_left) in vec4 gl_FragCoord;
// Must declare this output for some versions of OpenGL.
layout(location = 0) out vec4 out_FragColor;