Commit 93f70b36 by Chris Forbes

Correctly determine whether we need to compute centroids

Bug: b/124177079 Change-Id: I20132ffd5f73c19715393740c27f77e71a3c3c88 Reviewed-on: https://swiftshader-review.googlesource.com/c/24594Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 5d61a1cf
...@@ -702,7 +702,7 @@ namespace sw ...@@ -702,7 +702,7 @@ namespace sw
if(state.multiSample > 1 && context->pixelShader) if(state.multiSample > 1 && context->pixelShader)
{ {
state.centroid = false;//context->pixelShader->containsCentroid(); state.centroid = context->pixelShader->getModes().NeedsCentroid;
} }
state.frontFaceCCW = context->frontFacingCCW; state.frontFaceCCW = context->frontFacingCCW;
......
...@@ -42,9 +42,13 @@ namespace sw ...@@ -42,9 +42,13 @@ namespace sw
case spv::OpDecorate: case spv::OpDecorate:
{ {
auto targetId = insn.word(1); auto targetId = insn.word(1);
auto decoration = static_cast<spv::Decoration>(insn.word(2));
decorations[targetId].Apply( decorations[targetId].Apply(
static_cast<spv::Decoration>(insn.word(2)), decoration,
insn.wordCount() > 3 ? insn.word(3) : 0); insn.wordCount() > 3 ? insn.word(3) : 0);
if (decoration == spv::DecorationCentroid)
modes.NeedsCentroid = true;
break; break;
} }
...@@ -55,9 +59,13 @@ namespace sw ...@@ -55,9 +59,13 @@ namespace sw
auto &d = memberDecorations[targetId]; auto &d = memberDecorations[targetId];
if (memberIndex >= d.size()) if (memberIndex >= d.size())
d.resize(memberIndex + 1); // on demand; exact size would require another pass... d.resize(memberIndex + 1); // on demand; exact size would require another pass...
auto decoration = static_cast<spv::Decoration>(insn.word(3));
d[memberIndex].Apply( d[memberIndex].Apply(
static_cast<spv::Decoration>(insn.word(3)), decoration,
insn.wordCount() > 4 ? insn.word(4) : 0); insn.wordCount() > 4 ? insn.word(4) : 0);
if (decoration == spv::DecorationCentroid)
modes.NeedsCentroid = true;
break; break;
} }
......
...@@ -143,6 +143,7 @@ namespace sw ...@@ -143,6 +143,7 @@ namespace sw
bool DepthLess : 1; bool DepthLess : 1;
bool DepthUnchanged : 1; bool DepthUnchanged : 1;
bool ContainsKill : 1; bool ContainsKill : 1;
bool NeedsCentroid : 1;
// Compute workgroup dimensions // Compute workgroup dimensions
int LocalSizeX, LocalSizeY, LocalSizeZ; int LocalSizeX, LocalSizeY, LocalSizeZ;
......
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