swr: [rasterizer core] fix cast for stencil clear value
authorTim Rowley <timothy.o.rowley@intel.com>
Wed, 23 Nov 2016 01:50:55 +0000 (19:50 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 23 Nov 2016 02:06:17 +0000 (20:06 -0600)
Bad type cast for stencil clear value was picking up structure
padding bytes.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/swr/rasterizer/core/backend.cpp

index 0ec64fc2a36989ce97358302ad0f03a296c27a4b..24779d44a09d31a591fa085a6db354b0443f1311 100644 (file)
@@ -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);