Bug 97207 - [IVY BRIDGE] Fragment shader discard writing to depth
Summary: [IVY BRIDGE] Fragment shader discard writing to depth
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-04 18:08 UTC by SaschaWillems
Modified: 2016-08-05 22:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Discard with depth not being discarded on Sky Lake (342.66 KB, image/jpeg)
2016-08-04 18:08 UTC, SaschaWillems
Details
Discard with depth being discarded on GTX980 (489.91 KB, image/jpeg)
2016-08-04 18:09 UTC, SaschaWillems
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SaschaWillems 2016-08-04 18:08:12 UTC
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.
Comment 1 SaschaWillems 2016-08-04 18:09:04 UTC
Created attachment 125543 [details]
Discard with depth being discarded on GTX980
Comment 2 Jason Ekstrand 2016-08-04 21:58:39 UTC
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.
Comment 3 Nanley Chery 2016-08-04 22:43:54 UTC
I just found the missing piece of state setup to fix this. I'll send out patch out soon.
Comment 4 Nanley Chery 2016-08-04 23:48:34 UTC
This patch should fix the issue: https://patchwork.freedesktop.org/patch/103267/
Comment 5 Nanley Chery 2016-08-05 22:26:39 UTC
The patch has been pushed to master. Thanks for the bug report!


bug/show.html.tmpl processed on Jan 16, 2017 at 17:15:26.
(provided by the Example extension).