swr/rast: use proper alignment for debug transposedPrims
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 3 Oct 2017 20:23:44 +0000 (15:23 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Fri, 6 Oct 2017 18:27:39 +0000 (13:27 -0500)
Causing a crash in ParaView waveletcontour.py test when
_DEBUG defined due to vector aligned copy with unaligned
address.

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

index cde5261521e5e4b6393ab4067432bc56ffd58369..e9a410daa31967ba20ef7484790dfabfd0fa3180 100644 (file)
@@ -561,7 +561,7 @@ public:
 
 #if defined(_DEBUG)
         // TODO: need to increase stack size, allocating SIMD16-widened transposedPrims causes stack overflow in debug builds
-        SIMDVERTEX_T<SIMD_T> *transposedPrims = reinterpret_cast<SIMDVERTEX_T<SIMD_T> *>(malloc(sizeof(SIMDVERTEX_T<SIMD_T>) * 2));
+        SIMDVERTEX_T<SIMD_T> *transposedPrims = reinterpret_cast<SIMDVERTEX_T<SIMD_T> *>(AlignedMalloc(sizeof(SIMDVERTEX_T<SIMD_T>) * 2, 64));
 
 #else
         SIMDVERTEX_T<SIMD_T> transposedPrims[2];
@@ -667,7 +667,7 @@ public:
         }
 
 #if defined(_DEBUG)
-        free(transposedPrims);
+        AlignedFree(transposedPrims);
 
 #endif
         // update global pipeline stat