[Mesa-dev] [PATCH 2/4] swr: [rasterizer core] clear data now comes in as float

Rowley, Timothy O timothy.o.rowley at intel.com
Mon Nov 21 17:23:28 UTC 2016


Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com<mailto:timothy.o.rowley at intel.com>>

On Nov 17, 2016, at 6:51 PM, Ilia Mirkin <imirkin at alum.mit.edu<mailto:imirkin at alum.mit.edu>> wrote:

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 at alum.mit.edu<mailto:imirkin at alum.mit.edu>>
---
src/gallium/drivers/swr/rasterizer/core/backend.cpp | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.cpp b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
index 37de650..45eff15 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
@@ -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);
--
2.7.3


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161121/b3cdc9b6/attachment.html>


More information about the mesa-dev mailing list