From 0b80b025021f97d27520390867c20336dc891a16 Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Thu, 8 Jun 2017 10:38:52 -0500 Subject: 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 Reviewed-by: Bruce Cherniak CC: mesa-stable@lists.freedesktop.org --- src/gallium/drivers/swr/Makefile.am | 4 ++-- src/gallium/drivers/swr/SConscript | 2 +- src/gallium/drivers/swr/rasterizer/core/state.h | 27 +++++++++++++------------ 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'src/gallium/drivers/swr') diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am index 7b2da074162..6650abda5ae 100644 --- a/src/gallium/drivers/swr/Makefile.am +++ b/src/gallium/drivers/swr/Makefile.am @@ -22,7 +22,7 @@ include Makefile.sources include $(top_srcdir)/src/gallium/Automake.inc -AM_CXXFLAGS = $(GALLIUM_DRIVER_CFLAGS) $(SWR_CXX14_CXXFLAGS) +AM_CXXFLAGS = $(GALLIUM_DRIVER_CFLAGS) $(SWR_CXX11_CXXFLAGS) noinst_LTLIBRARIES = libmesaswr.la @@ -32,7 +32,7 @@ COMMON_CXXFLAGS = \ -fno-strict-aliasing \ $(GALLIUM_DRIVER_CFLAGS) \ $(LLVM_CXXFLAGS) \ - $(SWR_CXX14_CXXFLAGS) \ + $(SWR_CXX11_CXXFLAGS) \ -I$(builddir)/rasterizer/codegen \ -I$(builddir)/rasterizer/jitter \ -I$(builddir)/rasterizer/archrast \ diff --git a/src/gallium/drivers/swr/SConscript b/src/gallium/drivers/swr/SConscript index 5e3784b51f4..cdb85e2cad4 100644 --- a/src/gallium/drivers/swr/SConscript +++ b/src/gallium/drivers/swr/SConscript @@ -38,7 +38,7 @@ loadersource = env.ParseSourceList('Makefile.sources', [ if not env['msvc'] : env.Append(CCFLAGS = [ - '-std=c++14', + '-std=c++11', ]) swrroot = '#src/gallium/drivers/swr/' 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 + 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(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(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 xMask; + using xMask = std::integral_constant; // BR(max), BL(min), UR(max), UL(min) - tileSampleOffsetsX = expandThenBlend4(minXi, maxXi, xMask); - + tileSampleOffsetsX = expandThenBlend4(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 yMask; + using yMask = std::integral_constant; // BR(max), BL(min), UR(max), UL(min) - tileSampleOffsetsY = expandThenBlend4(minYi, maxYi, yMask); + tileSampleOffsetsY = expandThenBlend4(minYi, maxYi); }; // @llvm_func_end // scalar sample values uint32_t _xi[SWR_MAX_NUM_MULTISAMPLES]; -- cgit v1.2.3