swr: [rasterizer] warning cleanup
authorTim Rowley <timothy.o.rowley@intel.com>
Sat, 23 Apr 2016 01:41:23 +0000 (19:41 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 27 Apr 2016 15:41:54 +0000 (10:41 -0500)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/common/swr_assert.h
src/gallium/drivers/swr/rasterizer/core/backend.cpp
src/gallium/drivers/swr/rasterizer/core/format_types.h
src/gallium/drivers/swr/rasterizer/core/frontend.cpp
src/gallium/drivers/swr/rasterizer/core/pa.h
src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp
src/gallium/drivers/swr/rasterizer/core/ringbuffer.h
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
src/gallium/drivers/swr/rasterizer/memory/Convert.h

index fecadb3d4992bae1fd430e71182e47254d802f9b..a805acc777cc7653442ce4a4294b83dbafdd86b7 100644 (file)
 
 #else
 
-#if SWR_ENABLE_ASSERTS
-#if defined(assert)
-#undef assert
-#endif
-#define assert(exp) SWR_ASSERT(exp)
-#endif
-
 bool SwrAssert(
     bool        chkDebugger,
     bool&       enabled,
@@ -87,6 +80,12 @@ bool SwrAssert(
 
 #if SWR_ENABLE_ASSERTS
 #define SWR_ASSERT(e, ...) _SWR_ASSERT(true, e, ##__VA_ARGS__)
+
+#if defined(assert)
+#undef assert
+#endif
+#define assert(exp) SWR_ASSERT(exp)
+
 #endif
 
 #if SWR_ENABLE_REL_ASSERTS
@@ -97,11 +96,11 @@ bool SwrAssert(
 #endif // SWR_ENABLE_ASSERTS || SWR_ENABLE_REL_ASSERTS
 
 #if !SWR_ENABLE_ASSERTS
-#define SWR_ASSERT(e, ...)
+#define SWR_ASSERT(e, ...) (void)(0)
 #endif
 
 #if !SWR_ENABLE_REL_ASSERTS
-#define SWR_REL_ASSERT(e, ...)
+#define SWR_REL_ASSERT(e, ...) (void)(0)
 #endif
 
 #define SWR_NOT_IMPL SWR_ASSERT(0, "%s not implemented", __FUNCTION__)
index 1d923ead6f1461c5482cf41bfc9165b289a7528c..d2547f398888b15f51cf410bca41c8a570e61f3f 100644 (file)
 
 #include <algorithm>
 
-const __m128 vTileOffsetsX = {0.5, KNOB_TILE_X_DIM - 0.5, 0.5, KNOB_TILE_X_DIM - 0.5};
-const __m128 vTileOffsetsY = {0.5, 0.5, KNOB_TILE_Y_DIM - 0.5, KNOB_TILE_Y_DIM - 0.5};
-
-/// @todo move to common lib
-#define MASKTOVEC(i3,i2,i1,i0) {-i0,-i1,-i2,-i3}
-static const __m128 gMaskToVec[] = {
-    MASKTOVEC(0,0,0,0),
-    MASKTOVEC(0,0,0,1),
-    MASKTOVEC(0,0,1,0),
-    MASKTOVEC(0,0,1,1),
-    MASKTOVEC(0,1,0,0),
-    MASKTOVEC(0,1,0,1),
-    MASKTOVEC(0,1,1,0),
-    MASKTOVEC(0,1,1,1),
-    MASKTOVEC(1,0,0,0),
-    MASKTOVEC(1,0,0,1),
-    MASKTOVEC(1,0,1,0),
-    MASKTOVEC(1,0,1,1),
-    MASKTOVEC(1,1,0,0),
-    MASKTOVEC(1,1,0,1),
-    MASKTOVEC(1,1,1,0),
-    MASKTOVEC(1,1,1,1),
-};
-
 typedef void(*PFN_CLEAR_TILES)(DRAW_CONTEXT*, SWR_RENDERTARGET_ATTACHMENT rt, uint32_t, DWORD[4]);
 static PFN_CLEAR_TILES sClearTilesTable[NUM_SWR_FORMATS];
 
index bffb9cc58f763c1f06859095d9a79d3243301c0c..c68062609d828719b014cefbdf8b9d8d5a288586 100644 (file)
@@ -620,7 +620,6 @@ template<> struct TypeTraits<SWR_TYPE_FLOAT, 16> : PackTraits<16>
 
         static const uint32_t HALF_EXP_BITS = 5;
         static const uint32_t HALF_MANTISSA_BITS = 10;
-        static const uint32_t HALF_MANTISSA_MASK = (1U << HALF_MANTISSA_BITS) - 1;
         static const uint32_t HALF_EXP_MASK = ((1U << HALF_EXP_BITS) - 1) << HALF_MANTISSA_BITS;
 
         // minimum exponent required, exponents below this are flushed to 0.
index e6c77d8f068ba00b9f0085a89c6a520ec04726ac..4d5afea5d32b542d08854f624d8515737ebbd821 100644 (file)
@@ -1125,10 +1125,7 @@ static void TessellationStages(
                 {
                     simdvector prim[3]; // Only deal with triangles, lines, or points
                     RDTSC_START(FEPAAssemble);
-#if SWR_ENABLE_ASSERTS
-                    bool assemble =
-#endif
-                        tessPa.Assemble(VERTEX_POSITION_SLOT, prim);
+                    bool assemble = tessPa.Assemble(VERTEX_POSITION_SLOT, prim);
                     RDTSC_STOP(FEPAAssemble, 1, 0);
                     SWR_ASSERT(assemble);
 
@@ -1848,7 +1845,6 @@ void BinTriangles(
                 }
             }
         }
-nextPrimitive:
         triMask &= ~(1 << triIndex);
     }
 
index 067deabb4112421dcdeb08a5dc14564a528bcd42..d3ed279dedf7745b853bc8aa40f7a4b3b8b13a10 100644 (file)
@@ -1009,7 +1009,7 @@ struct PA_TESS : PA_STATE
     simdvector& GetSimdVector(uint32_t index, uint32_t slot)
     {
         SWR_ASSERT(0, "%s NOT IMPLEMENTED", __FUNCTION__);
-        static simdvector junk = { 0 };
+        static simdvector junk;
         return junk;
     }
 
index f7a462c31741611e1be4f89060eeec406d7b3f37..54c2904b5fb8be959610b952fd2b6ee83c42d032 100644 (file)
@@ -45,25 +45,6 @@ void StepRasterTileY(uint32_t MaxRT, RenderOutputBuffers &buffers, RenderOutputB
                      uint32_t colorRowStep, uint32_t depthRowStep, uint32_t stencilRowStep);
 
 #define MASKTOVEC(i3,i2,i1,i0) {-i0,-i1,-i2,-i3}
-const __m128 gMaskToVec[] = {
-    MASKTOVEC(0,0,0,0),
-    MASKTOVEC(0,0,0,1),
-    MASKTOVEC(0,0,1,0),
-    MASKTOVEC(0,0,1,1),
-    MASKTOVEC(0,1,0,0),
-    MASKTOVEC(0,1,0,1),
-    MASKTOVEC(0,1,1,0),
-    MASKTOVEC(0,1,1,1),
-    MASKTOVEC(1,0,0,0),
-    MASKTOVEC(1,0,0,1),
-    MASKTOVEC(1,0,1,0),
-    MASKTOVEC(1,0,1,1),
-    MASKTOVEC(1,1,0,0),
-    MASKTOVEC(1,1,0,1),
-    MASKTOVEC(1,1,1,0),
-    MASKTOVEC(1,1,1,1),
-};
-
 const __m256d gMaskToVecpd[] =
 {
     MASKTOVEC(0, 0, 0, 0),
@@ -1172,16 +1153,20 @@ void StepRasterTileY(uint32_t NumRT, RenderOutputBuffers &buffers, RenderOutputB
 // initialize rasterizer function table
 PFN_WORK_FUNC gRasterizerTable[2][SWR_MULTISAMPLE_TYPE_MAX] =
 {
-    RasterizeTriangle<false, SWR_MULTISAMPLE_1X>,
-    RasterizeTriangle<false, SWR_MULTISAMPLE_2X>,
-    RasterizeTriangle<false, SWR_MULTISAMPLE_4X>,
-    RasterizeTriangle<false, SWR_MULTISAMPLE_8X>,
-    RasterizeTriangle<false, SWR_MULTISAMPLE_16X>,
-    RasterizeTriangle<true, SWR_MULTISAMPLE_1X>,
-    RasterizeTriangle<true, SWR_MULTISAMPLE_2X>,
-    RasterizeTriangle<true, SWR_MULTISAMPLE_4X>,
-    RasterizeTriangle<true, SWR_MULTISAMPLE_8X>,
-    RasterizeTriangle<true, SWR_MULTISAMPLE_16X>
+    {
+        RasterizeTriangle<false, SWR_MULTISAMPLE_1X>,
+        RasterizeTriangle<false, SWR_MULTISAMPLE_2X>,
+        RasterizeTriangle<false, SWR_MULTISAMPLE_4X>,
+        RasterizeTriangle<false, SWR_MULTISAMPLE_8X>,
+        RasterizeTriangle<false, SWR_MULTISAMPLE_16X>
+    },
+    {
+        RasterizeTriangle<true, SWR_MULTISAMPLE_1X>,
+        RasterizeTriangle<true, SWR_MULTISAMPLE_2X>,
+        RasterizeTriangle<true, SWR_MULTISAMPLE_4X>,
+        RasterizeTriangle<true, SWR_MULTISAMPLE_8X>,
+        RasterizeTriangle<true, SWR_MULTISAMPLE_16X>
+    }
 };
 
 void RasterizeLine(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData)
index 7ff109d4fe865fe89fa75ba8f69d4276c0b41726..d8eb50a8d83820d53dbb2732afc2c13f87e62d73 100644 (file)
@@ -90,8 +90,8 @@ public:
         return (numEnqueued == mNumEntries);
     }
 
-    INLINE volatile uint64_t GetTail() { return mRingTail; }
-    INLINE volatile uint64_t GetHead() { return mRingHead; }
+    INLINE uint64_t GetTail() volatile { return mRingTail; }
+    INLINE uint64_t GetHead() volatile { return mRingHead; }
 
 protected:
     T* mpRingBuffer;
index 74668a65bad95d5ed884e0a6b76d715f75442159..ba1096dc21487af9e5272393d5625dec4d488274 100644 (file)
@@ -533,8 +533,6 @@ void FetchJit::CreateGatherOddFormats(SWR_FORMAT format, Value* pBase, Value* of
     // only works if pixel size is <= 32bits
     SWR_ASSERT(info.bpp <= 32);
 
-    uint32_t numComps = info.numComps;
-
     Value* gather = VUNDEF_I();
 
     // assign defaults
index 7c185e5e4541077275a329047530a5e77749e1bd..4c4642f6c641d2c8464b8a5e59be3f2cb7df79bf 100644 (file)
@@ -37,7 +37,7 @@
 ///        float
 /// @param val - 16-bit float
 /// @todo Maybe move this outside of this file into a header?
-static float ConvertSmallFloatTo32(UINT val)
+static INLINE float ConvertSmallFloatTo32(UINT val)
 {
     UINT result;
     if ((val & 0x7fff) == 0)