diff options
author | Tim Rowley <[email protected]> | 2017-06-08 10:38:52 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-06-08 18:07:52 -0500 |
commit | 0b80b025021f97d27520390867c20336dc891a16 (patch) | |
tree | d73ae79685083f6d9fa36de43f3f21434707fa9a /src/gallium/drivers/swr/rasterizer | |
parent | a625d58ee19cd9f88af2ee76de604420c39f5afb (diff) |
swr: relax c++ requirement from c++14 to c++11
Remove c++14 generic lambda to keep compiler requirement at c++11.
No regressions on piglit or vtk test suites.
Tested-by: Chuck Atkins <[email protected]>
Reviewed-by: Bruce Cherniak <[email protected]>
CC: [email protected]
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/state.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h index 364a898c280..3db637036cd 100644 --- a/src/gallium/drivers/swr/rasterizer/core/state.h +++ b/src/gallium/drivers/swr/rasterizer/core/state.h @@ -971,26 +971,27 @@ public: private: + template <typename MaskT> + INLINE __m128i expandThenBlend4(uint32_t* min, uint32_t* max) // @llvm_func_start + { + __m128i vMin = _mm_set1_epi32(*min); + __m128i vMax = _mm_set1_epi32(*max); + return _simd_blend4_epi32<MaskT::value>(vMin, vMax); + } // @llvm_func_end + INLINE void CalcTileSampleOffsets(int numSamples) // @llvm_func_start - { - auto expandThenBlend4 = [](uint32_t* min, uint32_t* max, auto mask) - { - __m128i vMin = _mm_set1_epi32(*min); - __m128i vMax = _mm_set1_epi32(*max); - return _simd_blend4_epi32<decltype(mask)::value>(vMin, vMax); - }; - + { auto minXi = std::min_element(std::begin(_xi), &_xi[numSamples]); auto maxXi = std::max_element(std::begin(_xi), &_xi[numSamples]); - std::integral_constant<int, 0xA> xMask; + using xMask = std::integral_constant<int, 0xA>; // BR(max), BL(min), UR(max), UL(min) - tileSampleOffsetsX = expandThenBlend4(minXi, maxXi, xMask); - + tileSampleOffsetsX = expandThenBlend4<xMask>(minXi, maxXi); + auto minYi = std::min_element(std::begin(_yi), &_yi[numSamples]); auto maxYi = std::max_element(std::begin(_yi), &_yi[numSamples]); - std::integral_constant<int, 0xC> yMask; + using yMask = std::integral_constant<int, 0xC>; // BR(max), BL(min), UR(max), UL(min) - tileSampleOffsetsY = expandThenBlend4(minYi, maxYi, yMask); + tileSampleOffsetsY = expandThenBlend4<yMask>(minYi, maxYi); }; // @llvm_func_end // scalar sample values uint32_t _xi[SWR_MAX_NUM_MULTISAMPLES]; |