diff options
author | Tim Rowley <[email protected]> | 2017-05-18 10:56:20 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-05-30 17:21:47 -0500 |
commit | d91402fefaf3640959301bfb4ff285d91f05f072 (patch) | |
tree | 2dea9e1dec9b79d0480b8ecbdb4a9c155740dcc8 /src/gallium | |
parent | 7e271a763eb6f3c2836f4d42f6bcd8e55870f3fe (diff) |
swr/rast: code cleanup (no functional change)
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/binner.cpp | 124 |
1 files changed, 64 insertions, 60 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp index a3a32883921..4667b487800 100644 --- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp @@ -561,40 +561,43 @@ void BinTriangles( RDTSC_EVENT(FECullZeroAreaAndBackface, _mm_popcnt_u32(origTriMask ^ triMask), 0); } - // Simple non-conformant wireframe mode, useful for debugging - if (rastState.fillMode == SWR_FILLMODE_WIREFRAME) - { - // construct 3 SIMD lines out of the triangle and call the line binner for each SIMD - simdvector line[2]; - simdscalar recipW[2]; - line[0] = tri[0]; - line[1] = tri[1]; - recipW[0] = vRecipW0; - recipW[1] = vRecipW1; - BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - line[0] = tri[1]; - line[1] = tri[2]; - recipW[0] = vRecipW1; - recipW[1] = vRecipW2; - BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - line[0] = tri[2]; - line[1] = tri[0]; - recipW[0] = vRecipW2; - recipW[1] = vRecipW0; - BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - AR_END(FEBinTriangles, 1); - return; - } else if (rastState.fillMode == SWR_FILLMODE_POINT) - { - // bin 3 points - - BinPostSetupPoints(pDC, pa, workerId, &tri[0], triMask, primID, viewportIdx); - BinPostSetupPoints(pDC, pa, workerId, &tri[1], triMask, primID, viewportIdx); - BinPostSetupPoints(pDC, pa, workerId, &tri[2], triMask, primID, viewportIdx); - return; + { + // Simple non-conformant wireframe mode, useful for debugging + if (rastState.fillMode == SWR_FILLMODE_WIREFRAME) + { + // construct 3 SIMD lines out of the triangle and call the line binner for each SIMD + simdvector line[2]; + simdscalar recipW[2]; + line[0] = tri[0]; + line[1] = tri[1]; + recipW[0] = vRecipW0; + recipW[1] = vRecipW1; + BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + line[0] = tri[1]; + line[1] = tri[2]; + recipW[0] = vRecipW1; + recipW[1] = vRecipW2; + BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + line[0] = tri[2]; + line[1] = tri[0]; + recipW[0] = vRecipW2; + recipW[1] = vRecipW0; + BinPostSetupLines(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + AR_END(FEBinTriangles, 1); + return; + } + else if (rastState.fillMode == SWR_FILLMODE_POINT) + { + // bin 3 points + + BinPostSetupPoints(pDC, pa, workerId, &tri[0], triMask, primID, viewportIdx); + BinPostSetupPoints(pDC, pa, workerId, &tri[1], triMask, primID, viewportIdx); + BinPostSetupPoints(pDC, pa, workerId, &tri[2], triMask, primID, viewportIdx); + return; + } } /// Note: these variable initializations must stay above any 'goto endBenTriangles' @@ -994,32 +997,34 @@ void SIMDAPI BinTriangles_simd16( RDTSC_EVENT(FECullZeroAreaAndBackface, _mm_popcnt_u32(origTriMask ^ triMask), 0); } - // Simple non-conformant wireframe mode, useful for debugging - if (rastState.fillMode == SWR_FILLMODE_WIREFRAME) { - // construct 3 SIMD lines out of the triangle and call the line binner for each SIMD - simd16vector line[2]; - simd16scalar recipW[2]; - line[0] = tri[0]; - line[1] = tri[1]; - recipW[0] = vRecipW0; - recipW[1] = vRecipW1; - BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - line[0] = tri[1]; - line[1] = tri[2]; - recipW[0] = vRecipW1; - recipW[1] = vRecipW2; - BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - line[0] = tri[2]; - line[1] = tri[0]; - recipW[0] = vRecipW2; - recipW[1] = vRecipW0; - BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); - - AR_END(FEBinTriangles, 1); - return; + // Simple non-conformant wireframe mode, useful for debugging + if (rastState.fillMode == SWR_FILLMODE_WIREFRAME) + { + // construct 3 SIMD lines out of the triangle and call the line binner for each SIMD + simd16vector line[2]; + simd16scalar recipW[2]; + line[0] = tri[0]; + line[1] = tri[1]; + recipW[0] = vRecipW0; + recipW[1] = vRecipW1; + BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + line[0] = tri[1]; + line[1] = tri[2]; + recipW[0] = vRecipW1; + recipW[1] = vRecipW2; + BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + line[0] = tri[2]; + line[1] = tri[0]; + recipW[0] = vRecipW2; + recipW[1] = vRecipW0; + BinPostSetupLines_simd16(pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx); + + AR_END(FEBinTriangles, 1); + return; + } } /// Note: these variable initializations must stay above any 'goto endBenTriangles' @@ -1219,7 +1224,6 @@ void SIMDAPI BinTriangles_simd16( endBinTriangles: - // scan remaining valid triangles and bin each separately while (_BitScanForward(&triIndex, triMask)) { |