The game is built upon UE4 and we use stencil for optimization purpose. The issue is that when we deployed the game on Snapdragon Adreno series, it worked as expected. However, it failed on the Mali GPU. After debugging, we found out the stencil write operation failed, but I couldn't extract the depth stencil texture by using Graphics Analyzer.
Here is the screenshot:
For the trace config, I have changed to Everything, but the result has no difference.
Thanks in advance.
Hi Peter, I may need to seek approval to share the APK. How about a graphics analyzer trace from a demo project? Or is there anything else may help?
If you have a demo project you can share that reproduces the issue that would be fine, it doesn't need to be the actual game if you have a simpler repro. If not we can try to reproduce here, but it might take a bit longer.
Kind regards, Pete
Sorry, I cannot share any project generated by our engine. The issue looks like some opengl es states were incorrect. I tried to extract the stencil texture from Renderdoc, but the issue had gone after the Renderdoc connected. Therefore I guess the renderdoc had cleanup the state after it processed the replay.
If I can get the stencil texture from Graphics Analyzer, it will be easier for me to debug this issue.
Is there any clue about the missing depth stencil texture?
Assuming this was generated by the GPU as an output from a render pass, can you capture that render pass and see the output in the Framebuffer visualization?
It is the same with Texture tap. No stencil and depth.
However, in the renderdoc, I can see them
Thanks. We'll see if we can reproduce locally.
Thanks, I really appreciate it!
Hello, can you try capturing the frame with "all framebuffer attachments" enabled? Does anything change?
Hi Liam, I have never been able to toggle those buttons for my APP. See the pic here
If you pause the capture and restart do the buttons become accessible?
Nope. We are using a customized UE4 engine, is there any setting we need to set for those captures with UE4?
Hi Peter, we have found that after we remove glDiscardFramebufferEXT(target=GL_FRAMEBUFFER, numAttachments=1, attachments=[GL_DEPTH_ATTACHMENT]), the stencil works. It looks like when we discards depth, the stencil value lost as well.
Thanks, I'll raise a bug with the driver team.
The driver team have pointed out that the behavior you are getting is expected, based on the extension spec for glDiscardFramebufferEXT when using packed depth/stencil attachments.
From the extension spec:
2) What happens if the app discards only one of the depth and stencil attachments, but those are backed by the same packed_depth_stencil buffer? a) Generate an error b) Both images become undefined c) Neither image becomes undefined d) Only one of the images becomes undefined RESOLVED: (b) which sort of falls out of Issue 4.
2) What happens if the app discards only one of the depth and stencil attachments, but those are backed by the same packed_depth_stencil buffer?
RESOLVED: (b) which sort of falls out of Issue 4.
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_discard_framebuffer.txt
Just one follow up on this one - we've tested on our stock drivers and cannot reproduce this problem. Can you let us know what device and driver version (GL_RENDERER and GL_VERSION string) you are using, and we can raise with the device manufacturer.