Commit 71a1e015 by Chris Forbes

Always apply the fragment shader if it is present

Previously we tried to avoid applying a shader which didn't do anything useful. Unfortunately we missed various edge cases. Just remove this logic completely. Bug: b/118386749 Test: dEQP-VK.renderpass* Change-Id: I48f2f9f08ad491381db22af9f6f3430f7b4d4db1 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29728Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 32ac8317
......@@ -181,27 +181,27 @@ namespace sw
Bool alphaPass = true;
if(colorUsed())
{
#if PERF_PROFILE
Long shaderTime = Ticks();
#endif
#if PERF_PROFILE
Long shaderTime = Ticks();
#endif
if (spirvShader)
{
applyShader(cMask);
}
#if PERF_PROFILE
cycles[PERF_SHADER] += Ticks() - shaderTime;
#endif
#if PERF_PROFILE
cycles[PERF_SHADER] += Ticks() - shaderTime;
#endif
alphaPass = alphaTest(cMask);
alphaPass = alphaTest(cMask);
if((spirvShader && spirvShader->getModes().ContainsKill) || state.alphaToCoverage)
if((spirvShader && spirvShader->getModes().ContainsKill) || state.alphaToCoverage)
{
for(unsigned int q = 0; q < state.multiSample; q++)
{
for(unsigned int q = 0; q < state.multiSample; q++)
{
zMask[q] &= cMask[q];
sMask[q] &= cMask[q];
}
zMask[q] &= cMask[q];
sMask[q] &= cMask[q];
}
}
......@@ -234,14 +234,11 @@ namespace sw
}
}
if(colorUsed())
{
#if PERF_PROFILE
AddAtomic(Pointer<Long>(&profiler.ropOperations), 4);
#endif
#if PERF_PROFILE
AddAtomic(Pointer<Long>(&profiler.ropOperations), 4);
#endif
rasterOperation(cBuffer, x, sMask, zMask, cMask);
}
rasterOperation(cBuffer, x, sMask, zMask, cMask);
}
#if PERF_PROFILE
......@@ -2474,9 +2471,4 @@ namespace sw
return Min(Max(linear, Float4(0.0f)), Float4(1.0f));
}
bool PixelRoutine::colorUsed()
{
return state.colorWriteMask || state.alphaToCoverage || (spirvShader && spirvShader->getModes().ContainsKill);
}
}
......@@ -89,8 +89,6 @@ namespace sw
void writeDepth32F(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
void writeDepth16(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
bool colorUsed();
};
}
......
......@@ -511,6 +511,11 @@ namespace sw
return inputBuiltins.find(b) != inputBuiltins.end();
}
bool hasBuiltinOutput(spv::BuiltIn b) const
{
return outputBuiltins.find(b) != outputBuiltins.end();
}
struct Decorations
{
int32_t Location = -1;
......
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