Commit 81d19c96 by Chris Forbes

Remove depthOverride pixel state bit

This can be queried directly from the shader Bug: b/124177079 Change-Id: I08aac7f77fb59f005295de3d417d24bf61fb3906 Reviewed-on: https://swiftshader-review.googlesource.com/c/24595Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 93f70b36
...@@ -633,8 +633,6 @@ namespace sw ...@@ -633,8 +633,6 @@ namespace sw
state.shaderID = 0; state.shaderID = 0;
} }
state.depthOverride = context->pixelShader ? context->pixelShader->getModes().DepthReplacing : false;
if(context->alphaTestActive()) if(context->alphaTestActive())
{ {
state.alphaCompareMode = context->alphaCompareMode; state.alphaCompareMode = context->alphaCompareMode;
......
...@@ -34,8 +34,6 @@ namespace sw ...@@ -34,8 +34,6 @@ namespace sw
int shaderID; int shaderID;
bool depthOverride : 1; // TODO: Eliminate by querying shader.
VkCompareOp depthCompareMode : BITS(VK_COMPARE_OP_END_RANGE); VkCompareOp depthCompareMode : BITS(VK_COMPARE_OP_END_RANGE);
VkCompareOp alphaCompareMode : BITS(VK_COMPARE_OP_END_RANGE); VkCompareOp alphaCompareMode : BITS(VK_COMPARE_OP_END_RANGE);
bool depthWriteEnable : 1; bool depthWriteEnable : 1;
......
...@@ -159,7 +159,7 @@ namespace sw ...@@ -159,7 +159,7 @@ namespace sw
} }
} }
if(veryEarlyDepthTest && state.multiSample == 1 && !state.depthOverride) if(veryEarlyDepthTest && state.multiSample == 1 && !spirvShader->getModes().DepthReplacing)
{ {
if(!state.stencilActive && state.depthTestActive && (state.depthCompareMode == VK_COMPARE_OP_LESS_OR_EQUAL || state.depthCompareMode == VK_COMPARE_OP_LESS)) // FIXME: Both modes ok? if(!state.stencilActive && state.depthTestActive && (state.depthCompareMode == VK_COMPARE_OP_LESS_OR_EQUAL || state.depthCompareMode == VK_COMPARE_OP_LESS)) // FIXME: Both modes ok?
{ {
......
...@@ -50,7 +50,7 @@ namespace sw ...@@ -50,7 +50,7 @@ namespace sw
clampColor(c); clampColor(c);
if(state.depthOverride) if(spirvShader->getModes().DepthReplacing)
{ {
oDepth = Min(Max(oDepth, Float4(0.0f)), Float4(1.0f)); oDepth = Min(Max(oDepth, Float4(0.0f)), Float4(1.0f));
} }
......
...@@ -53,7 +53,7 @@ namespace sw ...@@ -53,7 +53,7 @@ namespace sw
Long pipeTime = Ticks(); Long pipeTime = Ticks();
#endif #endif
const bool earlyDepthTest = !state.depthOverride && !state.alphaTestActive(); const bool earlyDepthTest = !spirvShader->getModes().DepthReplacing && !state.alphaTestActive();
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