From 0e9e24768785a4e09a785c1f3ab9c0117e82da4e Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Wed, 29 Nov 2017 10:46:49 -0600 Subject: swr/rast: Binner fixes for viewport index offset handling Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/rasterizer/core/binner.cpp | 9 ++++++++- src/gallium/drivers/swr/rasterizer/core/clip.h | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp index 9d1f0d87994..52375f8956c 100644 --- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp @@ -470,6 +470,10 @@ void SIMDCALL BinTrianglesImpl( typename SIMD_T::Integer vClearMask = SIMD_T::cmplt_epi32(vpai, vNumViewports); viewportIdx = SIMD_T::and_si(vClearMask, vpai); } + else + { + viewportIdx = vpai; + } if (feState.vpTransformDisable) { @@ -1326,6 +1330,10 @@ void BinPointsImpl( typename SIMD_T::Integer vClearMask = SIMD_T::cmplt_epi32(vpai, vNumViewports); viewportIdx = SIMD_T::and_si(vClearMask, vpai); } + else + { + viewportIdx = vpai; + } if (!feState.vpTransformDisable) { @@ -1647,7 +1655,6 @@ void SIMDCALL BinLinesImpl( if (state.backendState.readViewportArrayIndex) { pa.Assemble(VERTEX_SGV_SLOT, vpiAttrib); - vpai = SIMD_T::castps_si(vpiAttrib[0][VERTEX_SGV_VAI_COMP]); } diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.h b/src/gallium/drivers/swr/rasterizer/core/clip.h index 0d3d78057ff..9d8bbc19e63 100644 --- a/src/gallium/drivers/swr/rasterizer/core/clip.h +++ b/src/gallium/drivers/swr/rasterizer/core/clip.h @@ -694,7 +694,6 @@ public: if (state.backendState.readViewportArrayIndex) { pa.Assemble(VERTEX_SGV_SLOT, vpiAttrib); - vpai = SIMD_T::castps_si(vpiAttrib[0][VERTEX_SGV_VAI_COMP]); } @@ -707,6 +706,10 @@ public: typename SIMD_T::Integer vClearMask = SIMD_T::cmplt_epi32(vpai, vNumViewports); viewportIdx = SIMD_T::and_si(vClearMask, vpai); } + else + { + viewportIdx = vpai; + } ComputeClipCodes(prim, viewportIdx); -- cgit v1.2.3