[Mesa-dev] [PATCH 2/2] swr/rast: use proper alignment for debug transposedPrims

Cherniak, Bruce bruce.cherniak at intel.com
Wed Oct 4 13:50:04 UTC 2017


Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com> 

> On Oct 3, 2017, at 3:23 PM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> 
> Causing a crash in ParaView waveletcontour.py test when
> _DEBUG defined due to vector aligned copy with unaligned
> address.
> ---
> src/gallium/drivers/swr/rasterizer/core/clip.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.h b/src/gallium/drivers/swr/rasterizer/core/clip.h
> index cde5261521..e9a410daa3 100644
> --- a/src/gallium/drivers/swr/rasterizer/core/clip.h
> +++ b/src/gallium/drivers/swr/rasterizer/core/clip.h
> @@ -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
> -- 
> 2.11.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list