From 44025def06a8b8d1c019f611079a003964ea7511 Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Tue, 7 Nov 2017 15:24:25 -0600 Subject: [PATCH] swr/rast: Add alignment to transpose targets Needed to ensure alignment for avx512. Fixes address sanitizer crash. Reviewed-by: Bruce Cherniak --- .../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 b624ae69b34..9d1f0d87994 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.30.2