Commit 6cf65f67 by Chris Forbes

Various fixes for VS-only pipeline

Bug: b/118386749 Test: dEQP-VK.memory_model.* Change-Id: Ie0962df8e17264ec93265cd56b4a79e0d5f37c33 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31528Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent ab3c36b9
...@@ -164,6 +164,8 @@ namespace sw ...@@ -164,6 +164,8 @@ namespace sw
Dw = *Pointer<Float4>(primitive + OFFSET(Primitive,w.C), 16) + yyyy * *Pointer<Float4>(primitive + OFFSET(Primitive,w.B), 16); Dw = *Pointer<Float4>(primitive + OFFSET(Primitive,w.C), 16) + yyyy * *Pointer<Float4>(primitive + OFFSET(Primitive,w.B), 16);
} }
if (spirvShader)
{
for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++) for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++)
{ {
if (spirvShader->inputs[interpolant].Type == SpirvShader::ATTRIBTYPE_UNUSED) if (spirvShader->inputs[interpolant].Type == SpirvShader::ATTRIBTYPE_UNUSED)
...@@ -172,7 +174,9 @@ namespace sw ...@@ -172,7 +174,9 @@ namespace sw
Dv[interpolant] = *Pointer<Float4>(primitive + OFFSET(Primitive, V[interpolant].C), 16); Dv[interpolant] = *Pointer<Float4>(primitive + OFFSET(Primitive, V[interpolant].C), 16);
if (!spirvShader->inputs[interpolant].Flat) if (!spirvShader->inputs[interpolant].Flat)
{ {
Dv[interpolant] += yyyy * *Pointer<Float4>(primitive + OFFSET(Primitive, V[interpolant].B), 16); Dv[interpolant] +=
yyyy * *Pointer<Float4>(primitive + OFFSET(Primitive, V[interpolant].B), 16);
}
} }
} }
......
...@@ -89,10 +89,13 @@ namespace sw ...@@ -89,10 +89,13 @@ namespace sw
state.multiSample = context->sampleCount; state.multiSample = context->sampleCount;
state.rasterizerDiscard = context->rasterizerDiscard; state.rasterizerDiscard = context->rasterizerDiscard;
if (context->pixelShader)
{
for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++) for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++)
{ {
state.gradient[interpolant] = context->pixelShader->inputs[interpolant]; state.gradient[interpolant] = context->pixelShader->inputs[interpolant];
} }
}
state.hash = state.computeHash(); state.hash = state.computeHash();
......
...@@ -37,8 +37,9 @@ namespace sw ...@@ -37,8 +37,9 @@ namespace sw
routine(pipelineLayout), routine(pipelineLayout),
descriptorSets(descriptorSets) descriptorSets(descriptorSets)
{ {
if (spirvShader)
{
spirvShader->emitProlog(&routine); spirvShader->emitProlog(&routine);
if (forceClearRegisters) if (forceClearRegisters)
{ {
for (int i = 0; i < MAX_INTERFACE_COMPONENTS; i++) for (int i = 0; i < MAX_INTERFACE_COMPONENTS; i++)
...@@ -47,6 +48,7 @@ namespace sw ...@@ -47,6 +48,7 @@ namespace sw
} }
} }
} }
}
PixelRoutine::~PixelRoutine() PixelRoutine::~PixelRoutine()
{ {
...@@ -59,7 +61,7 @@ namespace sw ...@@ -59,7 +61,7 @@ namespace sw
#endif #endif
// TODO: consider shader which modifies sample mask in general // TODO: consider shader which modifies sample mask in general
const bool earlyDepthTest = !spirvShader->getModes().DepthReplacing && !state.alphaToCoverage; const bool earlyDepthTest = !spirvShader || (!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
...@@ -147,9 +149,11 @@ namespace sw ...@@ -147,9 +149,11 @@ namespace sw
} }
} }
if (spirvShader)
{
for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++) for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++)
{ {
auto const & input = spirvShader->inputs[interpolant]; auto const &input = spirvShader->inputs[interpolant];
if (input.Type != SpirvShader::ATTRIBTYPE_UNUSED) if (input.Type != SpirvShader::ATTRIBTYPE_UNUSED)
{ {
if (input.Centroid && state.multiSample > 1) if (input.Centroid && state.multiSample > 1)
...@@ -170,6 +174,7 @@ namespace sw ...@@ -170,6 +174,7 @@ namespace sw
} }
setBuiltins(x, y, z, w); setBuiltins(x, y, z, w);
}
#if PERF_PROFILE #if PERF_PROFILE
cycles[PERF_INTERP] += Ticks() - interpTime; cycles[PERF_INTERP] += Ticks() - interpTime;
......
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