From 3a53ea1f692251c052bf0b99cbc484c4f6641a8d Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 20 May 2019 20:41:46 +0100 Subject: [PATCH 01/15] Remove architecture check from CMake package --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10bb1af0..2325ebf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,7 +245,17 @@ add_subdirectory(test) set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm") install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +# CMake automatically adds an architecture compatibility check to make sure +# 32 and 64 bit code is not accidentally mixed. For a header-only library this +# is not required. The check can be disabled by temporarily unsetting +# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly +# with write_basic_package_version_file(ARCH_INDEPENDENT). +# TODO: Use this once a newer CMake can be required. +set(GLM_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) +unset(CMAKE_SIZEOF_VOID_P) write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion) +set(CMAKE_SIZEOF_VOID_P ${GLM_SIZEOF_VOID_P}) # build tree package config configure_file(cmake/glmBuildConfig.cmake.in glmConfig.cmake @ONLY) From 24c0d923b046c7097dfb28f4121cf21435e9e4f1 Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Thu, 23 May 2019 20:36:26 +0200 Subject: [PATCH 02/15] Fixed typo --- glm/detail/func_common.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index b987de63..85b9ae73 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -259,7 +259,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); } From 28006047816320d420a1767ae07467b17e29c830 Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Tue, 28 May 2019 16:02:22 +0200 Subject: [PATCH 03/15] Fixed typo --- glm/ext/vector_double1.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/ext/vector_double1.hpp b/glm/ext/vector_double1.hpp index ef12def4..38826677 100644 --- a/glm/ext/vector_double1.hpp +++ b/glm/ext/vector_double1.hpp @@ -16,7 +16,7 @@ #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_dvec1 extension included") +# pragma message("GLM: GLM_EXT_vector_double1 extension included") #endif namespace glm From a201957cf9f948b7b4b0b0e010a4440fc1790914 Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Tue, 28 May 2019 16:10:58 +0200 Subject: [PATCH 04/15] Silence C4244 warning Silenced a C4244 warning in gaussRand. --- glm/gtc/random.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index de10a409..0cb111a2 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -228,7 +228,7 @@ namespace detail w = x1 * x1 + x2 * x2; } while(w > genType(1)); - return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean; + return (genType)(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); } template From bc70a03adca412f72b65d7310e58aca4ee1ce5e1 Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Wed, 29 May 2019 12:20:11 +0200 Subject: [PATCH 05/15] Use static_cast instead of C-style --- glm/gtc/random.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index 0cb111a2..70485098 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -228,7 +228,7 @@ namespace detail w = x1 * x1 + x2 * x2; } while(w > genType(1)); - return (genType)(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); + return static_cast(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); } template From b15bbffe5a29989828ace7972ff2ee8a85b30f1d Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Mon, 3 Jun 2019 09:29:32 +0200 Subject: [PATCH 06/15] Update packing.hpp --- glm/gtc/packing.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glm/gtc/packing.hpp b/glm/gtc/packing.hpp index 28523952..7c64aba3 100644 --- a/glm/gtc/packing.hpp +++ b/glm/gtc/packing.hpp @@ -601,7 +601,7 @@ namespace glm - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i8vec2 unpackInt2x8(int16 p) @@ -625,7 +625,7 @@ namespace glm /// @see uint16 packInt2x8(u8vec2 const& v) GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i8vec4 unpackInt4x8(int32 p) @@ -649,7 +649,7 @@ namespace glm /// @see uint32 packUint4x8(u8vec2 const& v) GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i16vec2 unpackInt2x16(int p) @@ -661,7 +661,7 @@ namespace glm /// @see int packInt2x16(i16vec2 const& v) GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i16vec4 unpackInt4x16(int64 p) @@ -697,7 +697,7 @@ namespace glm /// @see uint64 packUint4x16(u16vec4 const& v) GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i32vec2 unpackInt2x32(int p) From 537bc3a1d1eafb4abd03ff776044651215e51c94 Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Mon, 3 Jun 2019 14:35:04 +0200 Subject: [PATCH 07/15] Fixed typo Wrong title of GLM_GTC_round --- glm/gtc/round.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/round.hpp b/glm/gtc/round.hpp index fbbcdeb5..f1424c30 100644 --- a/glm/gtc/round.hpp +++ b/glm/gtc/round.hpp @@ -22,7 +22,7 @@ #include #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_integer extension included") +# pragma message("GLM: GLM_GTC_round extension included") #endif namespace glm From 8fb71ffd070703d1450ccb4543ce0f6803f037ee Mon Sep 17 00:00:00 2001 From: rhoarau Date: Sun, 9 Jun 2019 16:05:09 +0200 Subject: [PATCH 08/15] Initial SYCL support: The core and some ext functions should work. --- glm/detail/setup.hpp | 43 +++++++++++++++++++++++++++++++++++++++++++ glm/simd/platform.h | 7 +++++++ readme.md | 1 + 3 files changed, 51 insertions(+) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index d59808e7..ec2f991b 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -410,6 +410,7 @@ #if GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_CUDA_FUNC_DEF __device__ __host__ # define GLM_CUDA_FUNC_DECL __device__ __host__ +#error "oops cuda shit" #else # define GLM_CUDA_FUNC_DEF # define GLM_CUDA_FUNC_DECL @@ -529,6 +530,48 @@ # define GLM_EXPLICIT #endif +/////////////////////////////////////////////////////////////////////////////////// +// SYCL + +#if GLM_COMPILER==GLM_COMPILER_SYCL + +#include +#include + +namespace glm { +namespace std { + // import sycl function into the namespace glm::std to force their usages. + // It's important to use the builtin intrinsics (sin, exp, ...) + // of sycl instead the std ones. + using namespace cl::sycl; + + /////////////////////////////////////////////////////////////////////////////// + // Import some "harmless" std's stuffs used by glm into + // the new glm::std namespace. + template + using numeric_limits = ::std::numeric_limits; + + using ::std::size_t; + + using ::std::uint8_t; + using ::std::uint16_t; + using ::std::uint32_t; + using ::std::uint64_t; + + using ::std::int8_t; + using ::std::int16_t; + using ::std::int32_t; + using ::std::int64_t; + + using ::std::make_unsigned; + /////////////////////////////////////////////////////////////////////////////// +} //namespace std +} //namespace glm + +#endif + +/////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////////// // Length type: all length functions returns a length_t type. // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise diff --git a/glm/simd/platform.h b/glm/simd/platform.h index f74b8c7f..58168205 100644 --- a/glm/simd/platform.h +++ b/glm/simd/platform.h @@ -81,6 +81,9 @@ #define GLM_COMPILER_CUDA75 0x100000B0 #define GLM_COMPILER_CUDA80 0x100000C0 +// SYCL +#define GLM_COMPILER_SYCL 0x00300000 + // Clang #define GLM_COMPILER_CLANG 0x20000000 #define GLM_COMPILER_CLANG34 0x20000050 @@ -129,6 +132,10 @@ # error "GLM requires CUDA 7.0 or higher" # endif +// SYCL +#elif defined(__SYCL_DEVICE_ONLY__) +# define GLM_COMPILER GLM_COMPILER_SYCL + // Clang #elif defined(__clang__) # if defined(__apple_build_version__) diff --git a/readme.md b/readme.md index 59e24734..96410811 100644 --- a/readme.md +++ b/readme.md @@ -15,6 +15,7 @@ This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also - [LLVM](http://llvm.org/) 3.4 and higher - [Visual C++](http://www.visualstudio.com/) 2013 and higher - [CUDA](https://developer.nvidia.com/about-cuda) 7.0 and higher (experimental) +- [SYCL](https://www.khronos.org/sycl/) 1.2.1 and higher (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) has been tested). - Any C++11 compiler For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). From 1079444f7ef5d9150323c78dd64883b7a05baf1e Mon Sep 17 00:00:00 2001 From: rhoarau Date: Sun, 9 Jun 2019 17:25:43 +0200 Subject: [PATCH 09/15] Remove a preprocessor debug message and correct the readme --- glm/detail/setup.hpp | 1 - readme.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index ec2f991b..549ef2e7 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -410,7 +410,6 @@ #if GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_CUDA_FUNC_DEF __device__ __host__ # define GLM_CUDA_FUNC_DECL __device__ __host__ -#error "oops cuda shit" #else # define GLM_CUDA_FUNC_DEF # define GLM_CUDA_FUNC_DECL diff --git a/readme.md b/readme.md index 96410811..b37782ca 100644 --- a/readme.md +++ b/readme.md @@ -15,7 +15,7 @@ This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also - [LLVM](http://llvm.org/) 3.4 and higher - [Visual C++](http://www.visualstudio.com/) 2013 and higher - [CUDA](https://developer.nvidia.com/about-cuda) 7.0 and higher (experimental) -- [SYCL](https://www.khronos.org/sycl/) 1.2.1 and higher (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) has been tested). +- [SYCL](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested). - Any C++11 compiler For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). From 2a8822865c4843e4cc040e9500e55ceb69eed45d Mon Sep 17 00:00:00 2001 From: rhoarau Date: Sun, 16 Jun 2019 13:33:02 +0200 Subject: [PATCH 10/15] Fix typos and code style (space to tab). --- glm/detail/setup.hpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 549ef2e7..1eae6a22 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -539,31 +539,31 @@ namespace glm { namespace std { - // import sycl function into the namespace glm::std to force their usages. - // It's important to use the builtin intrinsics (sin, exp, ...) - // of sycl instead the std ones. - using namespace cl::sycl; + // Import SYCL's functions into the namespace glm::std to force their usages. + // It's important to use the math built-in function (sin, exp, ...) + // of SYCL instead the std ones. + using namespace cl::sycl; - /////////////////////////////////////////////////////////////////////////////// - // Import some "harmless" std's stuffs used by glm into - // the new glm::std namespace. - template - using numeric_limits = ::std::numeric_limits; + /////////////////////////////////////////////////////////////////////////////// + // Import some "harmless" std's stuffs used by glm into + // the new glm::std namespace. + template + using numeric_limits = ::std::numeric_limits; - using ::std::size_t; + using ::std::size_t; - using ::std::uint8_t; - using ::std::uint16_t; - using ::std::uint32_t; - using ::std::uint64_t; + using ::std::uint8_t; + using ::std::uint16_t; + using ::std::uint32_t; + using ::std::uint64_t; - using ::std::int8_t; - using ::std::int16_t; - using ::std::int32_t; - using ::std::int64_t; + using ::std::int8_t; + using ::std::int16_t; + using ::std::int32_t; + using ::std::int64_t; - using ::std::make_unsigned; - /////////////////////////////////////////////////////////////////////////////// + using ::std::make_unsigned; + /////////////////////////////////////////////////////////////////////////////// } //namespace std } //namespace glm From 3d9bec8d2b1b1cfc3f829b11eade2a0913458227 Mon Sep 17 00:00:00 2001 From: Ken Hu Date: Tue, 18 Jun 2019 00:04:55 +0900 Subject: [PATCH 11/15] Fix .natvis as structs renamed --- util/glm.natvis | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/util/glm.natvis b/util/glm.natvis index d13bf30e..7687f8bb 100644 --- a/util/glm.natvis +++ b/util/glm.natvis @@ -1,17 +1,22 @@ - - + + + + + + - + + {x} x - + {x}, {y} x @@ -19,7 +24,7 @@ - + {x}, {y}, {z} x @@ -28,7 +33,7 @@ - + {x}, {y}, {z}, {w} x @@ -38,18 +43,8 @@ - - - - ({x}, {y}, {z}), {w} + + {x}, {y}, {z}, {w} x y @@ -65,5 +60,6 @@ dual + From 9a1f85ae794103e8ed842681c1035eddac958d80 Mon Sep 17 00:00:00 2001 From: Peter Steneteg Date: Wed, 26 Jun 2019 12:46:25 +0200 Subject: [PATCH 12/15] Hash hashes qua instead of tquat closes #919 --- glm/gtx/hash.hpp | 4 ++-- glm/gtx/hash.inl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index 93b1bc2d..05dae9f4 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -73,9 +73,9 @@ namespace std }; template - struct hash> + struct hash> { - GLM_FUNC_DECL size_t operator()(glm::tquat const& q) const; + GLM_FUNC_DECL size_t operator()(glm::qua const& q) const; }; template diff --git a/glm/gtx/hash.inl b/glm/gtx/hash.inl index 64443ef8..ff71ca9f 100644 --- a/glm/gtx/hash.inl +++ b/glm/gtx/hash.inl @@ -62,7 +62,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tquat const& q) const + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::qua const& q) const { size_t seed = 0; hash hasher; @@ -77,7 +77,7 @@ namespace std GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const { size_t seed = 0; - hash> hasher; + hash> hasher; glm::detail::hash_combine(seed, hasher(q.real)); glm::detail::hash_combine(seed, hasher(q.dual)); return seed; From 598a3dc7b7df2b410daf64e58a6fb2bd29a58ef6 Mon Sep 17 00:00:00 2001 From: Peter Steneteg Date: Wed, 26 Jun 2019 12:47:40 +0200 Subject: [PATCH 13/15] Fix for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index d59808e7..7107f0c6 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -119,7 +119,7 @@ # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) -# elif __cplusplus == 201402L || GLM_LANG_PLATFORM == 201402L +# elif __cplusplus == 201402L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) From 81dfda4cf319f9ea460ac7412d07f164aeb414fd Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Wed, 3 Jul 2019 09:41:29 +0200 Subject: [PATCH 14/15] Fix gcc if constexpr error Check against __cplusplus version instead of compiler version. This fixes compilation errors when using an older cpp standard version with a newer gcc compiler. This flag requires GCC 4.7 or greater. --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 1eae6a22..f34832ba 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -298,7 +298,7 @@ # if (GLM_COMPILER & GLM_COMPILER_CLANG) # define GLM_HAS_IF_CONSTEXPR __has_feature(cxx_if_constexpr) # elif (GLM_COMPILER & GLM_COMPILER_GCC) -# define GLM_HAS_IF_CONSTEXPR GLM_COMPILER >= GLM_COMPILER_GCC7 +# define GLM_HAS_IF_CONSTEXPR (__cplusplus >= 201703L) # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) # define GLM_HAS_IF_CONSTEXPR 1 # else From 8c5fde6c8f5e5de511f0ec43a0dbc429924d18c2 Mon Sep 17 00:00:00 2001 From: Christophe Date: Thu, 11 Jul 2019 16:08:18 +0200 Subject: [PATCH 15/15] Updated 0.9.9.6 release note --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.md b/readme.md index b37782ca..8147b7eb 100644 --- a/readme.md +++ b/readme.md @@ -55,9 +55,17 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) ### [GLM 0.9.9.6](https://github.com/g-truc/glm/tree/master) #### Improvements: +- Added SYCL support #914 - Added Visual C++ 2019 detection - Added Visual C++ 2017 15.8 and 15.9 detection +#### Fixes: +- Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921 +- Fixed hash hashes qua instead of tquat #919 +- Fixed .natvis as structs renamed #915 +- Fixed ldexp and frexp declaration #895 +- Fixed missing const to quaternion conversion operators #890 + ### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01 #### Fixes: - Fixed build errors when defining GLM_ENABLE_EXPERIMENTAL #884 #883