swr: [rasterizer core] various code style changes
authorTim Rowley <timothy.o.rowley@intel.com>
Wed, 2 Nov 2016 21:29:29 +0000 (16:29 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Mon, 14 Nov 2016 15:02:31 +0000 (09:02 -0600)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/api.cpp
src/gallium/drivers/swr/rasterizer/core/api.h
src/gallium/drivers/swr/rasterizer/core/binner.cpp
src/gallium/drivers/swr/rasterizer/core/clip.h
src/gallium/drivers/swr/rasterizer/core/context.h
src/gallium/drivers/swr/rasterizer/core/frontend.cpp

index bf7a9f606f524552418e7a5fef029c846f342c18..3c41aecf9b046721481c3709a2d586b122435457 100644 (file)
@@ -155,6 +155,7 @@ HANDLE SwrCreateContext(
     pContext->pfnUpdateSoWriteOffset = pCreateInfo->pfnUpdateSoWriteOffset;
     pContext->pfnUpdateStats = pCreateInfo->pfnUpdateStats;
     pContext->pfnUpdateStatsFE = pCreateInfo->pfnUpdateStatsFE;
+    
 
     // pass pointer to bucket manager back to caller
 #ifdef KNOB_ENABLE_RDTSC
@@ -333,6 +334,7 @@ DRAW_CONTEXT* GetDrawContext(SWR_CONTEXT *pContext, bool isSplitDraw = false)
         pCurDrawContext->drawId = pContext->dcRing.GetHead();
 
         pCurDrawContext->cleanupState = true;
+
     }
     else
     {
@@ -822,6 +824,7 @@ extern PFN_BACKEND_FUNC gBackendPixelRateTable[SWR_MULTISAMPLE_TYPE_COUNT][SWR_M
 extern PFN_BACKEND_FUNC gBackendSampleRateTable[SWR_MULTISAMPLE_TYPE_COUNT][SWR_INPUT_COVERAGE_COUNT][2][2];
 void SetupPipeline(DRAW_CONTEXT *pDC)
 {
+    SWR_CONTEXT* pContext = pDC->pContext;
     DRAW_STATE* pState = pDC->pState;
     const SWR_RASTSTATE &rastState = pState->state.rastState;
     const SWR_PS_STATE &psState = pState->state.psState;
@@ -891,6 +894,7 @@ void SetupPipeline(DRAW_CONTEXT *pDC)
         break;
     };
 
+
     // disable clipper if viewport transform is disabled
     if (pState->state.frontendState.vpTransformDisable)
     {
@@ -912,6 +916,7 @@ void SetupPipeline(DRAW_CONTEXT *pDC)
         pState->pfnProcessPrims = nullptr;
     }
 
+
     // set up the frontend attribute count
     pState->state.feNumAttributes = 0;
     const SWR_BACKEND_STATE& backendState = pState->state.backendState;
@@ -1010,6 +1015,8 @@ void InitDraw(
         SetupMacroTileScissors(pDC);
         SetupPipeline(pDC);
     }
+    
+
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -1137,6 +1144,7 @@ void DrawInstanced(
         pState->rastState.cullMode = SWR_CULLMODE_NONE;
     }
 
+
     int draw = 0;
     while (remainingVerts)
     {
@@ -1175,6 +1183,7 @@ void DrawInstanced(
     pDC = GetDrawContext(pContext);
     pDC->pState->state.rastState.cullMode = oldCullMode;
 
+
     AR_API_END(APIDraw, numVertices * numInstances);
 }
 
@@ -1276,6 +1285,7 @@ void DrawIndexedInstance(
         pState->rastState.cullMode = SWR_CULLMODE_NONE;
     }
 
+
     while (remainingIndices)
     {
         uint32_t numIndicesForDraw = (remainingIndices < maxIndicesPerDraw) ?
@@ -1283,6 +1293,7 @@ void DrawIndexedInstance(
 
         // When breaking up draw, we need to obtain new draw context for each iteration.
         bool isSplitDraw = (draw > 0) ? true : false;
+
         pDC = GetDrawContext(pContext, isSplitDraw);
         InitDraw(pDC, isSplitDraw);
 
@@ -1314,9 +1325,10 @@ void DrawIndexedInstance(
         draw++;
     }
 
-    // restore culling state
+    // Restore culling state
     pDC = GetDrawContext(pContext);
     pDC->pState->state.rastState.cullMode = oldCullMode;
 
     AR_API_END(APIDrawIndexed, numIndices * numInstances);
 }
@@ -1626,3 +1638,4 @@ void SWR_API SwrEndFrame(
 
     pContext->frameCount++;
 }
+
index c4d80165d95baa41008734b5ce61c9ad24096768..cf4bf688ca1fed8b3268c5eb93e0e14554888b6b 100644 (file)
@@ -206,6 +206,7 @@ struct SWR_CREATECONTEXT_INFO
     PFN_UPDATE_STATS            pfnUpdateStats;
     PFN_UPDATE_STATS_FE         pfnUpdateStatsFE;
 
+
     // Pointer to rdtsc buckets mgr returned to the caller.
     // Only populated when KNOB_ENABLE_RDTSC is set
     BucketManager* pBucketMgr;
@@ -648,4 +649,5 @@ void SWR_API SwrEnableStatsBE(
 void SWR_API SwrEndFrame(
     HANDLE hContext);
 
-#endif//__SWR_API_H__
+
+#endif
index 75ddce95ad72aea402637581b0cc4b2af86345b8..f015f21d83702febf46a0fb173d2b95a943510d7 100644 (file)
@@ -761,6 +761,8 @@ void BinTriangles(
         _simd_store_si((simdscalari*)aRTAI, _simd_setzero_si());
     }
 
+endBinTriangles:
+
     // scan remaining valid triangles and bin each separately
     while (_BitScanForward(&triIndex, triMask))
     {
@@ -839,7 +841,6 @@ void BinTriangles(
                      triMask &= ~(1 << triIndex);
     }
 
-endBinTriangles:
     AR_END(FEBinTriangles, 1);
 }
 
@@ -860,6 +861,7 @@ PFN_PROCESS_PRIMS GetBinTrianglesFunc(bool IsConservative)
     return TemplateArgUnroller<FEBinTrianglesChooser>::GetFunc(IsConservative);
 }
 
+
 //////////////////////////////////////////////////////////////////////////
 /// @brief Bin SIMD points to the backend.  Only supports point size of 1
 /// @param pDC - pointer to draw context.
index 3d86b2827a8206a9ac49f72a039e79b4b373c47d..fcb2ecb26737c7e72ec41a57701f97eb1d1be040 100644 (file)
@@ -502,8 +502,7 @@ public:
     void ExecuteStage(PA_STATE& pa, simdvector prim[], uint32_t primMask, simdscalari primId, simdscalari viewportIdx)
     {
         SWR_ASSERT(pa.pDC != nullptr);
-
-        SWR_CONTEXT *pContext = pa.pDC->pContext;
+        SWR_CONTEXT* pContext = pa.pDC->pContext;
 
         // set up binner based on PA state
         PFN_PROCESS_PRIMS pfnBinner;
@@ -524,6 +523,7 @@ public:
             break;
         };
 
+
         // update clipper invocations pipeline stat
         uint32_t numInvoc = _mm_popcnt_u32(primMask);
         UPDATE_STAT_FE(CInvocations, numInvoc);
index e7c462da8b9f419090c929344762d633251670f8..5eb13651bcd4f1ed99676500661bc419cb3f660c 100644 (file)
@@ -415,6 +415,8 @@ struct DRAW_CONTEXT
     volatile int32_t    threadsDone;
 
     SYNC_DESC       retireCallback; // Call this func when this DC is retired.
+
+
 };
 
 static_assert((sizeof(DRAW_CONTEXT) & 63) == 0, "Invalid size for DRAW_CONTEXT");
@@ -496,6 +498,7 @@ struct SWR_CONTEXT
     PFN_UPDATE_STATS            pfnUpdateStats;
     PFN_UPDATE_STATS_FE         pfnUpdateStatsFE;
 
+
     // Global Stats
     SWR_STATS* pStats;
 
index bc8a1dae37e6c777a77d21669dc47d8e1bff4430..a208a36a218de3408452f4e619cf7d6a711aa4b9 100644 (file)
@@ -1388,6 +1388,7 @@ void ProcessDraw(
         pa.Reset();
     }
 
+
     AR_END(FEProcessDraw, numPrims * work.numInstances);
 }