Created attachment 144691 [details]
Main screen after game start. It should look like this: https://i.imgur.com/FqkEZlB.png (RPi 3)
Raspberry Pi 4B 4 GB arrived so I was eager to try out some FNA games. They run on Raspberry Pi 3B, but with weird texture glitches on the Pi 4, see attachments.
Using apitrace I saw some GL_INVALID_ENUM and GL_INVALID_OPERATION.
Using MESA_DEBUG=verbose I only got "Mesa: User error: GL_INVALID_ENUM in glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY)"
I am using the v3d fkms driver (enabled by default on the RPi 4).
To run FNA games on the Raspberry Pi (for example Celeste), mojoshader dynamic lib and FMOD 1.10.10 armhf dynamic libraries must be available in LD_LIBRARY_PATH.
The texture rendering seems to take wrong UV coords and wrong textures completely sometimes, and sometimes you just get garbled data (always the same).
I also tried another game, Dust: An Elysian Tail. It showed the same issues.
Created attachment 144692 [details]
apitrace from pi4
Created attachment 144693 [details]
Video of the apitrace, what the pi renders
Created attachment 144696 [details]
Title screen, two atlas textures overlayed
If I extract two textures, one is the actual one, and the other is the bad one, I see that they coordinates line up exactly where the real one should be. This is from frame 800 in apitrace. Somehow, wrong texture gets rendered instead of the one that should.
Created attachment 144697 [details]
Title screen frame 800 for reference
see above comment.
not sure if realted or not, but i had the same texture switching bug on another project
the issue was due to uniforms and attributes not being kept
"Uniforms are program object-specific state. They retain their values once loaded, and their values are restored whenever a program object is used, as long as the program object has not been re-linked"
to solve the issue i had to re-set the uniforsm/attribute value when using the program
i am unsure what the exact specs says regarding this, but the rpi4 does not keep those it seems
Compiled latest Mesa and the problem went away. The version of Mesa that Raspbian comes with is too old (from April). Woo!