[Mesa-dev] [PATCH v2 15/19] swr: [rasterizer core] move MultisampleTrait static from header to cpp

Tim Rowley timothy.o.rowley at intel.com
Tue May 17 22:36:37 UTC 2016


Move a MultisampleTrait static from header to cpp as clang seemed to get
confused with some specializations in the header vs some in cpp.
---
 src/gallium/drivers/swr/rasterizer/core/format_types.h  | 2 ++
 src/gallium/drivers/swr/rasterizer/core/multisample.cpp | 5 +++--
 src/gallium/drivers/swr/rasterizer/core/multisample.h   | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/format_types.h b/src/gallium/drivers/swr/rasterizer/core/format_types.h
index c680626..afb6337 100644
--- a/src/gallium/drivers/swr/rasterizer/core/format_types.h
+++ b/src/gallium/drivers/swr/rasterizer/core/format_types.h
@@ -27,6 +27,8 @@
 ******************************************************************************/
 #pragma once
 
+#include "utils.h"
+
 //////////////////////////////////////////////////////////////////////////
 /// PackTraits - Helpers for packing / unpacking same pixel sizes
 //////////////////////////////////////////////////////////////////////////
diff --git a/src/gallium/drivers/swr/rasterizer/core/multisample.cpp b/src/gallium/drivers/swr/rasterizer/core/multisample.cpp
index 643ba13..94992e3 100644
--- a/src/gallium/drivers/swr/rasterizer/core/multisample.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/multisample.cpp
@@ -25,7 +25,8 @@
 ******************************************************************************/
 
 #include "multisample.h"
-
+const uint32_t MultisampleTraits<SWR_MULTISAMPLE_1X>::samplePosXi {0x80};
+const uint32_t MultisampleTraits<SWR_MULTISAMPLE_1X>::samplePosYi {0x80};
 const uint32_t MultisampleTraits<SWR_MULTISAMPLE_2X>::samplePosXi[2] {0xC0, 0x40};
 const uint32_t MultisampleTraits<SWR_MULTISAMPLE_2X>::samplePosYi[2] {0xC0, 0x40};
 const uint32_t MultisampleTraits<SWR_MULTISAMPLE_4X>::samplePosXi[4] {0x60, 0xE0, 0x20, 0xA0};
@@ -61,4 +62,4 @@ const float MultisampleTraits<SWR_MULTISAMPLE_8X, SWR_MSAA_CENTER_PATTERN>::samp
 const float MultisampleTraits<SWR_MULTISAMPLE_16X, SWR_MSAA_CENTER_PATTERN>::samplePosX[16]
 { 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
 const float MultisampleTraits<SWR_MULTISAMPLE_16X, SWR_MSAA_CENTER_PATTERN>::samplePosY[16]
-{ 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
\ No newline at end of file
+{ 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
diff --git a/src/gallium/drivers/swr/rasterizer/core/multisample.h b/src/gallium/drivers/swr/rasterizer/core/multisample.h
index 7213a38..a52e8ac 100644
--- a/src/gallium/drivers/swr/rasterizer/core/multisample.h
+++ b/src/gallium/drivers/swr/rasterizer/core/multisample.h
@@ -120,8 +120,8 @@ struct MultisampleTraits<SWR_MULTISAMPLE_1X, SWR_MSAA_STANDARD_PATTERN>
 
     INLINE static simdscalari FullSampleMask(){return _simd_set1_epi32(0x1);};
 
-    static const uint32_t samplePosXi {0x80};
-    static const uint32_t samplePosYi {0x80};
+    static const uint32_t samplePosXi;
+    static const uint32_t samplePosYi;
     static const float samplePosX;
     static const float samplePosY;
     static const uint32_t numSamples = 1;
-- 
1.9.1



More information about the mesa-dev mailing list