Flip samples to their correct position

SwANGLE tests detected that SwiftShader's sample positions were 180 degree flipped from Vulkan's exact sample locations. Most multisampling tests we've run with SwiftShader so far relied on resolved outputs, so having the samples in the wrong order didn't matter, as long as we had the correct 4 samples (which we do, since the samples are essentially rotated by 90 degrees around the center of the pixel from each other). Bug: b/170962186 Bug: b/141380498 Change-Id: I65552863e1fe38b321b84995e038984488512e1c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52088Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
parent 3fe96b78
...@@ -131,7 +131,7 @@ void QuadRasterizer::rasterize(Int &yMin, Int &yMax) ...@@ -131,7 +131,7 @@ void QuadRasterizer::rasterize(Int &yMin, Int &yMax)
if(state.enableMultiSampling) if(state.enableMultiSampling)
{ {
y -= *Pointer<Float4>(constants + OFFSET(Constants, Y) + q * sizeof(float4)); y += *Pointer<Float4>(constants + OFFSET(Constants, Y) + q * sizeof(float4));
} }
Dz[q] = *Pointer<Float4>(primitive + OFFSET(Primitive, z.C), 16) + y * *Pointer<Float4>(primitive + OFFSET(Primitive, z.B), 16); Dz[q] = *Pointer<Float4>(primitive + OFFSET(Primitive, z.C), 16) + y * *Pointer<Float4>(primitive + OFFSET(Primitive, z.B), 16);
......
...@@ -86,7 +86,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu ...@@ -86,7 +86,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu
if(state.enableMultiSampling) if(state.enableMultiSampling)
{ {
x -= *Pointer<Float4>(constants + OFFSET(Constants, X) + q * sizeof(float4)); x += *Pointer<Float4>(constants + OFFSET(Constants, X) + q * sizeof(float4));
} }
z[q] = interpolate(x, Dz[q], z[q], primitive + OFFSET(Primitive, z), false, false); z[q] = interpolate(x, Dz[q], z[q], primitive + OFFSET(Primitive, z), false, false);
......
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