Commit 22be66d4 by Nicolas Capens Committed by Nicolas Capens

Fix always performing early depth test when requested

The SPIR-V 'EarlyFragmentTests' execution mode requires performing additional per-fragment tests prior to fragment shader execution, even if depth values computed by the shader would otherwise affect them: https://www.khronos.org/registry/vulkan/specs/1.1/html/vkspec.html#shaders-fragment-earlytest Bug: b/140302392 Change-Id: If5d836a35ee9cfc758243b34fad1222d1b0f1085 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51888 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 89fd1480
...@@ -57,8 +57,7 @@ PixelRoutine::~PixelRoutine() ...@@ -57,8 +57,7 @@ PixelRoutine::~PixelRoutine()
void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBuffer, Pointer<Byte> &sBuffer, Int cMask[4], Int &x, Int &y) void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBuffer, Pointer<Byte> &sBuffer, Int cMask[4], Int &x, Int &y)
{ {
// TODO: consider shader which modifies sample mask in general const bool earlyDepthTest = !spirvShader || spirvShader->getModes().EarlyFragmentTests;
const bool earlyDepthTest = !spirvShader || (spirvShader->getModes().EarlyFragmentTests && !spirvShader->getModes().DepthReplacing && !state.alphaToCoverage);
Int zMask[4]; // Depth mask Int zMask[4]; // Depth mask
Int sMask[4]; // Stencil mask Int sMask[4]; // Stencil mask
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment