Skip to content

Commit b97dbc7

Browse files
authored
Merge branch 'master' into remove_unneccessary_overloads
2 parents bb563dc + 624090a commit b97dbc7

19 files changed

+623
-32
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: ci
22
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
33

44
on:
5+
pull_request:
6+
branches:
7+
- main
58
push:
69
workflow_dispatch:
710

@@ -68,7 +71,7 @@ jobs:
6871
6972
- name: Run with GLM_ENABLE_SIMD_SSE2
7073
run: |
71-
cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
74+
cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
7275
cmake --build ./build_sse2_std --config ${{matrix.config}}
7376
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
7477
@@ -113,6 +116,8 @@ jobs:
113116
exclude:
114117
- os: ubuntu-20.04
115118
std: 20
119+
- os: ubuntu-latest
120+
std: 98
116121

117122
steps:
118123
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
@@ -147,7 +152,7 @@ jobs:
147152
148153
- name: Run with GLM_ENABLE_SIMD_SSE2
149154
run: |
150-
cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
155+
cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
151156
cmake --build ./build_sse2_std --config ${{matrix.config}}
152157
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
153158
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
@@ -178,17 +183,14 @@ jobs:
178183
cmake --build ./build_avx2_ext --config ${{matrix.config}}
179184
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext
180185
181-
macos:
186+
macos-13:
182187
runs-on: ${{ matrix.os }}
183188
strategy:
184189
fail-fast: false
185190
matrix:
186-
os: [macos-latest, macos-11]
191+
os: [macos-13]
187192
std: [98, 11, 14, 17, 20]
188193
config: [Debug, Release]
189-
exclude:
190-
- os: macos-11
191-
std: 20
192194

193195
steps:
194196
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
@@ -223,7 +225,7 @@ jobs:
223225
224226
- name: Run with GLM_ENABLE_SIMD_SSE2
225227
run: |
226-
cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
228+
cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
227229
cmake --build ./build_sse2_std --config ${{matrix.config}}
228230
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
229231
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
@@ -242,4 +244,56 @@ jobs:
242244
cmake -S. -B ./build_avx1_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
243245
cmake --build ./build_avx1_ext --config ${{matrix.config}}
244246
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext
245-
247+
248+
macos-latest:
249+
runs-on: ${{ matrix.os }}
250+
strategy:
251+
fail-fast: false
252+
matrix:
253+
os: [macos-latest]
254+
std: [98, 11, 14, 17, 20]
255+
config: [Debug, Release]
256+
257+
steps:
258+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
259+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
260+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
261+
- name: Check out repository code
262+
uses: actions/checkout@v4
263+
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
264+
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
265+
- name: List files in the repository
266+
run: |
267+
ls ${{ github.workspace }}
268+
- run: echo "🍏 This job's status is ${{ job.status }}."
269+
- name: CMake Version
270+
run: cmake --version
271+
- name: Run with automagic detection
272+
run: |
273+
cmake -S. -B ./build_auto -DGLM_BUILD_TESTS=ON
274+
cmake --build ./build_auto --config ${{matrix.config}}
275+
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
276+
277+
- name: Run with GLM_FORCE_PURE
278+
run: |
279+
cmake -S. -B ./build_pure_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
280+
cmake --build ./build_pure_std --config ${{matrix.config}}
281+
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
282+
- name: Run with GLM_FORCE_PURE and language extensions
283+
run: |
284+
cmake -S. -B ./build_pure_ext -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
285+
cmake --build ./build_pure_ext --config ${{matrix.config}}
286+
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
287+
288+
- name: Run with GLM_ENABLE_SIMD_NEON
289+
run: |
290+
cmake -S. -B ./build_neon_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_NEON=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
291+
cmake --build ./build_neon_std --config ${{matrix.config}}
292+
ctest --verbose -C ${{matrix.config}} --test-dir ./build_neon_std
293+
- name: Run with GLM_ENABLE_SIMD_NEON and language extensions
294+
run: |
295+
cmake -S. -B ./build_neon_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_NEON=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
296+
cmake --build ./build_neon_ext --config ${{matrix.config}}
297+
ctest --verbose -C ${{matrix.config}} --test-dir ./build_neon_ext
298+
299+

CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
2-
cmake_policy(VERSION 3.6)
1+
# 3.6 is the actual minimun. 3.14 as the upper policy limit avoids CMake deprecation warnings.
2+
cmake_minimum_required(VERSION 3.6...3.14 FATAL_ERROR)
3+
cmake_policy(VERSION 3.6...3.14)
34

45
file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE)
56
string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
@@ -149,7 +150,7 @@ option(GLM_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF)
149150
option(GLM_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF)
150151
option(GLM_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
151152
option(GLM_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
152-
option(GLM_TEST_ENABLE_SIMD_NEON "Enable ARM NEON optimizations" OFF)
153+
option(GLM_ENABLE_SIMD_NEON "Enable ARM NEON optimizations" OFF)
153154
option(GLM_FORCE_PURE "Force 'pure' instructions" OFF)
154155

155156
if(GLM_FORCE_PURE)
@@ -192,7 +193,7 @@ elseif(GLM_ENABLE_SIMD_SSE4_2)
192193
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
193194
add_compile_options(/QxSSE4.2)
194195
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
195-
add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2
196+
add_compile_options(/arch:SSE4.2)
196197
endif()
197198
message(STATUS "GLM: SSE4.2 instruction set")
198199

@@ -243,8 +244,9 @@ elseif(GLM_ENABLE_SIMD_SSE2)
243244
add_compile_options(/arch:SSE2)
244245
endif()
245246
message(STATUS "GLM: SSE2 instruction set")
246-
elseif(GLM_TEST_ENABLE_SIMD_NEON)
247-
add_definitions(-DGLM_FORCE_NEON)
247+
elseif(GLM_ENABLE_SIMD_NEON)
248+
add_definitions(-DGLM_FORCE_INTRINSICS)
249+
248250
message(STATUS "GLM: ARM NEON instruction set")
249251
endif()
250252

glm/detail/func_common_simd.inl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,9 @@ namespace glm {
573573
struct compute_splat<L, float, Q, true> {
574574
template<int c>
575575
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, float, Q> call(vec<L, float, Q> const& a)
576-
{}
576+
{
577+
(void)a;
578+
}
577579

578580
template<>
579581
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, float, Q> call<0>(vec<L, float, Q> const& a)

glm/detail/qualifier.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,15 @@ namespace detail
224224
struct storage<3, unsigned int, true> : public storage<4, unsigned int, true>
225225
{};
226226

227+
# if GLM_HAS_ALIGNOF
227228
template<>
228229
struct storage<3, double, true>
229230
{
230231
typedef struct alignas(4 * sizeof(double)) type {
231232
double data[4];
232233
} type;
233234
};
235+
# endif//GLM_HAS_ALIGNOF
234236

235237
# endif
236238

glm/detail/setup.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@
148148
// http://gcc.gnu.org/projects/cxx0x.html
149149
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
150150

151-
// Android has multiple STLs but C++11 STL detection doesn't always work #284 #564
152-
#if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED)
153-
# define GLM_HAS_CXX11_STL 0
154-
#elif (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC
151+
#if (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC
155152
# define GLM_HAS_CXX11_STL 0
156153
#elif (GLM_COMPILER & GLM_COMPILER_HIP)
157154
# define GLM_HAS_CXX11_STL 0

glm/detail/type_vec_simd.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ struct _swizzle_base1<L, uint, Q, E0, E1, E2, E3, true> : public _swizzle_base1<
921921
{
922922
static bool call(vec<L, float, Q> const& v1, vec<L, float, Q> const& v2)
923923
{
924-
return !compute_vec_equal<float, Q, false, 32, true>::call(v1, v2);
924+
return !compute_vec_equal<L, float, Q, false, 32, true>::call(v1, v2);
925925
}
926926
};
927927

@@ -930,7 +930,7 @@ struct _swizzle_base1<L, uint, Q, E0, E1, E2, E3, true> : public _swizzle_base1<
930930
{
931931
static bool call(vec<L, uint, Q> const& v1, vec<L, uint, Q> const& v2)
932932
{
933-
return !compute_vec_equal<uint, Q, false, 32, true>::call(v1, v2);
933+
return !compute_vec_equal<L, uint, Q, false, 32, true>::call(v1, v2);
934934
}
935935
};
936936

@@ -939,7 +939,7 @@ struct _swizzle_base1<L, uint, Q, E0, E1, E2, E3, true> : public _swizzle_base1<
939939
{
940940
static bool call(vec<L, int, Q> const& v1, vec<L, int, Q> const& v2)
941941
{
942-
return !compute_vec_equal<int, Q, false, 32, true>::call(v1, v2);
942+
return !compute_vec_equal<L, int, Q, false, 32, true>::call(v1, v2);
943943
}
944944
};
945945

glm/ext/matrix_clip_space.hpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,56 @@ namespace glm
461461
T fov, T width, T height, T near, T far);
462462

463463
/// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite.
464+
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
465+
///
466+
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
467+
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
468+
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
469+
///
470+
/// @tparam T A floating-point scalar type
471+
template<typename T>
472+
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH_ZO(
473+
T fovy, T aspect, T near);
474+
475+
/// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite.
476+
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
477+
///
478+
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
479+
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
480+
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
481+
///
482+
/// @tparam T A floating-point scalar type
483+
template<typename T>
484+
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH_NO(
485+
T fovy, T aspect, T near);
486+
487+
/// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite.
488+
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
489+
///
490+
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
491+
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
492+
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
493+
///
494+
/// @tparam T A floating-point scalar type
495+
template<typename T>
496+
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH_ZO(
497+
T fovy, T aspect, T near);
498+
499+
/// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite.
500+
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
501+
///
502+
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
503+
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
504+
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
505+
///
506+
/// @tparam T A floating-point scalar type
507+
template<typename T>
508+
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH_NO(
509+
T fovy, T aspect, T near);
510+
511+
/// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite.
512+
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
513+
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
464514
///
465515
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
466516
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
@@ -472,6 +522,8 @@ namespace glm
472522
T fovy, T aspect, T near);
473523

474524
/// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite.
525+
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
526+
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
475527
///
476528
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
477529
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
@@ -483,6 +535,8 @@ namespace glm
483535
T fovy, T aspect, T near);
484536

485537
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness.
538+
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
539+
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
486540
///
487541
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
488542
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

glm/ext/matrix_clip_space.inl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,26 @@ namespace glm
554554
return Result;
555555
}
556556

557+
template<typename T>
558+
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
559+
{
560+
# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
561+
return infinitePerspectiveRH_ZO(fovy, aspect, zNear);
562+
# else
563+
return infinitePerspectiveRH_NO(fovy, aspect, zNear);
564+
# endif
565+
}
566+
567+
template<typename T>
568+
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
569+
{
570+
# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
571+
return infinitePerspectiveLH_ZO(fovy, aspect, zNear);
572+
# else
573+
return infinitePerspectiveLH_NO(fovy, aspect, zNear);
574+
# endif
575+
}
576+
557577
template<typename T>
558578
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
559579
{

glm/glm.cppm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,6 +2634,9 @@ export namespace glm {
26342634
using glm::tanh;
26352635
using glm::third;
26362636
using glm::three_over_two_pi;
2637+
using glm::toMat3;
2638+
using glm::toMat4;
2639+
using glm::toQuat;
26372640
using glm::translate;
26382641
using glm::transpose;
26392642
using glm::triangleNormal;

glm/gtc/noise.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/// @ref gtc_noise
22
///
33
// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
4-
// https://github.com/ashima/webgl-noise
4+
// https://github.com/stegu/webgl-noise
55
// Following Stefan Gustavson's paper "Simplex noise demystified":
6-
// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
6+
// https://itn-web.it.liu.se/~stegu76/simplexnoise/simplexnoise.pdf
77

88
namespace glm{
99
namespace detail

0 commit comments

Comments
 (0)