From 2656a940c2d4c0e56cb84467a065b566cb93058c Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Thu, 20 Jul 2017 09:47:11 -0500 Subject: [PATCH] swr/rast: cache line align hottile buffers Prevents unalignment crashes with avx512 code on gcc/clang. Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp index eb60eb40815..a6c54ab86e8 100644 --- a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp @@ -100,7 +100,7 @@ HOTTILE* HotTileMgr::GetHotTile(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32 { uint32_t size = numSamples * mHotTileSize[attachment]; uint32_t numaNode = ((x ^ y) & pContext->threadPool.numaMask); - hotTile.pBuffer = (uint8_t*)AllocHotTileMem(size, KNOB_SIMD_WIDTH * 4, numaNode); + hotTile.pBuffer = (uint8_t*)AllocHotTileMem(size, 64, numaNode); hotTile.state = HOTTILE_INVALID; hotTile.numSamples = numSamples; hotTile.renderTargetArrayIndex = renderTargetArrayIndex; @@ -124,7 +124,7 @@ HOTTILE* HotTileMgr::GetHotTile(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32 uint32_t size = numSamples * mHotTileSize[attachment]; uint32_t numaNode = ((x ^ y) & pContext->threadPool.numaMask); - hotTile.pBuffer = (uint8_t*)AllocHotTileMem(size, KNOB_SIMD_WIDTH * 4, numaNode); + hotTile.pBuffer = (uint8_t*)AllocHotTileMem(size, 64, numaNode); hotTile.state = HOTTILE_INVALID; hotTile.numSamples = numSamples; } @@ -194,7 +194,7 @@ HOTTILE* HotTileMgr::GetHotTileNoLoad( if (create) { uint32_t size = numSamples * mHotTileSize[attachment]; - hotTile.pBuffer = (uint8_t*)AlignedMalloc(size, KNOB_SIMD_WIDTH * 4); + hotTile.pBuffer = (uint8_t*)AlignedMalloc(size, 64); hotTile.state = HOTTILE_INVALID; hotTile.numSamples = numSamples; hotTile.renderTargetArrayIndex = 0; -- 2.30.2