diff options
author | Tim Rowley <[email protected]> | 2017-03-14 19:37:30 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-03-20 18:05:22 -0500 |
commit | 7046695a0e8f86ee612abfadfba4506bbb991cab (patch) | |
tree | 489248721ea3b4f03f48dafb8b67a7581e0dd792 /src/gallium/drivers | |
parent | 4cb69e817c0cec430ff956b979409bcfbfb4e3ca (diff) |
swr: [rasterizer core] Fix trifan regression from 9d3442575f
Fixes piglit triangle-rasterization-overdraw.
SIMD16 path not working.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/pa.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/pa.h b/src/gallium/drivers/swr/rasterizer/core/pa.h index 6160996cad3..781c0946143 100644 --- a/src/gallium/drivers/swr/rasterizer/core/pa.h +++ b/src/gallium/drivers/swr/rasterizer/core/pa.h @@ -119,6 +119,8 @@ struct PA_STATE // cuts struct PA_STATE_OPT : public PA_STATE { + SIMDVERTEX leadingVertex; // For tri-fan + uint32_t numPrims{ 0 }; // Total number of primitives for draw. uint32_t numPrimsComplete{ 0 }; // Total number of complete primitives. diff --git a/src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp b/src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp index 2a4104aacd3..297f23a88ca 100644 --- a/src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp @@ -1213,6 +1213,10 @@ void PaTriStripSingle0(PA_STATE_OPT& pa, uint32_t slot, uint32_t primIndex, __m1 bool PaTriFan0(PA_STATE_OPT& pa, uint32_t slot, simdvector verts[]) { + // store off leading vertex for attributes + PA_STATE_OPT::SIMDVERTEX* pVertex = (PA_STATE_OPT::SIMDVERTEX*)pa.pStreamBase; + pa.leadingVertex = pVertex[pa.cur]; + SetNextPaState(pa, PaTriFan1, PaTriFanSingle0); return false; // Not enough vertices to assemble 8 triangles. } @@ -1224,7 +1228,7 @@ bool PaTriFan1(PA_STATE_OPT& pa, uint32_t slot, simdvector verts[]) simdvector a; simdvector b; - const simd16vector &leadvert_16 = PaGetSimdVector_simd16(pa, pa.first, slot); + const simd16vector &leadvert_16 = pa.leadingVertex.attrib[slot]; if (!pa.useAlternateOffset) { @@ -1252,7 +1256,7 @@ bool PaTriFan1(PA_STATE_OPT& pa, uint32_t slot, simdvector verts[]) } #else - simdvector &leadVert = PaGetSimdVector(pa, pa.first, slot); + simdvector &leadVert = pa.leadingVertex.attrib[slot]; simdvector &a = PaGetSimdVector(pa, pa.prev, slot); simdvector &b = PaGetSimdVector(pa, pa.cur, slot); @@ -1293,7 +1297,7 @@ bool PaTriFan0_simd16(PA_STATE_OPT& pa, uint32_t slot, simd16vector verts[]) bool PaTriFan1_simd16(PA_STATE_OPT& pa, uint32_t slot, simd16vector verts[]) { - const simd16vector &a = PaGetSimdVector_simd16(pa, pa.first, slot); + const simd16vector &a = pa.leadingVertex.attrib[slot]; const simd16vector &b = PaGetSimdVector_simd16(pa, pa.prev, slot); const simd16vector &c = PaGetSimdVector_simd16(pa, pa.cur, slot); @@ -1329,7 +1333,7 @@ bool PaTriFan1_simd16(PA_STATE_OPT& pa, uint32_t slot, simd16vector verts[]) void PaTriFanSingle0(PA_STATE_OPT& pa, uint32_t slot, uint32_t primIndex, __m128 verts[]) { #if USE_SIMD16_FRONTEND - const simd16vector &a = PaGetSimdVector_simd16(pa, pa.first, slot); + const simd16vector &a = pa.leadingVertex.attrib[slot]; const simd16vector &b = PaGetSimdVector_simd16(pa, pa.prev, slot); const simd16vector &c = PaGetSimdVector_simd16(pa, pa.cur, slot); @@ -1365,7 +1369,7 @@ void PaTriFanSingle0(PA_STATE_OPT& pa, uint32_t slot, uint32_t primIndex, __m128 verts[2] = swizzleLaneN(c, primIndex - 14); } #else - const simdvector &a = PaGetSimdVector(pa, pa.first, slot); + const simdvector &a = pa.leadingVertex.attrib[slot]; const simdvector &b = PaGetSimdVector(pa, pa.prev, slot); const simdvector &c = PaGetSimdVector(pa, pa.cur, slot); |