Reading back an EGL Pbuffer using the OpenGL API returns garbled output
Submitted by Matthieu Bouron
Assigned to Tapani Pälli
Link to original bug (#108977)
Description
Created attachment 142750 EGL pbuffer test
Hello,
I am currently facing an issue while reading back EGL Pbuffers using glReadPixels() with the OpenGL API as the output is garbled. It properly works with the OpenGL ES API though.
I can reproduce the issue on different machines running Arch Linux with mesa 18.2.5 on X using the following GPU: Intel HD 5500, Intel Iris 580 Pro, AMD RX 580.
I am not able to reproduce the issue on an NVDIA GTX 1070 running the proprietary driver.
I have attached a sample code that reproduces the issue:
On OpenGL:
gcc pkg-config --libs egl gl
-Wall egl-pbuffer.c -o egl-pbuffer &&./egl-pbuffer
0xff69fc07 0xff69fc07 0xff69fc07 0xff69fc07
0xff69fc07 0xff11a1e4 0xff000000 0xff000000
0xff69fc07 0xff000000 0xff7fc700 0xff000000
0xff69fc07 0xff000000 0xff000000 0xff3a4e3b
On OpenGLES (adding the -es parameter to ./egl-pbuffer):
gcc pkg-config --libs egl gl
-Wall egl-pbuffer.c -o egl-pbuffer &&./egl-pbuffer -es
0xff0000ff 0xff0000ff 0xff0000ff 0xff0000ff
0xff0000ff 0xff0000ff 0xff0000ff 0xff0000ff
0xff0000ff 0xff0000ff 0xff0000ff 0xff0000ff
0xff0000ff 0xff0000ff 0xff0000ff 0xff0000ff
Attachment 142750, "EGL pbuffer test":
egl-pbuffer.c
Version: 18.2