[Mesa-dev] [PATCH 07/31] swr/rast: Removed unused variable

George Kyriazis george.kyriazis at intel.com
Tue Feb 13 22:42:25 UTC 2018


Gets rid of zillions of unused variable warnings, made worse by templates.
---
 src/gallium/drivers/swr/rasterizer/core/backend.cpp              | 2 --
 src/gallium/drivers/swr/rasterizer/core/backend_impl.h           | 3 ---
 src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp       | 2 --
 src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp | 2 --
 src/gallium/drivers/swr/rasterizer/core/binner.cpp               | 4 ----
 src/gallium/drivers/swr/rasterizer/core/clip.cpp                 | 6 ------
 src/gallium/drivers/swr/rasterizer/core/clip.h                   | 2 --
 src/gallium/drivers/swr/rasterizer/core/context.h                | 4 ++--
 src/gallium/drivers/swr/rasterizer/core/frontend.cpp             | 5 -----
 src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp           | 3 ---
 src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h        | 3 ---
 11 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.cpp b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
index 5878361..ccc7150 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/backend.cpp
@@ -199,8 +199,6 @@ void ProcessDiscardInvalidateTilesBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint3
 template<uint32_t sampleCountT>
 void BackendNullPS(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t y, SWR_TRIANGLE_DESC &work, RenderOutputBuffers &renderBuffers)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(BENullBackend, pDC->drawId);
     ///@todo: handle center multisample pattern
     RDTSC_BEGIN(BESetup, pDC->drawId);
diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_impl.h b/src/gallium/drivers/swr/rasterizer/core/backend_impl.h
index b62ff03..2cfd52e 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend_impl.h
+++ b/src/gallium/drivers/swr/rasterizer/core/backend_impl.h
@@ -569,7 +569,6 @@ struct PixelRateZTestLoop
     uint32_t operator()(simdscalar& activeLanes, SWR_PS_CONTEXT& psContext, 
                         const CORE_BUCKETS BEDepthBucket, uint32_t currentSimdIn8x8 = 0)
     {
-        SWR_CONTEXT *pContext = pDC->pContext;
 
         uint32_t statCount = 0;
         simdscalar anyDepthSamplePassed = _simd_setzero_ps();
@@ -867,8 +866,6 @@ void BackendPixelRate(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t
     ///@todo: Need to move locals off stack to prevent __chkstk's from being generated for the backend
 
 
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(BEPixelRateBackend, pDC->drawId);
     RDTSC_BEGIN(BESetup, pDC->drawId);
 
diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp b/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp
index 8f0a5b1..16418f7 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp
@@ -40,8 +40,6 @@
 template<typename T>
 void BackendSampleRate(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t y, SWR_TRIANGLE_DESC &work, RenderOutputBuffers &renderBuffers)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(BESampleRateBackend, pDC->drawId);
     RDTSC_BEGIN(BESetup, pDC->drawId);
 
diff --git a/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp b/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp
index 57338af..4cc1ed5 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp
@@ -40,8 +40,6 @@
 template<typename T>
 void BackendSingleSample(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t y, SWR_TRIANGLE_DESC &work, RenderOutputBuffers &renderBuffers)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(BESingleSampleBackend, pDC->drawId);
     RDTSC_BEGIN(BESetup, pDC->drawId);
 
diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp
index 986ecc6..4510b13 100644
--- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp
@@ -648,7 +648,6 @@ void SIMDCALL BinTrianglesImpl(
     typename SIMD_T::Integer const &viewportIdx,
     typename SIMD_T::Integer const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     const uint32_t *aRTAI = reinterpret_cast<const uint32_t *>(&rtIdx);
 
     RDTSC_BEGIN(FEBinTriangles, pDC->drawId);
@@ -1195,8 +1194,6 @@ void BinPostSetupPointsImpl(
     typename SIMD_T::Integer const &viewportIdx,
     typename SIMD_T::Integer const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(FEBinPoints, pDC->drawId);
 
     typename SIMD_T::Vec4 &primVerts = prim[0];
@@ -1605,7 +1602,6 @@ void BinPostSetupLinesImpl(
     typename SIMD_T::Integer const &viewportIdx,
     typename SIMD_T::Integer const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     const uint32_t *aRTAI = reinterpret_cast<const uint32_t *>(&rtIdx);
 
     RDTSC_BEGIN(FEBinLines, pDC->drawId);
diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.cpp b/src/gallium/drivers/swr/rasterizer/core/clip.cpp
index 22d89bc..780ca15 100644
--- a/src/gallium/drivers/swr/rasterizer/core/clip.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/clip.cpp
@@ -163,7 +163,6 @@ int ClipTriToPlane( const float *pInPts, int numInPts,
 void ClipTriangles(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvector prims[], uint32_t primMask,
                    simdscalari const &primId, simdscalari const &viewportIdx, simdscalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipTriangles, pDC->drawId);
     Clipper<SIMD256, 3> clipper(workerId, pDC);
     clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
@@ -173,7 +172,6 @@ void ClipTriangles(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvecto
 void ClipLines(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvector prims[], uint32_t primMask,
                simdscalari const &primId, simdscalari const &viewportIdx, simdscalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipLines, pDC->drawId);
     Clipper<SIMD256, 2> clipper(workerId, pDC);
     clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
@@ -183,7 +181,6 @@ void ClipLines(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvector pr
 void ClipPoints(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvector prims[], uint32_t primMask,
                 simdscalari const &primId, simdscalari const &viewportIdx, simdscalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipPoints, pDC->drawId);
     Clipper<SIMD256, 1> clipper(workerId, pDC);
     clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
@@ -194,7 +191,6 @@ void ClipPoints(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simdvector p
 void SIMDCALL ClipTriangles_simd16(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simd16vector prims[], uint32_t primMask,
                                    simd16scalari const &primId, simd16scalari const &viewportIdx, simd16scalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipTriangles, pDC->drawId);
 
     enum { VERTS_PER_PRIM = 3 };
@@ -210,7 +206,6 @@ void SIMDCALL ClipTriangles_simd16(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t wor
 void SIMDCALL ClipLines_simd16(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simd16vector prims[], uint32_t primMask,
                                simd16scalari const &primId, simd16scalari const &viewportIdx, simd16scalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipLines, pDC->drawId);
 
     enum { VERTS_PER_PRIM = 2 };
@@ -226,7 +221,6 @@ void SIMDCALL ClipLines_simd16(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerI
 void SIMDCALL ClipPoints_simd16(DRAW_CONTEXT *pDC, PA_STATE& pa, uint32_t workerId, simd16vector prims[], uint32_t primMask,
                                 simd16scalari const &primId, simd16scalari const &viewportIdx, simd16scalari const &rtIdx)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     RDTSC_BEGIN(FEClipPoints, pDC->drawId);
 
     enum { VERTS_PER_PRIM = 1 };
diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.h b/src/gallium/drivers/swr/rasterizer/core/clip.h
index cda40f1..f47b4b0 100644
--- a/src/gallium/drivers/swr/rasterizer/core/clip.h
+++ b/src/gallium/drivers/swr/rasterizer/core/clip.h
@@ -687,8 +687,6 @@ public:
     {
         SWR_ASSERT(pa.pDC != nullptr);
 
-        SWR_CONTEXT *pContext = pa.pDC->pContext;
-
         BinnerChooser<SIMD_T> binner(pa.binTopology, pa.pDC->pState->state.rastState.conservativeRast);
 
         // update clipper invocations pipeline stat
diff --git a/src/gallium/drivers/swr/rasterizer/core/context.h b/src/gallium/drivers/swr/rasterizer/core/context.h
index 5bae53f..a284c42 100644
--- a/src/gallium/drivers/swr/rasterizer/core/context.h
+++ b/src/gallium/drivers/swr/rasterizer/core/context.h
@@ -523,8 +523,8 @@ struct SWR_CONTEXT
 #define UPDATE_STAT_FE(name, count) if (GetApiState(pDC).enableStatsFE) { pDC->dynState.statsFE.name += count; }
 
 // ArchRast instrumentation framework
-#define AR_WORKER_CTX  pContext->pArContext[workerId]
-#define AR_API_CTX     pContext->pArContext[pContext->NumWorkerThreads]
+#define AR_WORKER_CTX  pDC->pContext->pArContext[workerId]
+#define AR_API_CTX     pDC->pContext->pArContext[pContext->NumWorkerThreads]
 
 #ifdef KNOB_ENABLE_RDTSC
 #define RDTSC_BEGIN(type, drawid) RDTSC_START(type)
diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
index a9b1372..c44dd2c 100644
--- a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
@@ -505,8 +505,6 @@ static void StreamOut(
     uint32_t* pPrimData,
     uint32_t streamIndex)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(FEStreamout, pDC->drawId);
 
     const API_STATE& state = GetApiState(pDC);
@@ -799,8 +797,6 @@ static void GeometryShaderStage(
 #endif
     simdscalari const &primID)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
     RDTSC_BEGIN(FEGeometryShader, pDC->drawId);
 
     const API_STATE& state = GetApiState(pDC);
@@ -1170,7 +1166,6 @@ static void TessellationStages(
 #endif
     simdscalari const &primID)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     const API_STATE& state = GetApiState(pDC);
     const SWR_TS_STATE& tsState = state.tsState;
 
diff --git a/src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp b/src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp
index 6c5f17d..08dd51b 100644
--- a/src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp
@@ -43,7 +43,6 @@ PFN_WORK_FUNC gRasterizerFuncs[SWR_MULTISAMPLE_TYPE_COUNT][2][2][SWR_INPUT_COVER
 
 void RasterizeLine(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     const TRIANGLE_WORK_DESC &workDesc = *((TRIANGLE_WORK_DESC*)pData);
 #if KNOB_ENABLE_TOSS_POINTS
     if (KNOB_TOSS_BIN_TRIS)
@@ -251,8 +250,6 @@ void RasterizeLine(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, voi
 
 void RasterizeSimplePoint(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void* pData)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
-
 #if KNOB_ENABLE_TOSS_POINTS
     if (KNOB_TOSS_BIN_TRIS)
     {
diff --git a/src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h b/src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h
index 6dba1b6..62856cc 100644
--- a/src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h
+++ b/src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h
@@ -772,8 +772,6 @@ struct GenerateSVInnerCoverage<RT, AllEdgesValidT, InnerConservativeCoverageT>
 {
     INLINE GenerateSVInnerCoverage(DRAW_CONTEXT* pDC, uint32_t workerId, EDGE* pRastEdges, double* pStartQuadEdges,  uint64_t &innerCoverageMask)
     {
-        SWR_CONTEXT *pContext = pDC->pContext;
-
         double startQuadEdgesAdj[RT::NumEdgesT::value];
         for(uint32_t e = 0; e < RT::NumEdgesT::value; ++e)
         {
@@ -839,7 +837,6 @@ struct UpdateEdgeMasksInnerConservative<RT, ValidEdgeMaskT, InnerConservativeCov
 template <typename RT>
 void RasterizeTriangle(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pDesc)
 {
-    SWR_CONTEXT *pContext = pDC->pContext;
     const TRIANGLE_WORK_DESC &workDesc = *((TRIANGLE_WORK_DESC*)pDesc);
 #if KNOB_ENABLE_TOSS_POINTS
     if (KNOB_TOSS_BIN_TRIS)
-- 
2.7.4



More information about the mesa-dev mailing list