swr/rast: convert DWORD->uint32_t, QWORD->uint64_t
authorAlok Hota <alok.hota@intel.com>
Wed, 12 Sep 2018 15:51:36 +0000 (10:51 -0500)
committerAlok Hota <alok.hota@intel.com>
Fri, 15 Feb 2019 20:54:19 +0000 (14:54 -0600)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/backend.h
src/gallium/drivers/swr/rasterizer/core/backend_clear.cpp
src/gallium/drivers/swr/rasterizer/core/binner.cpp
src/gallium/drivers/swr/rasterizer/core/tilemgr.h
src/gallium/drivers/swr/rasterizer/core/utils.h

index 79d9007bee64699f38e7b8b490e9e1f9bbae92df..c9eb6c259e3dbde426d0d4ff1ccf68b9b4b93ab4 100644 (file)
@@ -53,7 +53,7 @@ typedef void (*PFN_CLEAR_TILES)(DRAW_CONTEXT*,
                                 SWR_RENDERTARGET_ATTACHMENT rt,
                                 uint32_t,
                                 uint32_t,
-                                DWORD[4],
+                                uint32_t[4],
                                 const SWR_RECT& rect);
 
 extern PFN_CLEAR_TILES  gClearTilesTable[NUM_SWR_FORMATS];
index 0b14ca09f4cd488efe5404033822c427ff5d14b1..623ebc81d77af60d03211afe66b2cb6ce3e8ada4 100644 (file)
@@ -81,7 +81,7 @@ INLINE void ClearMacroTile(DRAW_CONTEXT*               pDC,
                            SWR_RENDERTARGET_ATTACHMENT rt,
                            uint32_t                    macroTile,
                            uint32_t                    renderTargetArrayIndex,
-                           DWORD                       clear[4],
+                           uint32_t                    clear[4],
                            const SWR_RECT&             rect)
 {
     // convert clear color to hottile format
@@ -223,10 +223,10 @@ void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, vo
                                                       pClear->renderTargetArrayIndex);
 
                 // All we want to do here is to mark the hot tile as being in a "needs clear" state.
-                pHotTile->clearData[0] = *(DWORD*)&(pClear->clearRTColor[0]);
-                pHotTile->clearData[1] = *(DWORD*)&(pClear->clearRTColor[1]);
-                pHotTile->clearData[2] = *(DWORD*)&(pClear->clearRTColor[2]);
-                pHotTile->clearData[3] = *(DWORD*)&(pClear->clearRTColor[3]);
+                pHotTile->clearData[0] = *(uint32_t*)&(pClear->clearRTColor[0]);
+                pHotTile->clearData[1] = *(uint32_t*)&(pClear->clearRTColor[1]);
+                pHotTile->clearData[2] = *(uint32_t*)&(pClear->clearRTColor[2]);
+                pHotTile->clearData[3] = *(uint32_t*)&(pClear->clearRTColor[3]);
                 pHotTile->state        = HOTTILE_CLEAR;
             }
         }
@@ -241,7 +241,7 @@ void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, vo
                                                                   true,
                                                                   numSamples,
                                                                   pClear->renderTargetArrayIndex);
-            pHotTile->clearData[0] = *(DWORD*)&pClear->clearDepth;
+            pHotTile->clearData[0] = *(uint32_t*)&pClear->clearDepth;
             pHotTile->state        = HOTTILE_CLEAR;
         }
 
@@ -270,11 +270,11 @@ void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, vo
 
         if (pClear->attachmentMask & SWR_ATTACHMENT_MASK_COLOR)
         {
-            DWORD clearData[4];
-            clearData[0] = *(DWORD*)&(pClear->clearRTColor[0]);
-            clearData[1] = *(DWORD*)&(pClear->clearRTColor[1]);
-            clearData[2] = *(DWORD*)&(pClear->clearRTColor[2]);
-            clearData[3] = *(DWORD*)&(pClear->clearRTColor[3]);
+            uint32_t clearData[4];
+            clearData[0] = *(uint32_t*)&(pClear->clearRTColor[0]);
+            clearData[1] = *(uint32_t*)&(pClear->clearRTColor[1]);
+            clearData[2] = *(uint32_t*)&(pClear->clearRTColor[2]);
+            clearData[3] = *(uint32_t*)&(pClear->clearRTColor[3]);
 
             PFN_CLEAR_TILES pfnClearTiles = gClearTilesTable[KNOB_COLOR_HOT_TILE_FORMAT];
             SWR_ASSERT(pfnClearTiles != nullptr);
@@ -297,8 +297,8 @@ void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, vo
 
         if (pClear->attachmentMask & SWR_ATTACHMENT_DEPTH_BIT)
         {
-            DWORD clearData[4];
-            clearData[0]                  = *(DWORD*)&pClear->clearDepth;
+            uint32_t clearData[4];
+            clearData[0]                  = *(uint32_t*)&pClear->clearDepth;
             PFN_CLEAR_TILES pfnClearTiles = gClearTilesTable[KNOB_DEPTH_HOT_TILE_FORMAT];
             SWR_ASSERT(pfnClearTiles != nullptr);
 
@@ -313,7 +313,7 @@ void ProcessClearBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, vo
 
         if (pClear->attachmentMask & SWR_ATTACHMENT_STENCIL_BIT)
         {
-            DWORD clearData[4];
+            uint32_t clearData[4];
             clearData[0]                  = pClear->clearStencil;
             PFN_CLEAR_TILES pfnClearTiles = gClearTilesTable[KNOB_STENCIL_HOT_TILE_FORMAT];
 
index 6d9680b72c550ba4b3a2358fd3e1c58b41b5e43c..7731e997ea5142d96bbcd9b06091f5fd0670cac0 100644 (file)
@@ -816,7 +816,7 @@ void SIMDCALL BinTrianglesImpl(DRAW_CONTEXT*          pDC,
     uint32_t        frontFaceMask  = frontWindingTris;
     uint32_t*       pPrimID        = (uint32_t*)&primID;
     const uint32_t* pViewportIndex = (uint32_t*)&viewportIdx;
-    DWORD           triIndex       = 0;
+    uint32_t        triIndex       = 0;
 
     uint32_t      edgeEnable;
     PFN_WORK_FUNC pfnWork;
@@ -1103,7 +1103,7 @@ endBinTriangles:
     TransposeVertices(vHorizW, vRecipW0, vRecipW1, vRecipW2);
 
     // scan remaining valid triangles and bin each separately
-    while (_BitScanForward(&triIndex, triMask))
+    while (_BitScanForward((DWORD*)&triIndex, triMask))
     {
         uint32_t linkageCount     = state.backendState.numAttributes;
         uint32_t numScalarAttribs = linkageCount * 4;
@@ -1339,12 +1339,12 @@ void BinPostSetupPointsImpl(DRAW_CONTEXT*          pDC,
         const uint32_t* aRTAI = reinterpret_cast<const uint32_t*>(&rtIdx);
 
         uint32_t* pPrimID   = (uint32_t*)&primID;
-        DWORD     primIndex = 0;
+        uint32_t  primIndex = 0;
 
         const SWR_BACKEND_STATE& backendState = pDC->pState->state.backendState;
 
         // scan remaining valid triangles and bin each separately
-        while (_BitScanForward(&primIndex, primMask))
+        while (_BitScanForward((DWORD*)&primIndex, primMask))
         {
             uint32_t linkageCount     = backendState.numAttributes;
             uint32_t numScalarAttribs = linkageCount * 4;
@@ -1499,8 +1499,8 @@ void BinPostSetupPointsImpl(DRAW_CONTEXT*          pDC,
 
         // scan remaining valid prims and bin each separately
         const SWR_BACKEND_STATE& backendState = state.backendState;
-        DWORD                    primIndex;
-        while (_BitScanForward(&primIndex, primMask))
+        uint32_t                 primIndex;
+        while (_BitScanForward((DWORD*)&primIndex, primMask))
         {
             uint32_t linkageCount     = backendState.numAttributes;
             uint32_t numScalarAttribs = linkageCount * 4;
@@ -1799,8 +1799,8 @@ void BinPostSetupLinesImpl(DRAW_CONTEXT*          pDC,
     TransposeVertices(vHorizW, vRecipW0, vRecipW1, SIMD_T::setzero_ps());
 
     // scan remaining valid prims and bin each separately
-    DWORD primIndex;
-    while (_BitScanForward(&primIndex, primMask))
+    uint32_t primIndex;
+    while (_BitScanForward((DWORD*)&primIndex, primMask))
     {
         uint32_t linkageCount     = state.backendState.numAttributes;
         uint32_t numScalarAttribs = linkageCount * 4;
index 7173b0248f12deab63108cd83db93bdd21b550b9..ea6e28c4b05d0a59529585d2d8c9fc497fd08345 100644 (file)
@@ -246,7 +246,7 @@ struct HOTTILE
 {
     uint8_t*      pBuffer;
     HOTTILE_STATE state;
-    DWORD clearData[4]; // May need to change based on pfnClearTile implementation.  Reorder for
+    uint32_t clearData[4]; // May need to change based on pfnClearTile implementation.  Reorder for
                         // alignment?
     uint32_t numSamples;
     uint32_t renderTargetArrayIndex; // current render target array index loaded
index 27c9c606d1790de0af1497e4d510682ec66ce4f3..e008cc8d739b401c9a1772e4363930631dabe599 100644 (file)
@@ -370,7 +370,7 @@ static INLINE std::string GetEnv(const std::string& variableName)
 {
     std::string output;
 #if defined(_WIN32)
-    DWORD valueSize = GetEnvironmentVariableA(variableName.c_str(), nullptr, 0);
+    uint32_t valueSize = GetEnvironmentVariableA(variableName.c_str(), nullptr, 0);
     if (!valueSize)
         return output;
     output.resize(valueSize - 1); // valueSize includes null, output.resize() does not