Commit 451cad2c by Chris Forbes

Only do centroid sampling if multisampling

Previously if sample count were 1, we would skip the setup for the centroid 1/w, and then blindly use it, leading to NaN in all interpolants marked `centroid`. Bug: b/118386749 Test: dEQP-VK.glsl.linkage.varying.* Change-Id: I4f5d0b052f2defaad86706b85790ef14cd42f53f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29650Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 37f2bd82
...@@ -156,7 +156,7 @@ namespace sw ...@@ -156,7 +156,7 @@ namespace sw
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) if (input.Centroid && state.multiSample > 1)
{ {
routine.inputs[interpolant] = routine.inputs[interpolant] =
interpolateCentroid(XXXX, YYYY, rhwCentroid, interpolateCentroid(XXXX, YYYY, rhwCentroid,
......
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