From ffa21ed0d0aa64a70a84c2148f56983641a83b18 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 28 Jul 2014 16:57:21 +0000 Subject: [PATCH] misc: disable all 16-bit float vectors when using Visual Studio. --- src/gpu/vertexbuffer.cpp | 2 ++ src/lol/gpu/vertexbuffer.h | 4 ++++ src/math/constants.cpp | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/src/gpu/vertexbuffer.cpp b/src/gpu/vertexbuffer.cpp index 6c94e804..550a2a56 100644 --- a/src/gpu/vertexbuffer.cpp +++ b/src/gpu/vertexbuffer.cpp @@ -629,7 +629,9 @@ VertexStreamBase VertexDeclaration::GetStream(int index) const case VertexStreamBase::Type##T: stream.AddStream(n++, m_streams[i].usage); break; __T(void) +#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS __T(half) __T(f16vec2) __T(f16vec3) __T(f16vec4) +#endif __T(float) __T(vec2) __T(vec3) __T(vec4) __T(double) __T(dvec2) __T(dvec3) __T(dvec4) __T(int8_t) __T(i8vec2) __T(i8vec3) __T(i8vec4) diff --git a/src/lol/gpu/vertexbuffer.h b/src/lol/gpu/vertexbuffer.h index 8ab2c7e6..785e4e04 100644 --- a/src/lol/gpu/vertexbuffer.h +++ b/src/lol/gpu/vertexbuffer.h @@ -56,7 +56,9 @@ public: enum { Typevoid = 0, +#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS Typehalf, Typef16vec2, Typef16vec3, Typef16vec4, +#endif Typefloat, Typevec2, Typevec3, Typevec4, Typedouble, Typedvec2, Typedvec3, Typedvec4, Typeint8_t, Typei8vec2, Typei8vec3, Typei8vec4, @@ -103,7 +105,9 @@ protected: static uint8_t GetType(T *x) { UNUSED(x); return Type##T; } __T(void) +#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS __T(half) __T(f16vec2) __T(f16vec3) __T(f16vec4) +#endif __T(float) __T(vec2) __T(vec3) __T(vec4) __T(double) __T(dvec2) __T(dvec3) __T(dvec4) __T(int8_t) __T(i8vec2) __T(i8vec3) __T(i8vec4) diff --git a/src/math/constants.cpp b/src/math/constants.cpp index 05e9809e..02927ec1 100644 --- a/src/math/constants.cpp +++ b/src/math/constants.cpp @@ -56,11 +56,15 @@ namespace lol { \ LOL_MAT_CONST(T, identity, 1) +#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS LOL_ALL_CONST_INNER(half) +#endif LOL_ALL_CONST_INNER(float) LOL_ALL_CONST_INNER(double) LOL_ALL_CONST_INNER(ldouble) +#if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS LOL_ALL_CONST_INNER(real) +#endif LOL_ALL_CONST_INNER(int8_t) LOL_ALL_CONST_INNER(uint8_t)