Commit c514ab00 by Nicolas Capens Committed by Nicolas Capens

Evaluate interpolants at pixel center when multisampling disabled

Bug: b/142965928 Change-Id: I0c2e7054d51a1dd3d1e0915384b5cfbdaffda178 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40349 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 177d85d2
...@@ -138,7 +138,7 @@ const PixelProcessor::State PixelProcessor::update(const Context *context) const ...@@ -138,7 +138,7 @@ const PixelProcessor::State PixelProcessor::update(const Context *context) const
state.enableMultiSampling = (state.multiSampleCount > 1) && state.enableMultiSampling = (state.multiSampleCount > 1) &&
!(context->isDrawLine(true) && (context->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT)); !(context->isDrawLine(true) && (context->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT));
if(state.multiSampleCount > 1 && context->pixelShader) if(state.enableMultiSampling && context->pixelShader)
{ {
state.centroid = context->pixelShader->getModes().NeedsCentroid; state.centroid = context->pixelShader->getModes().NeedsCentroid;
} }
......
...@@ -129,7 +129,7 @@ void QuadRasterizer::rasterize(Int &yMin, Int &yMax) ...@@ -129,7 +129,7 @@ void QuadRasterizer::rasterize(Int &yMin, Int &yMax)
{ {
Float4 y = yyyy; Float4 y = yyyy;
if(state.multiSampleCount > 1) if(state.enableMultiSampling)
{ {
y -= *Pointer<Float4>(constants + OFFSET(Constants, Y) + q * sizeof(float4)); y -= *Pointer<Float4>(constants + OFFSET(Constants, Y) + q * sizeof(float4));
} }
......
...@@ -80,7 +80,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu ...@@ -80,7 +80,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu
{ {
Float4 x = xxxx; Float4 x = xxxx;
if(state.multiSampleCount > 1) if(state.enableMultiSampling)
{ {
x -= *Pointer<Float4>(constants + OFFSET(Constants, X) + q * sizeof(float4)); x -= *Pointer<Float4>(constants + OFFSET(Constants, X) + q * sizeof(float4));
} }
...@@ -144,7 +144,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu ...@@ -144,7 +144,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu
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.multiSampleCount > 1) if(input.Centroid && state.enableMultiSampling)
{ {
routine.inputs[interpolant] = routine.inputs[interpolant] =
interpolateCentroid(XXXX, YYYY, rhwCentroid, interpolateCentroid(XXXX, YYYY, rhwCentroid,
...@@ -172,10 +172,9 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu ...@@ -172,10 +172,9 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu
auto clipMask = SignMask(CmpGE(distance, SIMD::Float(0))); auto clipMask = SignMask(CmpGE(distance, SIMD::Float(0)));
for(auto ms = 0u; ms < state.multiSampleCount; ms++) for(auto ms = 0u; ms < state.multiSampleCount; ms++)
{ {
// TODO: Fragments discarded by clipping do not exist at // FIXME(b/148105887): Fragments discarded by clipping do not exist at
// all -- they should not be counted in queries or have // all -- they should not be counted in queries or have their Z/S effects
// their Z/S effects performed when early fragment tests // performed when early fragment tests are enabled.
// are enabled.
cMask[ms] &= clipMask; cMask[ms] &= clipMask;
} }
......
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