Skip to content

Commit 90574ed

Browse files
committed
Updated bundled glm to 1.0.1
1 parent ea11078 commit 90574ed

File tree

270 files changed

+11196
-4661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+11196
-4661
lines changed

vendor/glm/glm/CMakeLists.txt

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,28 @@ source_group("SIMD Files" FILES ${SIMD_SOURCE})
4242
source_group("SIMD Files" FILES ${SIMD_INLINE})
4343
source_group("SIMD Files" FILES ${SIMD_HEADER})
4444

45-
add_library(glm INTERFACE)
46-
target_include_directories(glm INTERFACE ../)
45+
add_library(glm-header-only INTERFACE)
46+
add_library(glm::glm-header-only ALIAS glm-header-only)
4747

48-
if(BUILD_STATIC_LIBS)
49-
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
50-
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
51-
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
52-
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
53-
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
54-
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
55-
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
56-
target_link_libraries(glm_static PUBLIC glm)
57-
add_library(glm::glm_static ALIAS glm_static)
58-
endif()
48+
target_include_directories(glm-header-only INTERFACE
49+
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
50+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
51+
)
5952

60-
if(BUILD_SHARED_LIBS)
61-
add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
62-
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
63-
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
64-
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
65-
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
66-
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
67-
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
68-
target_link_libraries(glm_shared PUBLIC glm)
69-
add_library(glm::glm_shared ALIAS glm_shared)
53+
if (GLM_BUILD_LIBRARY)
54+
add_library(glm
55+
${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
56+
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
57+
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
58+
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
59+
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
60+
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
61+
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}
62+
)
63+
add_library(glm::glm ALIAS glm)
64+
target_link_libraries(glm PUBLIC glm-header-only)
65+
else()
66+
add_library(glm INTERFACE)
67+
add_library(glm::glm ALIAS glm)
68+
target_link_libraries(glm INTERFACE glm-header-only)
7069
endif()

vendor/glm/glm/common.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace glm
5151
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
5252
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
5353
template<length_t L, typename T, qualifier Q>
54-
GLM_FUNC_DECL vec<L, T, Q> sign(vec<L, T, Q> const& x);
54+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);
5555

5656
/// Returns a value equal to the nearest integer that is less then or equal to x.
5757
///
@@ -306,13 +306,13 @@ namespace glm
306306
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
307307
/// @endcode
308308
template<typename genTypeT, typename genTypeU>
309-
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
309+
GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
310310

311311
template<length_t L, typename T, typename U, qualifier Q>
312-
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
312+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
313313

314314
template<length_t L, typename T, typename U, qualifier Q>
315-
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
315+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
316316

317317
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
318318
///
@@ -404,7 +404,7 @@ namespace glm
404404
///
405405
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
406406
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
407-
GLM_FUNC_DECL int floatBitsToInt(float const& v);
407+
GLM_FUNC_DECL int floatBitsToInt(float v);
408408

409409
/// Returns a signed integer value representing
410410
/// the encoding of a floating-point value. The floatingpoint
@@ -424,7 +424,7 @@ namespace glm
424424
///
425425
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
426426
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
427-
GLM_FUNC_DECL uint floatBitsToUint(float const& v);
427+
GLM_FUNC_DECL uint floatBitsToUint(float v);
428428

429429
/// Returns a unsigned integer value representing
430430
/// the encoding of a floating-point value. The floatingpoint
@@ -446,7 +446,7 @@ namespace glm
446446
///
447447
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
448448
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
449-
GLM_FUNC_DECL float intBitsToFloat(int const& v);
449+
GLM_FUNC_DECL float intBitsToFloat(int v);
450450

451451
/// Returns a floating-point value corresponding to a signed
452452
/// integer encoding of a floating-point value.
@@ -470,7 +470,7 @@ namespace glm
470470
///
471471
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
472472
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
473-
GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
473+
GLM_FUNC_DECL float uintBitsToFloat(uint v);
474474

475475
/// Returns a floating-point value corresponding to a
476476
/// unsigned integer encoding of a floating-point value.

vendor/glm/glm/detail/_swizzle.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace detail
88
struct _swizzle_base0
99
{
1010
protected:
11-
GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; }
12-
GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
11+
GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast<T*>(_buffer))[i]; }
12+
GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
1313

1414
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
1515
// The size 1 buffer is assumed to aligned to the actual members so that the
@@ -113,12 +113,12 @@ namespace detail
113113
_apply_op(that, op_div());
114114
}
115115

116-
GLM_FUNC_QUALIFIER T& operator[](size_t i)
116+
GLM_FUNC_QUALIFIER T& operator[](int i)
117117
{
118118
const int offset_dst[4] = { E0, E1, E2, E3 };
119119
return this->elem(offset_dst[i]);
120120
}
121-
GLM_FUNC_QUALIFIER T operator[](size_t i) const
121+
GLM_FUNC_QUALIFIER T operator[](int i) const
122122
{
123123
const int offset_dst[4] = { E0, E1, E2, E3 };
124124
return this->elem(offset_dst[i]);
@@ -147,7 +147,7 @@ namespace detail
147147

148148
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
149149

150-
GLM_FUNC_QUALIFIER T operator[] (size_t i) const
150+
GLM_FUNC_QUALIFIER T operator[] (int i) const
151151
{
152152
const int offset_dst[4] = { E0, E1, E2, E3 };
153153
return this->elem(offset_dst[i]);

vendor/glm/glm/detail/_swizzle_func.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
#pragma once
22

33
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \
4-
vec<2, T, Q> A ## B() CONST \
4+
GLM_FUNC_QUALIFIER vec<2, T, Q> A ## B() CONST \
55
{ \
66
return vec<2, T, Q>(this->A, this->B); \
77
}
88

99
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \
10-
vec<3, T, Q> A ## B ## C() CONST \
10+
GLM_FUNC_QUALIFIER vec<3, T, Q> A ## B ## C() CONST \
1111
{ \
1212
return vec<3, T, Q>(this->A, this->B, this->C); \
1313
}
1414

1515
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \
16-
vec<4, T, Q> A ## B ## C ## D() CONST \
16+
GLM_FUNC_QUALIFIER vec<4, T, Q> A ## B ## C ## D() CONST \
1717
{ \
1818
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
1919
}
2020

2121
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
2222
template<typename T> \
23-
vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
23+
GLM_FUNC_QUALIFIER vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
2424
{ \
2525
return vec<2, T, Q>(this->A, this->B); \
2626
}
2727

2828
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
2929
template<typename T> \
30-
vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
30+
GLM_FUNC_QUALIFIER vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
3131
{ \
3232
return vec<3, T, Q>(this->A, this->B, this->C); \
3333
}
3434

3535
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
3636
template<typename T> \
37-
vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
37+
GLM_FUNC_QUALIFIER vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
3838
{ \
3939
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
4040
}

vendor/glm/glm/detail/compute_common.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ namespace detail
1616
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
1717
{
1818
GLM_STATIC_ASSERT(
19-
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed,
19+
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
2020
"'abs' only accept floating-point and integer scalar or vector inputs");
2121

2222
return x >= genFIType(0) ? x : -x;
2323
// TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
2424
}
2525
};
2626

27-
#if GLM_COMPILER & GLM_COMPILER_CUDA
27+
#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
2828
template<>
2929
struct compute_abs<float, true>
3030
{
31-
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x)
31+
GLM_FUNC_QUALIFIER static float call(float x)
3232
{
3333
return fabsf(x);
3434
}

0 commit comments

Comments
 (0)