https://bugs.freedesktop.org/show_bug.cgi?id=106452
Bug ID: 106452
Summary: radv: Early discard in fragment shader breaks
derivatives
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Vulkan/radeon
Assignee: mesa-dev@lists.freedesktop.org
Reporter: philip.rebo...@tu-dortmund.de
QA Contact: mesa-dev@lists.freedesktop.org
Created attachment 139440
--> https://bugs.freedesktop.org/attachment.cgi?id=139440&action=edit
GLSL fragment shader
Hello,
as mentioned in the title, a 'discard' in a fragment shader can break
derivatives used for subsequent texture sample operations, which leads to an
incorrect mip level being selected. This causes visual issues in The Witcher 3
with DXVK during LOD transitions, and potentially other games which use a
similar LOD system.
Here's a Renderdoc capture that shows the issue (recorded on an RX 480,
requires a recent build of the renderdoc v1.x git branch):
https://mega.nz/#!1exzXYaT!jl-JsS7g52enndH6twBwPMSKPReXArkqyFXyoTjvun4
The EIDs of interest are 8645 and 8648. The game is in the process of
performing a smooth LOD transition of a mesh by discarding fragments when
rendering either version of the mesh.
The attached shader is a modified GLSL version of the fragment shader which
produces correct results, it can be used to replace the original shader in
Renderdoc. The only change I made is to defer the 'discard' to the end of the
shader as documented in the code.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev