[Mesa-dev] [PATCH] swr: [rasterizer core] fix cast for stencil clear value
Ilia Mirkin
imirkin at alum.mit.edu
Wed Nov 23 02:01:27 UTC 2016
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
On Tue, Nov 22, 2016 at 8:56 PM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> Bad type cast for stencil clear value was picking up structure
> padding bytes.
> ---
> src/gallium/drivers/swr/rasterizer/core/backend.cpp | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.cpp b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
> index 0ec64fc..24779d4 100644
> --- a/src/gallium/drivers/swr/rasterizer/core/backend.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
> @@ -271,7 +271,7 @@ void ProcessClearBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, vo
> {
> HOTTILE *pHotTile = pContext->pHotTileMgr->GetHotTile(pContext, pDC, macroTile, SWR_ATTACHMENT_STENCIL, true, numSamples);
>
> - pHotTile->clearData[0] = *(DWORD*)&pClear->clearStencil;
> + pHotTile->clearData[0] = pClear->clearStencil;
> pHotTile->state = HOTTILE_CLEAR;
> }
>
> @@ -322,9 +322,8 @@ void ProcessClearBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, vo
>
> if (pClear->attachmentMask & SWR_ATTACHMENT_STENCIL_BIT)
> {
> - uint32_t value = pClear->clearStencil;
> DWORD clearData[4];
> - clearData[0] = *(DWORD*)&value;
> + clearData[0] = pClear->clearStencil;
> PFN_CLEAR_TILES pfnClearTiles = sClearTilesTable[KNOB_STENCIL_HOT_TILE_FORMAT];
>
> pfnClearTiles(pDC, SWR_ATTACHMENT_STENCIL, macroTile, clearData, pClear->rect);
> --
> 2.7.4
>
More information about the mesa-dev
mailing list