Skip to content

Commit

Permalink
Update glm to version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jul 30, 2024
1 parent e660405 commit a2644f5
Show file tree
Hide file tree
Showing 269 changed files with 11,179 additions and 4,645 deletions.
45 changes: 22 additions & 23 deletions Dependencies/glm/glm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,28 @@ source_group("SIMD Files" FILES ${SIMD_SOURCE})
source_group("SIMD Files" FILES ${SIMD_INLINE})
source_group("SIMD Files" FILES ${SIMD_HEADER})

add_library(glm INTERFACE)
target_include_directories(glm INTERFACE ../)
add_library(glm-header-only INTERFACE)
add_library(glm::glm-header-only ALIAS glm-header-only)

if(BUILD_STATIC_LIBS)
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
target_link_libraries(glm_static PUBLIC glm)
add_library(glm::glm_static ALIAS glm_static)
endif()
target_include_directories(glm-header-only INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

if(BUILD_SHARED_LIBS)
add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
target_link_libraries(glm_shared PUBLIC glm)
add_library(glm::glm_shared ALIAS glm_shared)
if (GLM_BUILD_LIBRARY)
add_library(glm
${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}
)
add_library(glm::glm ALIAS glm)
target_link_libraries(glm PUBLIC glm-header-only)
else()
add_library(glm INTERFACE)
add_library(glm::glm ALIAS glm)
target_link_libraries(glm INTERFACE glm-header-only)
endif()
16 changes: 8 additions & 8 deletions Dependencies/glm/glm/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @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>
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> sign(vec<L, T, Q> const& x);
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);

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

template<length_t L, typename T, typename U, qualifier Q>
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);
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);

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

/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
Expand Down Expand Up @@ -404,7 +404,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @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>
GLM_FUNC_DECL int floatBitsToInt(float const& v);
GLM_FUNC_DECL int floatBitsToInt(float v);

/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint
Expand All @@ -424,7 +424,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @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>
GLM_FUNC_DECL uint floatBitsToUint(float const& v);
GLM_FUNC_DECL uint floatBitsToUint(float v);

/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
Expand All @@ -446,7 +446,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @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>
GLM_FUNC_DECL float intBitsToFloat(int const& v);
GLM_FUNC_DECL float intBitsToFloat(int v);

/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
Expand All @@ -470,7 +470,7 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @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>
GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
GLM_FUNC_DECL float uintBitsToFloat(uint v);

/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
Expand Down
10 changes: 5 additions & 5 deletions Dependencies/glm/glm/detail/_swizzle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace detail
struct _swizzle_base0
{
protected:
GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }

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

GLM_FUNC_QUALIFIER T& operator[](size_t i)
GLM_FUNC_QUALIFIER T& operator[](int i)
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
GLM_FUNC_QUALIFIER T operator[](size_t i) const
GLM_FUNC_QUALIFIER T operator[](int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
Expand Down Expand Up @@ -147,7 +147,7 @@ namespace detail

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

GLM_FUNC_QUALIFIER T operator[] (size_t i) const
GLM_FUNC_QUALIFIER T operator[] (int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
Expand Down
12 changes: 6 additions & 6 deletions Dependencies/glm/glm/detail/_swizzle_func.hpp
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
#pragma once

#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \
vec<2, T, Q> A ## B() CONST \
GLM_FUNC_QUALIFIER vec<2, T, Q> A ## B() CONST \
{ \
return vec<2, T, Q>(this->A, this->B); \
}

#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \
vec<3, T, Q> A ## B ## C() CONST \
GLM_FUNC_QUALIFIER vec<3, T, Q> A ## B ## C() CONST \
{ \
return vec<3, T, Q>(this->A, this->B, this->C); \
}

#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \
vec<4, T, Q> A ## B ## C ## D() CONST \
GLM_FUNC_QUALIFIER vec<4, T, Q> A ## B ## C ## D() CONST \
{ \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}

#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
template<typename T> \
vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
GLM_FUNC_QUALIFIER vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
{ \
return vec<2, T, Q>(this->A, this->B); \
}

#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
template<typename T> \
vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
GLM_FUNC_QUALIFIER vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
{ \
return vec<3, T, Q>(this->A, this->B, this->C); \
}

#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
template<typename T> \
vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
GLM_FUNC_QUALIFIER vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
{ \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}
Expand Down
6 changes: 3 additions & 3 deletions Dependencies/glm/glm/detail/compute_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ namespace detail
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed,
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
"'abs' only accept floating-point and integer scalar or vector inputs");

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

#if GLM_COMPILER & GLM_COMPILER_CUDA
#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
template<>
struct compute_abs<float, true>
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x)
GLM_FUNC_QUALIFIER static float call(float x)
{
return fabsf(x);
}
Expand Down
Loading

0 comments on commit a2644f5

Please sign in to comment.