swr/rast: Add alignment to transpose targets
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 7 Nov 2017 21:24:25 +0000 (15:24 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Mon, 20 Nov 2017 19:50:56 +0000 (13:50 -0600)
Needed to ensure alignment for avx512.

Fixes address sanitizer crash.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/binner.cpp

index b624ae69b34990af53bccf398566eb2eedb1ef5f..9d1f0d8799482711fd1fef108211d01138870b9a 100644 (file)
@@ -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)
     {