glXMakeCurrent() drops the buffers of the unbound drawable
Submitted by almos
Assigned to mes..@..op.org
Description
Created attachment 121440 makecurrent.c
As the attached code demonstrates (see the comment about issue #2 (closed)), after switching to a pbuffer and back with glXMakeCurrent(), the depth and stencil buffers are uninitialized, because they have been dropped and reallocated. The new depth buffer is all zeros, and the second quad completely fails depth test. Tested with radeonsi, llvmpipe, softpipe, swrast. The demo renders perfectly with fglrx.
The above results are with DRI2. With DRI3 the already rendered chessboard is also partially overwritten with noise.
Attachment 121440, "makecurrent.c":
makecurrent.c