Issues when streaming textures on the Raspberry Pi 4 with OpenGL
System information
- OS: Raspbian GNU/Linux
- GPU: V3D 4.2
- Kernel version: Linux raspberrypi 5.4.79-v7l+ #1373 (closed) SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux
- Mesa version: 19.3.2 (distributed by Raspbian) and master(471fd78e)
Describe the issue
Please see repro.c for a minimal glut-based program reproducing the issue. The textures are updated with an animation of a white rectangle with alternating height. The sliding yellow rectangle highlights those textures which were updated in the rendered frame.
I'm streaming pixel data into a ring-buffer of textures. This causes the following issues:
- After some time (~10 seconds), texture updates using
glTexSubImage2D
are notably delayed by a couple of frames. - After some more time (~35 seconds), a texture starts to get corrupted (marked 2 in the screenshot).
- After even more time, the texture marked 2 in the screenshot seems to have swapped position with another texture which is now corrupted.
This is 100% reproducible. The times for the issue to become visible, the textures that get corrupted and the visual artifacts of the texture seem to be the same every time.
Screenshot
Any extra information would be greatly appreciated
The master version of Mesa seems to improve the situation compared to 19.3.2 a little bit, as the last texture (marked 1 in the screenshot) now seems to be updated correctly every time.
I couldn't reproduce the issue on other CPU/GPU combinations (amd64 with AMD or Intel IGPUs). The issue also appears when drawing using vertex buffers and shaders (i.e. core-profile only functionality).