[Mesa-dev] [PATCH 07/10] swr/rast: Add alignment to transpose targets

Tim Rowley timothy.o.rowley at intel.com
Mon Nov 20 17:18:50 UTC 2017


Needed to ensure alignment for avx512.

Fixes address sanitizer crash.
---
 src/gallium/drivers/swr/rasterizer/core/binner.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp
index b624ae69b3..9d1f0d8799 100644
--- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp
@@ -796,10 +796,10 @@ endBinTriangles:
 
     // transpose verts needed for backend
     /// @todo modify BE to take non-transformed verts
-    simd4scalar vHorizX[SIMD_WIDTH];
-    simd4scalar vHorizY[SIMD_WIDTH];
-    simd4scalar vHorizZ[SIMD_WIDTH];
-    simd4scalar vHorizW[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizX[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizY[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizZ[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizW[SIMD_WIDTH];
 
     TransposeVertices(vHorizX, tri[0].x, tri[1].x, tri[2].x);
     TransposeVertices(vHorizY, tri[0].y, tri[1].y, tri[2].y);
@@ -1510,10 +1510,10 @@ void BinPostSetupLinesImpl(
 
     // transpose verts needed for backend
     /// @todo modify BE to take non-transformed verts
-    simd4scalar vHorizX[SIMD_WIDTH];
-    simd4scalar vHorizY[SIMD_WIDTH];
-    simd4scalar vHorizZ[SIMD_WIDTH];
-    simd4scalar vHorizW[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizX[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizY[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizZ[SIMD_WIDTH];
+    OSALIGNSIMD16(simd4scalar) vHorizW[SIMD_WIDTH];
 
     if (!primMask)
     {
-- 
2.14.1



More information about the mesa-dev mailing list