[V3D] Sampling precission issue
Hi there,
I am seeing the V3D driver fail with shaders that look up palette index from one texture, and an indirect load from the second.
For example, doing:
" vec4 txindex = texelFetch( s_texture, ivec2(int(v_texcoord.x),int(v_texcoord.y)) ,0 );\n"
" vec4 txcol = texelFetch( s_color, ivec2( ( int(txindex.g*65280.0) | int(txindex.r*255.0)) ,0
it seems txindex does not have enough precision, the seccond texelFetch retuns bad color.
The complete code is here: https://github.com/devmiyax/yabause/blob/master/yabause/src/yglshaderes.c
Original report was here: https://www.raspberrypi.org/forums/viewtopic.php?f=68&t=266652
Also, using sample instead of texelFetch the same problem happens.
This is affecting DuckStation when it uses it's GLES renderer (the most advanced PSX emulator that the Pi4 can run) and Yabuse, both of which work fine on AMDGPU, Intel, Tegra X1 and Snapdragon.