diff options
author | Tim Rowley <[email protected]> | 2016-07-13 17:34:03 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-07-20 10:22:15 -0500 |
commit | e41d9dd5769542b2118d222359fb7b7280564317 (patch) | |
tree | d9876e4c491058380c4b9cdbe0b1da9125b17f65 | |
parent | e0529a4668c7f50fb51b2c4ae8bc5954934db55f (diff) |
swr: [rasterizer core] centroid correction
Signed-off-by: Tim Rowley <[email protected]>
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/backend.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.cpp b/src/gallium/drivers/swr/rasterizer/core/backend.cpp index b492810b812..5d83baf391c 100644 --- a/src/gallium/drivers/swr/rasterizer/core/backend.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/backend.cpp @@ -513,15 +513,12 @@ void BackendSingleSample(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint3 RDTSC_START(BEBarycentric); CalcPixelBarycentrics(coeffs, psContext); - if(T::bCentroidPos) - { - // for 1x case, centroid is pixel center - psContext.vX.centroid = psContext.vX.center; - psContext.vY.centroid = psContext.vY.center; - psContext.vI.centroid = psContext.vI.center; - psContext.vJ.centroid = psContext.vJ.center; - psContext.vOneOverW.centroid = psContext.vOneOverW.center; - } + // for 1x case, centroid is pixel center + psContext.vX.centroid = psContext.vX.center; + psContext.vY.centroid = psContext.vY.center; + psContext.vI.centroid = psContext.vI.center; + psContext.vJ.centroid = psContext.vJ.center; + psContext.vOneOverW.centroid = psContext.vOneOverW.center; // interpolate and quantize z psContext.vZ = vplaneps(coeffs.vZa, coeffs.vZb, coeffs.vZc, psContext.vI.center, psContext.vJ.center); @@ -715,6 +712,11 @@ void BackendSampleRate(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_ CalcCentroidBarycentrics(coeffs, psContext, psContext.vX.UL, psContext.vY.UL); RDTSC_STOP(BEBarycentric, 0, 0); } + else + { + psContext.vX.centroid = psContext.vX.sample; + psContext.vY.centroid = psContext.vY.sample; + } for(uint32_t sample = 0; sample < T::MultisampleT::numSamples; sample++) { @@ -925,9 +927,15 @@ void BackendPixelRate(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t psContext.vX.centroid = _simd_add_ps(psContext.vX.UL, _simd_set1_ps(0.5f)); psContext.vY.centroid = _simd_add_ps(psContext.vY.UL, _simd_set1_ps(0.5f)); } + CalcCentroidBarycentrics(coeffs, psContext, psContext.vX.UL, psContext.vY.UL); RDTSC_STOP(BEBarycentric, 0, 0); } + else + { + psContext.vX.centroid = _simd_add_ps(psContext.vX.UL, _simd_set1_ps(0.5f)); + psContext.vY.centroid = _simd_add_ps(psContext.vY.UL, _simd_set1_ps(0.5f)); + } if(T::bForcedSampleCount) { |