Skip to contentSkip to conversation

A conditional discard in a fragment shader causes no depth writing at all

Bug 93761 [email protected] 1 participant 5 messages Jan 18, 2016 – Feb 25, 2016

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93761

Bug ID: 93761
Summary: A conditional discard in a fragment shader causes no
depth writing at all
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Created attachment 121116
--> https://bugs.freedesktop.org/attachment.cgi?id=121116&action=edit
Test case

When rendering to an FBO with only a GL_DEPTH_COMPONENT16 depth buffer, with depth testing enabled, if a fragment shader has a conditional discard, nothing is written to the depth buffer for pixels which should not be discarded.

Platform: Fedora 22 x86_64
Mesa version: tested both git eaf7ec9 (from griever-mesa-git copr) and 10.6.9 (the default mesa package with Fedora 22). The bug occurred on both. GL Renderer string: Gallium 0.4 on AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.1)
GPU: AMD R9 270 with 2GB VRAM

Workaround: If you write to gl_FragDepth, only the intentionally discarded pixels are discarded.

I've attached a test case demonstrating the problem. It will fail an assertion on the machine with this bug. It should draw only on the even columns of pixels in the depth buffer, but nothing is drawn.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93761

--- Comment #1 from Nicolai H�hnle <[email protected]> ---
Hi James, bug reports with attached test cases are awesome :) I can confirm the problem with latest Mesa and LLVM master and am going to investigate.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93761

Marek Olšák <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Marek Olšák <[email protected]> --- Fixed by this commit:
https://cgit.freedesktop.org/mesa/mesa/commit/?id=8667a1aea2ac3fee9b1b663132dc1bea8ec21cda

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93761

James Legg <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel