Fixed Cuda build, no support of __declspec(align(alignment))

This commit is contained in:
Christophe Riccio 2016-08-09 20:05:19 +02:00
parent 4db0dfcb19
commit 09bf19db7e
3 changed files with 7 additions and 3 deletions

View File

@ -17,6 +17,8 @@ namespace detail
} type; } type;
}; };
// Cuda doesn't support __declspec(align(x)), no aligned types for Cuda
# if GLM_COMPILER & GLM_COMPILER_CUDA
template <typename T, std::size_t size> template <typename T, std::size_t size>
struct storage<T, size, true> struct storage<T, size, true>
{ {
@ -24,6 +26,7 @@ namespace detail
uint8 data[size]; uint8 data[size];
} type; } type;
}; };
# endif
# if GLM_ARCH & GLM_ARCH_SSE2_BIT # if GLM_ARCH & GLM_ARCH_SSE2_BIT
template <> template <>

View File

@ -50,7 +50,7 @@
#include "./gtc/type_ptr.hpp" #include "./gtc/type_ptr.hpp"
#include "./gtc/ulp.hpp" #include "./gtc/ulp.hpp"
#include "./gtc/vec1.hpp" #include "./gtc/vec1.hpp"
#if GLM_HAS_ALIGNED_TYPE #if GLM_HAS_ALIGNED_TYPE && !(GLM_COMPILER & GLM_COMPILER_CUDA)
# include "./gtc/type_aligned.hpp" # include "./gtc/type_aligned.hpp"
#endif #endif

View File

@ -12,6 +12,9 @@
#if !GLM_HAS_ALIGNED_TYPE #if !GLM_HAS_ALIGNED_TYPE
# error "GLM: Aligned types are not supported on this platform" # error "GLM: Aligned types are not supported on this platform"
#endif #endif
#if GLM_COMPILER & GLM_COMPILER_CUDA
# error "GLM: GTC_type_aligned is not supported on Cuda due to lack of __declspec(align(alignment)) support, issue #539"
#endif
#if(defined(GLM_MESSAGES) && !defined(glm_ext)) #if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTC_type_aligned extension included") # pragma message("GLM: GLM_GTC_type_aligned extension included")
@ -30,8 +33,6 @@ namespace glm
template <typename T, precision P> struct tvec2; template <typename T, precision P> struct tvec2;
template <typename T, precision P> struct tvec3; template <typename T, precision P> struct tvec3;
template <typename T, precision P> struct tvec4; template <typename T, precision P> struct tvec4;
/// @addtogroup gtc_type_aligned /// @addtogroup gtc_type_aligned
/// @{ /// @{