Merge pull request #3760 from lioncash/vs
pch: Update Visual Studio version check
This commit is contained in:
commit
c63ef18fcc
|
@ -12,6 +12,32 @@
|
||||||
|
|
||||||
namespace MathUtil
|
namespace MathUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
constexpr T SNANConstant()
|
||||||
|
{
|
||||||
|
return std::numeric_limits<T>::signaling_NaN();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
// MSVC needs a workaround, because its std::numeric_limits<double>::signaling_NaN()
|
||||||
|
// will use __builtin_nans, which is improperly handled by the compiler and generates
|
||||||
|
// a bad constant. Here we go back to the version MSVC used before the builtin.
|
||||||
|
// TODO: Remove this and use numeric_limits directly whenever this bug is fixed.
|
||||||
|
template <>
|
||||||
|
constexpr double SNANConstant()
|
||||||
|
{
|
||||||
|
return (_CSTD _Snan._Double);
|
||||||
|
}
|
||||||
|
template <>
|
||||||
|
constexpr float SNANConstant()
|
||||||
|
{
|
||||||
|
return (_CSTD _Snan._Float);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
constexpr T Clamp(const T val, const T& min, const T& max)
|
constexpr T Clamp(const T val, const T& min, const T& max)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ void Renderer::ApplyState(bool bUseDstAlpha)
|
||||||
for (unsigned int stage = 0; stage < 8; stage++)
|
for (unsigned int stage = 0; stage < 8; stage++)
|
||||||
{
|
{
|
||||||
// TODO: cache SamplerState directly, not d3d object
|
// TODO: cache SamplerState directly, not d3d object
|
||||||
gx_state.sampler[stage].max_anisotropy = 1 << g_ActiveConfig.iMaxAnisotropy;
|
gx_state.sampler[stage].max_anisotropy = UINT64_C(1) << g_ActiveConfig.iMaxAnisotropy;
|
||||||
D3D::stateman->SetSampler(stage, gx_state_cache.Get(gx_state.sampler[stage]));
|
D3D::stateman->SetSampler(stage, gx_state_cache.Get(gx_state.sampler[stage]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,8 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#if _MSC_FULL_VER < 190023026
|
#if _MSC_FULL_VER < 190023918
|
||||||
#error Please update your build environment to Visual Studio 2015 or later!
|
#error Please update your build environment to Visual Studio 2015 Update 2 or later!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
|
@ -23,13 +23,13 @@ TEST(MathUtil, Clamp)
|
||||||
TEST(MathUtil, IsQNAN)
|
TEST(MathUtil, IsQNAN)
|
||||||
{
|
{
|
||||||
EXPECT_TRUE(MathUtil::IsQNAN(std::numeric_limits<double>::quiet_NaN()));
|
EXPECT_TRUE(MathUtil::IsQNAN(std::numeric_limits<double>::quiet_NaN()));
|
||||||
EXPECT_FALSE(MathUtil::IsQNAN(std::numeric_limits<double>::signaling_NaN()));
|
EXPECT_FALSE(MathUtil::IsQNAN(MathUtil::SNANConstant<double>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MathUtil, IsSNAN)
|
TEST(MathUtil, IsSNAN)
|
||||||
{
|
{
|
||||||
EXPECT_FALSE(MathUtil::IsSNAN(std::numeric_limits<double>::quiet_NaN()));
|
EXPECT_FALSE(MathUtil::IsSNAN(std::numeric_limits<double>::quiet_NaN()));
|
||||||
EXPECT_TRUE(MathUtil::IsSNAN(std::numeric_limits<double>::signaling_NaN()));
|
EXPECT_TRUE(MathUtil::IsSNAN(MathUtil::SNANConstant<double>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MathUtil, IntLog2)
|
TEST(MathUtil, IntLog2)
|
||||||
|
|
|
@ -221,7 +221,7 @@ TEST_P(VertexLoaderSpeedTest, PositionDirectAll)
|
||||||
m_vtx_attr.g0.PosFormat = format;
|
m_vtx_attr.g0.PosFormat = format;
|
||||||
m_vtx_attr.g0.PosElements = elements;
|
m_vtx_attr.g0.PosElements = elements;
|
||||||
elements += 2;
|
elements += 2;
|
||||||
size_t elem_size = 1 << (format / 2);
|
size_t elem_size = static_cast<size_t>(1) << (format / 2);
|
||||||
CreateAndCheckSizes(elements * elem_size, elements * sizeof(float));
|
CreateAndCheckSizes(elements * elem_size, elements * sizeof(float));
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
RunVertices(100000);
|
RunVertices(100000);
|
||||||
|
@ -239,7 +239,7 @@ TEST_P(VertexLoaderSpeedTest, TexCoordSingleElement)
|
||||||
m_vtx_attr.g0.Tex0CoordFormat = format;
|
m_vtx_attr.g0.Tex0CoordFormat = format;
|
||||||
m_vtx_attr.g0.Tex0CoordElements = elements;
|
m_vtx_attr.g0.Tex0CoordElements = elements;
|
||||||
elements += 1;
|
elements += 1;
|
||||||
size_t elem_size = 1 << (format / 2);
|
size_t elem_size = static_cast<size_t>(1) << (format / 2);
|
||||||
CreateAndCheckSizes(2 * sizeof(s8) + elements * elem_size,
|
CreateAndCheckSizes(2 * sizeof(s8) + elements * elem_size,
|
||||||
2 * sizeof(float) + elements * sizeof(float));
|
2 * sizeof(float) + elements * sizeof(float));
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
|
|
Loading…
Reference in New Issue