I noticed an issue on AMD RX 7600 with 23.9.1 driver.
Let we have two user-created framebuffers. FBO #1 - framebuffer with one color attachment and one depth-stencil attachment. And FBO #2 - almost as FBO #1 except texture attachments are multisampled. When I do glBlitFramebuffer(FBO #1, FBO #2, GL_STENCIL_BUFFER_BIT), it may corrupt a depth buffer under certain settings. And result image may become so:
Profiling say to me that it's due to depth buffer corruption.
Also I noticed: it can be fixed if I call glBlitFramebuffer(FBO #1, FBO #2, GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT). Also it's fixed if framebuffers are not multisampled (both). So I guess it's due to multisampling resolution, but I'm not sure.
I tried to write a reproducer, but i'm not sure it's fully repeat my problem. On Nvidia it's works and draw this, and RX 7600 it draws nothing(just purple bkg). I hope it helps.
Also my PC configuration:
Hi @stailgot ,
Below is the OpenGL team's feedback on this issue:
"We could not reproduce the issue with the program on the latest internal driver.
However, it seems there is a potential issue for stencil only upsampling, which could be the root-cause of the issue reported by the end-user. As a result, it makes sense that the corruption would be gone when doing upsampling for depth stencil (glBlitFramebuffer(FBO #1, FBO #2, GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)).
We will look into this upsampling issue. "
Also, the OpenGL team has mentioned that it would be helpful if you can provide a test-case for stencil only upsampling which is similar to your real case problem. Then they can use it to verify their fix for this issue.
I guess you're right about reason, because I tried to make glBlitFramebuffer(FBO #1, FBO #2, GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) and it's fix issue.
I guess this reproducer is just linear copy of gl-calls from application. The difference only in vertex data. I will check my reproducer and maybe update.