Strange, unintended grid pattern when using shaders

This is a weird one. On my desktop PC, I can use all filters without issue or anomaly. But running the same exact executable on the same exact drive on an old laptop causes a grid anomaly to manifest in most shaders:

(You will probably have to expand the image to see the grid.) I put the white lines there to make the grid easier to spot. Basically, at mostly regular intervals along both x and y, a column or a row one pixel thick has its graphics skewed, causing an obvious visual anomaly. These lines of corruption are stationary. They don’t move. However, different cores (or perhaps different internal resolutions) result in different spacings for the lines. The above image is from the Sega Genesis, and in that image, the columns are mostly spaced 97 pixels apart, and the rows are reliably spaced 135 pixels apart. On the NES, the spacing is much smaller.

I said “most” filters. Some are unaffected. The above is from SABR, but XBR doesn’t seem to have the same problem, while others do.

I’ll also mention that I noticed this problem occurring before replacing Vista with Win7, so it must have something to do with how filters are interacting with the GPU. The precise failing of that interaction, and what I might try to circumvent it, are what I’m after.

One last thing. This is in regards to CG shaders. On my laptop, GLSL shaders give me only a black screen, and SLANG shaders crash RetroArch outright.

What you’re describing is a texcoord problem that can occur on some GPUs (AMD/ATi GPUs are esp prone to it). Which model GPU do you have?

SABR already has what should be the fix, which is to add a very small offset to the texcoord in the vertex. We might need to increase that offset from the current float2(0.0000001, 0.0000001) to float2(0.0004, 0.0004), which is what I’ve found to be the sweet spot. You can try replacing it yourself to see if that helps. It’s on line 105 for SABR.

That’s odd that GLSL shaders give you a black screen. They should work anywhere Cg shaders work, except for the d3d driver… Slang shaders only work with the vulkan display driver.

Alright, gave that a try. Sadly, increasing the value didn’t have an effect, until I started approaching the hundredths (0.04), whereupon the total image shrunk visibly, leaving the bottom and right empty (black). The grid pattern was still visible even then. Eliminating the offset just made the pattern less ambiguous.

Could be the age of the card in question (HD4670) is just excessive and a different kind of workaround would need to be invented. The frustrating thing is that most filters are affected so, especially the ones I actually want to use, including one I tinkered with extensively in an effort to kill dithering in MS-DOS/PC-98 games.