mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
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 <chuck.atkins@kitware.com> Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com> CC: mesa-stable@lists.freedesktop.org
This commit is contained in:
parent
a625d58ee1
commit
0b80b02502
4 changed files with 21 additions and 20 deletions
|
|
@ -2472,10 +2472,10 @@ if test -n "$with_gallium_drivers"; then
|
||||||
xswr)
|
xswr)
|
||||||
llvm_require_version $LLVM_REQUIRED_SWR "swr"
|
llvm_require_version $LLVM_REQUIRED_SWR "swr"
|
||||||
|
|
||||||
swr_require_cxx_feature_flags "C++14" "__cplusplus >= 201402L" \
|
swr_require_cxx_feature_flags "C++11" "__cplusplus >= 201103L" \
|
||||||
"-std=c++14" \
|
",-std=c++11" \
|
||||||
SWR_CXX14_CXXFLAGS
|
SWR_CXX11_CXXFLAGS
|
||||||
AC_SUBST([SWR_CXX14_CXXFLAGS])
|
AC_SUBST([SWR_CXX11_CXXFLAGS])
|
||||||
|
|
||||||
swr_require_cxx_feature_flags "AVX" "defined(__AVX__)" \
|
swr_require_cxx_feature_flags "AVX" "defined(__AVX__)" \
|
||||||
",-mavx,-march=core-avx" \
|
",-mavx,-march=core-avx" \
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
include Makefile.sources
|
include Makefile.sources
|
||||||
include $(top_srcdir)/src/gallium/Automake.inc
|
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
|
noinst_LTLIBRARIES = libmesaswr.la
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ COMMON_CXXFLAGS = \
|
||||||
-fno-strict-aliasing \
|
-fno-strict-aliasing \
|
||||||
$(GALLIUM_DRIVER_CFLAGS) \
|
$(GALLIUM_DRIVER_CFLAGS) \
|
||||||
$(LLVM_CXXFLAGS) \
|
$(LLVM_CXXFLAGS) \
|
||||||
$(SWR_CXX14_CXXFLAGS) \
|
$(SWR_CXX11_CXXFLAGS) \
|
||||||
-I$(builddir)/rasterizer/codegen \
|
-I$(builddir)/rasterizer/codegen \
|
||||||
-I$(builddir)/rasterizer/jitter \
|
-I$(builddir)/rasterizer/jitter \
|
||||||
-I$(builddir)/rasterizer/archrast \
|
-I$(builddir)/rasterizer/archrast \
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ loadersource = env.ParseSourceList('Makefile.sources', [
|
||||||
|
|
||||||
if not env['msvc'] :
|
if not env['msvc'] :
|
||||||
env.Append(CCFLAGS = [
|
env.Append(CCFLAGS = [
|
||||||
'-std=c++14',
|
'-std=c++11',
|
||||||
])
|
])
|
||||||
|
|
||||||
swrroot = '#src/gallium/drivers/swr/'
|
swrroot = '#src/gallium/drivers/swr/'
|
||||||
|
|
|
||||||
|
|
@ -971,26 +971,27 @@ public:
|
||||||
|
|
||||||
|
|
||||||
private:
|
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
|
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 minXi = std::min_element(std::begin(_xi), &_xi[numSamples]);
|
||||||
auto maxXi = std::max_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)
|
// 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 minYi = std::min_element(std::begin(_yi), &_yi[numSamples]);
|
||||||
auto maxYi = std::max_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)
|
// BR(max), BL(min), UR(max), UL(min)
|
||||||
tileSampleOffsetsY = expandThenBlend4(minYi, maxYi, yMask);
|
tileSampleOffsetsY = expandThenBlend4<yMask>(minYi, maxYi);
|
||||||
}; // @llvm_func_end
|
}; // @llvm_func_end
|
||||||
// scalar sample values
|
// scalar sample values
|
||||||
uint32_t _xi[SWR_MAX_NUM_MULTISAMPLES];
|
uint32_t _xi[SWR_MAX_NUM_MULTISAMPLES];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue