swr: [rasterizer core] clear data now comes in as float
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 18 Nov 2016 00:48:30 +0000 (19:48 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Nov 2016 01:33:36 +0000 (20:33 -0500)
The non-fast-clear path was never updated after clear colors were passed
in as floats. Remove the now-harmful conversion from unorm8.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/core/backend.cpp

index 24779d44a09d31a591fa085a6db354b0443f1311..c4e1dfdb90c54b36bf262fb3b5036003451b186e 100644 (file)
@@ -285,17 +285,11 @@ void ProcessClearBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, vo
 
         if (pClear->attachmentMask & SWR_ATTACHMENT_MASK_COLOR)
         {
-            /// @todo clear data should come in as RGBA32_FLOAT
             DWORD clearData[4];
-            float clearFloat[4];
-            clearFloat[0] = ((uint8_t*)(&pClear->clearRTColor))[0] / 255.0f;
-            clearFloat[1] = ((uint8_t*)(&pClear->clearRTColor))[1] / 255.0f;
-            clearFloat[2] = ((uint8_t*)(&pClear->clearRTColor))[2] / 255.0f;
-            clearFloat[3] = ((uint8_t*)(&pClear->clearRTColor))[3] / 255.0f;
-            clearData[0] = *(DWORD*)&clearFloat[0];
-            clearData[1] = *(DWORD*)&clearFloat[1];
-            clearData[2] = *(DWORD*)&clearFloat[2];
-            clearData[3] = *(DWORD*)&clearFloat[3];
+            clearData[0] = *(DWORD*)&(pClear->clearRTColor[0]);
+            clearData[1] = *(DWORD*)&(pClear->clearRTColor[1]);
+            clearData[2] = *(DWORD*)&(pClear->clearRTColor[2]);
+            clearData[3] = *(DWORD*)&(pClear->clearRTColor[3]);
 
             PFN_CLEAR_TILES pfnClearTiles = sClearTilesTable[KNOB_COLOR_HOT_TILE_FORMAT];
             SWR_ASSERT(pfnClearTiles != nullptr);