Created attachment 125542 [details]
Discard with depth not being discarded on Sky Lake
In the indirect draw example of my Vulkan examples I use discard in the fragment shader for discarding transparent fragments.
As per spec, discarding fragments should also discard depth, but this doesn't seem to work on Ivy Bridge with current MESA drivers, color is discarded, but depth is written, even though the fragment shader does not specify early_fragment_tests.
I have attached a screenshot from Ubuntu with Ivy Brdige showing the clear color of the scene where the fragments are discarded and one from a GTX 980 rendering as expected.
Created attachment 125543 [details]
Discard with depth being discarded on GTX980
I just ran on my Sky Lake and it seems to work fine. Unfortunately, gen7 isn't terribly smart about when it applies the depth test. It's not hard to fix, we just need to go patch it up.
I just found the missing piece of state setup to fix this. I'll send out patch out soon.
This patch should fix the issue: https://patchwork.freedesktop.org/patch/103267/
The patch has been pushed to master. Thanks for the bug report!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.