aboutsummaryrefslogtreecommitdiff
path: root/3rdparty/glm/source/test
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-22 01:08:24 -0700
committerrtk0c <[email protected]>2022-05-22 01:08:24 -0700
commitc568f0a8c9f0aef00c770b494ee1ff3a89ab48de (patch)
tree1dc1e69d796e635cdac6a4ef7e6d3a90ab1423c2 /3rdparty/glm/source/test
parenta5db6bd3cc4af5233010ff44d0572ddf98b43c9d (diff)
Changeset: 35 Fix missing sources in git submodules after migration to PlasticSCM
Diffstat (limited to '3rdparty/glm/source/test')
-rw-r--r--3rdparty/glm/source/test/CMakeLists.txt246
-rw-r--r--3rdparty/glm/source/test/bug/CMakeLists.txt1
-rw-r--r--3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp31
-rw-r--r--3rdparty/glm/source/test/cmake/CMakeLists.txt8
-rw-r--r--3rdparty/glm/source/test/cmake/test_find_glm.cpp22
-rw-r--r--3rdparty/glm/source/test/core/CMakeLists.txt52
-rw-r--r--3rdparty/glm/source/test/core/core_cpp_constexpr.cpp750
-rw-r--r--3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp145
-rw-r--r--3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp10
-rw-r--r--3rdparty/glm/source/test/core/core_force_arch_unknown.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_ctor_init.cpp139
-rw-r--r--3rdparty/glm/source/test/core/core_force_cxx03.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_cxx98.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp17
-rw-r--r--3rdparty/glm/source/test/core/core_force_inline.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_force_left_handed.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_force_platform_unknown.cpp14
-rw-r--r--3rdparty/glm/source/test/core/core_force_pure.cpp434
-rw-r--r--3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp13
-rw-r--r--3rdparty/glm/source/test/core/core_force_size_t_length.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_force_xyzw_only.cpp58
-rw-r--r--3rdparty/glm/source/test/core/core_func_common.cpp1349
-rw-r--r--3rdparty/glm/source/test/core/core_func_exponential.cpp185
-rw-r--r--3rdparty/glm/source/test/core/core_func_geometric.cpp200
-rw-r--r--3rdparty/glm/source/test/core/core_func_integer.cpp1556
-rw-r--r--3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp291
-rw-r--r--3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp416
-rw-r--r--3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp440
-rw-r--r--3rdparty/glm/source/test/core/core_func_matrix.cpp312
-rw-r--r--3rdparty/glm/source/test/core/core_func_noise.cpp7
-rw-r--r--3rdparty/glm/source/test/core/core_func_packing.cpp156
-rw-r--r--3rdparty/glm/source/test/core/core_func_swizzle.cpp164
-rw-r--r--3rdparty/glm/source/test/core/core_func_trigonometric.cpp10
-rw-r--r--3rdparty/glm/source/test/core/core_func_vector_relational.cpp180
-rw-r--r--3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp12
-rw-r--r--3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp22
-rw-r--r--3rdparty/glm/source/test/core/core_setup_message.cpp230
-rw-r--r--3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp21
-rw-r--r--3rdparty/glm/source/test/core/core_setup_precision.cpp58
-rw-r--r--3rdparty/glm/source/test/core/core_type_aligned.cpp92
-rw-r--r--3rdparty/glm/source/test/core/core_type_cast.cpp146
-rw-r--r--3rdparty/glm/source/test/core/core_type_ctor.cpp351
-rw-r--r--3rdparty/glm/source/test/core/core_type_int.cpp26
-rw-r--r--3rdparty/glm/source/test/core/core_type_length.cpp78
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat2x2.cpp177
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat2x3.cpp142
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat2x4.cpp147
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat3x2.cpp148
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat3x3.cpp197
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat3x4.cpp149
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat4x2.cpp151
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat4x3.cpp152
-rw-r--r--3rdparty/glm/source/test/core/core_type_mat4x4.cpp218
-rw-r--r--3rdparty/glm/source/test/core/core_type_vec1.cpp169
-rw-r--r--3rdparty/glm/source/test/core/core_type_vec2.cpp392
-rw-r--r--3rdparty/glm/source/test/core/core_type_vec3.cpp628
-rw-r--r--3rdparty/glm/source/test/core/core_type_vec4.cpp850
-rw-r--r--3rdparty/glm/source/test/ext/CMakeLists.txt55
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp13
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_common.cpp53
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_integer.cpp237
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_projection.cpp13
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_relational.cpp163
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_transform.cpp61
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_common.cpp61
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp87
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp88
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp51
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp45
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp40
-rw-r--r--3rdparty/glm/source/test/ext/ext_quaternion_type.cpp113
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_common.cpp360
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_constants.cpp36
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp43
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_integer.cpp686
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_packing.cpp28
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp171
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_relational.cpp106
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp43
-rw-r--r--3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp96
-rw-r--r--3rdparty/glm/source/test/ext/ext_vec1.cpp157
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_bool1.cpp104
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_common.cpp365
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_iec559.cpp166
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_integer.cpp547
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp216
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_packing.cpp58
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp186
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_relational.cpp205
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp41
-rw-r--r--3rdparty/glm/source/test/ext/ext_vector_ulp.cpp99
-rw-r--r--3rdparty/glm/source/test/glm.cppcheck6
-rw-r--r--3rdparty/glm/source/test/gtc/CMakeLists.txt20
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_bitfield.cpp936
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_color_space.cpp78
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_constants.cpp30
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_epsilon.cpp78
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_integer.cpp233
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp383
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp8
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp51
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp55
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_noise.cpp86
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_packing.cpp878
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_quaternion.cpp345
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_random.cpp381
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp8
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_round.cpp458
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp181
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_type_precision.cpp1041
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp335
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_ulp.cpp99
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp30
-rw-r--r--3rdparty/glm/source/test/gtc/gtc_vec1.cpp8
-rw-r--r--3rdparty/glm/source/test/gtx/CMakeLists.txt59
-rw-r--r--3rdparty/glm/source/test/gtx/gtx.cpp8
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp10
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_closest_point.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp51
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_color_space.cpp20
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_common.cpp161
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_compatibility.cpp19
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_component_wise.cpp116
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp205
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_easing.cpp65
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp539
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_extend.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp101
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp39
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp14
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp45
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp564
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_functions.cpp36
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp34
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp18
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_integer.cpp108
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_intersect.cpp88
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_io.cpp186
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_load.cpp124
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_log_base.cpp54
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp19
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp105
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp122
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp86
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp66
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp18
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_norm.cpp81
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_normal.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_number_precision.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_pca.cpp724
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_projection.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_quaternion.cpp107
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_random.cpp99
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_range.cpp83
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp9
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp77
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp37
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp174
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp324
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp71
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_spline.cpp100
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_string_cast.cpp155
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_texture.cpp22
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp114
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_type_trait.cpp13
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp11
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp59
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_vector_query.cpp82
-rw-r--r--3rdparty/glm/source/test/gtx/gtx_wrap.cpp191
-rw-r--r--3rdparty/glm/source/test/perf/CMakeLists.txt6
-rw-r--r--3rdparty/glm/source/test/perf/perf_matrix_div.cpp153
-rw-r--r--3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp150
-rw-r--r--3rdparty/glm/source/test/perf/perf_matrix_mul.cpp154
-rw-r--r--3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp154
-rw-r--r--3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp150
-rw-r--r--3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp154
216 files changed, 29882 insertions, 0 deletions
diff --git a/3rdparty/glm/source/test/CMakeLists.txt b/3rdparty/glm/source/test/CMakeLists.txt
new file mode 100644
index 0000000..e7f85f1
--- /dev/null
+++ b/3rdparty/glm/source/test/CMakeLists.txt
@@ -0,0 +1,246 @@
+option(GLM_QUIET "No CMake Message" OFF)
+option(BUILD_SHARED_LIBS "Build shared library" ON)
+option(BUILD_STATIC_LIBS "Build static library" ON)
+option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF)
+option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF)
+option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF)
+option(GLM_TEST_ENABLE_CXX_17 "Enable C++ 17" OFF)
+option(GLM_TEST_ENABLE_CXX_20 "Enable C++ 20" OFF)
+
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+if(GLM_TEST_ENABLE_CXX_20)
+ set(CMAKE_CXX_STANDARD 20)
+ add_definitions(-DGLM_FORCE_CXX2A)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with C++20 features")
+ endif()
+
+elseif(GLM_TEST_ENABLE_CXX_17)
+ set(CMAKE_CXX_STANDARD 17)
+ add_definitions(-DGLM_FORCE_CXX17)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with C++17 features")
+ endif()
+
+elseif(GLM_TEST_ENABLE_CXX_14)
+ set(CMAKE_CXX_STANDARD 14)
+ add_definitions(-DGLM_FORCE_CXX14)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with C++14 features")
+ endif()
+
+elseif(GLM_TEST_ENABLE_CXX_11)
+ set(CMAKE_CXX_STANDARD 11)
+ add_definitions(-DGLM_FORCE_CXX11)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with C++11 features")
+ endif()
+
+elseif(GLM_TEST_ENABLE_CXX_98)
+ set(CMAKE_CXX_STANDARD 98)
+ add_definitions(-DGLM_FORCE_CXX98)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with C++98 features")
+ endif()
+endif()
+
+option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
+
+option(GLM_DISABLE_AUTO_DETECTION "Enable language extensions" OFF)
+
+if(GLM_DISABLE_AUTO_DETECTION)
+ add_definitions(-DGLM_FORCE_PLATFORM_UNKNOWN -DGLM_FORCE_COMPILER_UNKNOWN -DGLM_FORCE_ARCH_UNKNOWN -DGLM_FORCE_CXX_UNKNOWN)
+endif()
+
+if(GLM_TEST_ENABLE_LANG_EXTENSIONS)
+ set(CMAKE_CXX_EXTENSIONS ON)
+ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
+ add_compile_options(-fms-extensions)
+ endif()
+ message(STATUS "GLM: Build with C++ language extensions")
+else()
+ set(CMAKE_CXX_EXTENSIONS OFF)
+ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ add_compile_options(/Za)
+ if(MSVC15)
+ add_compile_options(/permissive-)
+ endif()
+ endif()
+endif()
+
+option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
+if(GLM_TEST_ENABLE_FAST_MATH)
+ if(NOT GLM_QUIET)
+ message(STATUS "GLM: Build with fast math optimizations")
+ endif()
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
+ add_compile_options(-ffast-math)
+
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ add_compile_options(/fp:fast)
+ endif()
+else()
+ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ add_compile_options(/fp:precise)
+ endif()
+endif()
+
+option(GLM_TEST_ENABLE "Build unit tests" ON)
+option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
+option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
+option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)
+
+if(GLM_TEST_FORCE_PURE)
+ add_definitions(-DGLM_FORCE_PURE)
+
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ add_compile_options(-mfpmath=387)
+ endif()
+ message(STATUS "GLM: No SIMD instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_AVX2)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-mavx2)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxAVX2)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ add_compile_options(/arch:AVX2)
+ endif()
+ message(STATUS "GLM: AVX2 instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_AVX)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-mavx)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxAVX)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ add_compile_options(/arch:AVX)
+ endif()
+ message(STATUS "GLM: AVX instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_SSE4_2)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-msse4.2)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxSSE4.2)
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2
+ endif()
+ message(STATUS "GLM: SSE4.2 instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_SSE4_1)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-msse4.1)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxSSE4.1)
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE4.1
+ endif()
+ message(STATUS "GLM: SSE4.1 instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_SSSE3)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-mssse3)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxSSSE3)
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
+ add_compile_options(/arch:SSE2) # VC doesn't support SSSE3
+ endif()
+ message(STATUS "GLM: SSSE3 instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_SSE3)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-msse3)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxSSE3)
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
+ add_compile_options(/arch:SSE2) # VC doesn't support SSE3
+ endif()
+ message(STATUS "GLM: SSE3 instruction set")
+
+elseif(GLM_TEST_ENABLE_SIMD_SSE2)
+ add_definitions(-DGLM_FORCE_INTRINSICS)
+
+ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+ add_compile_options(-msse2)
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ add_compile_options(/QxSSE2)
+ elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
+ add_compile_options(/arch:SSE2)
+ endif()
+ message(STATUS "GLM: SSE2 instruction set")
+endif()
+
+# Compiler and default options
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if(NOT GLM_QUIET)
+ message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler")
+ endif()
+
+ add_compile_options(-Werror -Weverything)
+ add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types)
+ add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral)
+
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ if(NOT GLM_QUIET)
+ message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
+ endif()
+
+ add_compile_options(-O2)
+ add_compile_options(-Wno-long-long)
+
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ if(NOT GLM_QUIET)
+ message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler")
+ endif()
+
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ if(NOT GLM_QUIET)
+ message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
+ endif()
+
+ add_compile_options(/W4 /WX)
+ add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
+
+function(glmCreateTestGTC NAME)
+ set(SAMPLE_NAME test-${NAME})
+ add_executable(${SAMPLE_NAME} ${NAME}.cpp)
+
+ add_test(
+ NAME ${SAMPLE_NAME}
+ COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
+ target_link_libraries(${SAMPLE_NAME} PRIVATE glm::glm)
+endfunction()
+
+if(GLM_TEST_ENABLE)
+ add_subdirectory(bug)
+ add_subdirectory(core)
+ add_subdirectory(ext)
+ add_subdirectory(gtc)
+ add_subdirectory(gtx)
+ add_subdirectory(perf)
+endif()
+
+
diff --git a/3rdparty/glm/source/test/bug/CMakeLists.txt b/3rdparty/glm/source/test/bug/CMakeLists.txt
new file mode 100644
index 0000000..26e8569
--- /dev/null
+++ b/3rdparty/glm/source/test/bug/CMakeLists.txt
@@ -0,0 +1 @@
+glmCreateTestGTC(bug_ms_vec_static)
diff --git a/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp b/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp
new file mode 100644
index 0000000..7f44e40
--- /dev/null
+++ b/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp
@@ -0,0 +1,31 @@
+#include <glm/glm.hpp>
+
+#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
+struct vec2;
+
+struct _swizzle
+{
+ char _buffer[1];
+};
+
+struct vec2
+{
+ GLM_CONSTEXPR vec2() :
+ x(0), y(0)
+ {}
+
+ union
+ {
+ struct { float x, y; };
+ struct { _swizzle xx; };
+ };
+};
+#endif
+
+// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler.
+// vec2 Bar;
+
+int main()
+{
+ return 0;
+}
diff --git a/3rdparty/glm/source/test/cmake/CMakeLists.txt b/3rdparty/glm/source/test/cmake/CMakeLists.txt
new file mode 100644
index 0000000..5bc11ef
--- /dev/null
+++ b/3rdparty/glm/source/test/cmake/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+project(test_find_glm)
+
+find_package(glm REQUIRED)
+
+add_executable(test_find_glm test_find_glm.cpp)
+target_link_libraries(test_find_glm glm::glm)
+
diff --git a/3rdparty/glm/source/test/cmake/test_find_glm.cpp b/3rdparty/glm/source/test/cmake/test_find_glm.cpp
new file mode 100644
index 0000000..361b977
--- /dev/null
+++ b/3rdparty/glm/source/test/cmake/test_find_glm.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
+{
+ glm::mat4 Projection = glm::perspective(glm::pi<float>() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f);
+ glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
+ View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
+ View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
+ glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
+ return Projection * View * Model;
+}
+
+int main()
+{
+ const glm::mat4 m = camera(1.f, glm::vec2(1.f, 0.5f));
+ std::cout << "matrix diagonal: " << m[0][0] << ", "
+ << m[1][1] << ", " << m[2][2] << ", " << m[3][3] << "\n";
+ return 0;
+}
+
diff --git a/3rdparty/glm/source/test/core/CMakeLists.txt b/3rdparty/glm/source/test/core/CMakeLists.txt
new file mode 100644
index 0000000..6cd57b1
--- /dev/null
+++ b/3rdparty/glm/source/test/core/CMakeLists.txt
@@ -0,0 +1,52 @@
+glmCreateTestGTC(core_cpp_constexpr)
+glmCreateTestGTC(core_cpp_defaulted_ctor)
+glmCreateTestGTC(core_force_aligned_gentypes)
+glmCreateTestGTC(core_force_ctor_init)
+glmCreateTestGTC(core_force_cxx03)
+glmCreateTestGTC(core_force_cxx98)
+glmCreateTestGTC(core_force_arch_unknown)
+glmCreateTestGTC(core_force_compiler_unknown)
+glmCreateTestGTC(core_force_cxx_unknown)
+glmCreateTestGTC(core_force_explicit_ctor)
+glmCreateTestGTC(core_force_inline)
+glmCreateTestGTC(core_force_platform_unknown)
+glmCreateTestGTC(core_force_pure)
+glmCreateTestGTC(core_force_unrestricted_gentype)
+glmCreateTestGTC(core_force_xyzw_only)
+glmCreateTestGTC(core_force_quat_xyzw)
+glmCreateTestGTC(core_type_aligned)
+glmCreateTestGTC(core_type_cast)
+glmCreateTestGTC(core_type_ctor)
+glmCreateTestGTC(core_type_int)
+glmCreateTestGTC(core_type_length)
+glmCreateTestGTC(core_type_mat2x2)
+glmCreateTestGTC(core_type_mat2x3)
+glmCreateTestGTC(core_type_mat2x4)
+glmCreateTestGTC(core_type_mat3x2)
+glmCreateTestGTC(core_type_mat3x3)
+glmCreateTestGTC(core_type_mat3x4)
+glmCreateTestGTC(core_type_mat4x2)
+glmCreateTestGTC(core_type_mat4x3)
+glmCreateTestGTC(core_type_mat4x4)
+glmCreateTestGTC(core_type_vec1)
+glmCreateTestGTC(core_type_vec2)
+glmCreateTestGTC(core_type_vec3)
+glmCreateTestGTC(core_type_vec4)
+glmCreateTestGTC(core_func_common)
+glmCreateTestGTC(core_func_exponential)
+glmCreateTestGTC(core_func_geometric)
+glmCreateTestGTC(core_func_integer)
+glmCreateTestGTC(core_func_integer_bit_count)
+glmCreateTestGTC(core_func_integer_find_lsb)
+glmCreateTestGTC(core_func_integer_find_msb)
+glmCreateTestGTC(core_func_matrix)
+glmCreateTestGTC(core_func_noise)
+glmCreateTestGTC(core_func_packing)
+glmCreateTestGTC(core_func_trigonometric)
+glmCreateTestGTC(core_func_vector_relational)
+glmCreateTestGTC(core_func_swizzle)
+glmCreateTestGTC(core_setup_force_cxx98)
+glmCreateTestGTC(core_setup_force_size_t_length)
+glmCreateTestGTC(core_setup_message)
+glmCreateTestGTC(core_setup_platform_unknown)
+glmCreateTestGTC(core_setup_precision)
diff --git a/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp b/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp
new file mode 100644
index 0000000..3dc0a92
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp
@@ -0,0 +1,750 @@
+#include <glm/glm.hpp>
+
+#if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_int1.hpp>
+#include <glm/ext/vector_bool1.hpp>
+#include <glm/ext/vector_bool4.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/vector_relational.hpp>
+
+static int test_vec1()
+{
+ int Error = 0;
+
+ {
+ constexpr glm::bvec1 B(true);
+ constexpr bool A = glm::all(B);
+ static_assert(A, "GLM: Failed constexpr");
+
+ constexpr glm::bvec1 D(true);
+ constexpr bool C = glm::any(D);
+ static_assert(C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec2 C(true);
+ constexpr glm::bvec2 B(true);
+ static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 O(glm::ivec1(1));
+ static_assert(glm::ivec1(1) == O, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 P(1);
+ static_assert(glm::ivec1(1) == P, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 L(glm::ivec2(1, 2));
+ static_assert(glm::ivec1(1) == L, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 M(glm::ivec3(1, 2, 3));
+ static_assert(glm::ivec1(1) == M, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 N(glm::ivec4(1, 2, 3, 4));
+ static_assert(glm::ivec1(1) == N, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ static_assert(A[0] == 1, "GLM: Failed constexpr");
+ static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec1 A1(true);
+ constexpr glm::bvec1 A2(true);
+ constexpr glm::bvec1 B1(false);
+ constexpr glm::bvec1 B2(false);
+ static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr");
+ static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ constexpr glm::ivec1 B = A + 1;
+ constexpr glm::ivec1 C(3);
+ static_assert(A + B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D = +A;
+ static_assert(D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(3);
+ constexpr glm::ivec1 B = A - 1;
+ constexpr glm::ivec1 C(1);
+ static_assert(A - B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D = -A;
+ static_assert(-D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(3);
+ constexpr glm::ivec1 B = A * 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B * C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(3);
+ constexpr glm::ivec1 B = A / 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B / C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(3);
+ constexpr glm::ivec1 B = A % 2;
+ constexpr glm::ivec1 C(1);
+ static_assert(B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D(2);
+ static_assert(A % D == C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ constexpr glm::ivec1 B = A & 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A & C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ constexpr glm::ivec1 B = A | 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A | C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ constexpr glm::ivec1 B = A ^ 0;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(0);
+ static_assert(A == (A ^ C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(1);
+ constexpr glm::ivec1 B = A << 1;
+ static_assert(B == glm::ivec1(2), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == (A << C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(2);
+ constexpr glm::ivec1 B = A >> 1;
+ static_assert(B == glm::ivec1(1), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == A >> C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec1 A(~0);
+ constexpr glm::ivec1 B = ~A;
+ static_assert(A == ~B, "GLM: Failed constexpr");
+ }
+
+ return Error;
+}
+
+static int test_vec2()
+{
+ int Error = 0;
+
+ {
+ constexpr glm::bvec2 B(true);
+ constexpr bool A = glm::all(B);
+ static_assert(A, "GLM: Failed constexpr");
+
+ constexpr glm::bvec2 D(true, false);
+ constexpr bool C = glm::any(D);
+ static_assert(C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec2 C(true);
+ constexpr glm::bvec2 B(true, false);
+ static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 O(glm::ivec1(1));
+ static_assert(glm::ivec2(1) == O, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 A(1);
+ static_assert(glm::ivec2(1) == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 F(glm::ivec1(1), glm::ivec1(2));
+ static_assert(glm::ivec2(1, 2) == F, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 G(1, glm::ivec1(2));
+ static_assert(glm::ivec2(1, 2) == G, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 H(glm::ivec1(1), 2);
+ static_assert(glm::ivec2(1, 2) == H, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 I(1, 2);
+ static_assert(glm::ivec2(1, 2) == I, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 L(glm::ivec2(1, 2));
+ static_assert(glm::ivec2(1, 2) == L, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 M(glm::ivec3(1, 2, 3));
+ static_assert(glm::ivec2(1, 2) == M, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 N(glm::ivec4(1, 2, 3, 4));
+ static_assert(glm::ivec2(1, 2) == N, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ static_assert(A[0] == 1, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec2 A1(true);
+ constexpr glm::bvec2 A2(true);
+ constexpr glm::bvec2 B1(false);
+ constexpr glm::bvec2 B2(false);
+ static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr");
+ static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ constexpr glm::ivec2 B = A + 1;
+ constexpr glm::ivec2 C(3);
+ static_assert(A + B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 D = +A;
+ static_assert(D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(3);
+ constexpr glm::ivec2 B = A - 1;
+ constexpr glm::ivec2 C(1);
+ static_assert(A - B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 D = -A;
+ static_assert(-D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(3);
+ constexpr glm::ivec2 B = A * 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 C(1);
+ static_assert(B * C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(3);
+ constexpr glm::ivec2 B = A / 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec2 C(1);
+ static_assert(B / C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(3);
+ constexpr glm::ivec2 B = A % 2;
+ constexpr glm::ivec2 C(1);
+ static_assert(B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D(2);
+ static_assert(A % D == C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ constexpr glm::ivec2 B = A & 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A & C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ constexpr glm::ivec2 B = A | 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A | C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ constexpr glm::ivec2 B = A ^ 0;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(0);
+ static_assert(A == (A ^ C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(1);
+ constexpr glm::ivec2 B = A << 1;
+ static_assert(B == glm::ivec2(2), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == (A << C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(2);
+ constexpr glm::ivec2 B = A >> 1;
+ static_assert(B == glm::ivec2(1), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == A >> C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec2 A(~0);
+ constexpr glm::ivec2 B = ~A;
+ static_assert(A == ~B, "GLM: Failed constexpr");
+ }
+
+ return Error;
+}
+
+static int test_vec3()
+{
+ int Error = 0;
+
+ {
+ constexpr glm::bvec3 B(true);
+ constexpr bool A = glm::all(B);
+ static_assert(A, "GLM: Failed constexpr");
+
+ constexpr glm::bvec3 D(true, false, true);
+ constexpr bool C = glm::any(D);
+ static_assert(C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec3 C(true);
+ constexpr glm::bvec3 B(true, false, true);
+ static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 O(glm::ivec1(1));
+ static_assert(glm::ivec3(1) == O, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 A(1);
+ static_assert(glm::ivec3(1) == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 B(glm::ivec2(1, 2), 3);
+ static_assert(glm::ivec3(1, 2, 3) == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 C(1, glm::ivec2(2, 3));
+ static_assert(glm::ivec3(1, 2, 3) == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 D(glm::ivec1(1), glm::ivec2(2, 3));
+ static_assert(glm::ivec3(1, 2, 3) == D, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 E(glm::ivec2(1, 2), glm::ivec1(3));
+ static_assert(glm::ivec3(1, 2, 3) == E, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 F(glm::ivec1(1), glm::ivec1(2), glm::ivec1(3));
+ static_assert(glm::ivec3(1, 2, 3) == F, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 G(1, glm::ivec1(2), glm::ivec1(3));
+ static_assert(glm::ivec3(1, 2, 3) == G, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 H(glm::ivec1(1), 2, glm::ivec1(3));
+ static_assert(glm::ivec3(1, 2, 3) == H, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 I(1, 2, glm::ivec1(3));
+ static_assert(glm::ivec3(1, 2, 3) == I, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 J(glm::ivec1(1), glm::ivec1(2), 3);
+ static_assert(glm::ivec3(1, 2, 3) == J, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 K(1, glm::ivec1(2), 3);
+ static_assert(glm::ivec3(1, 2, 3) == K, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 L(glm::ivec1(1), 2, 3);
+ static_assert(glm::ivec3(1, 2, 3) == L, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 M(1, 2, 3);
+ static_assert(glm::ivec3(1, 2, 3) == M, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 N(glm::ivec4(1, 2, 3, 4));
+ static_assert(glm::ivec3(1, 2, 3) == N, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 const A(1);
+ static_assert(A[0] == 1, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec3 A1(true);
+ constexpr glm::bvec3 A2(true);
+ constexpr glm::bvec3 B1(false);
+ constexpr glm::bvec3 B2(false);
+ static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr");
+ static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(1);
+ constexpr glm::ivec3 B = A + 1;
+ constexpr glm::ivec3 C(3);
+ static_assert(A + B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 D = +A;
+ static_assert(D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(3);
+ constexpr glm::ivec3 B = A - 1;
+ constexpr glm::ivec3 C(1);
+ static_assert(A - B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 D = -A;
+ static_assert(-D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(3);
+ constexpr glm::ivec3 B = A * 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 C(1);
+ static_assert(B * C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(3);
+ constexpr glm::ivec3 B = A / 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec3 C(1);
+ static_assert(B / C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(3);
+ constexpr glm::ivec3 B = A % 2;
+ constexpr glm::ivec3 C(1);
+ static_assert(B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D(2);
+ static_assert(A % D == C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(1);
+ constexpr glm::ivec3 B = A & 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A & C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(1);
+ constexpr glm::ivec3 B = A | 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A | C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(1);
+ constexpr glm::ivec3 B = A ^ 0;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(0);
+ static_assert(A == (A ^ C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(1);
+ constexpr glm::ivec3 B = A << 1;
+ static_assert(B == glm::ivec3(2), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == (A << C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(2);
+ constexpr glm::ivec3 B = A >> 1;
+ static_assert(B == glm::ivec3(1), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == A >> C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec3 A(~0);
+ constexpr glm::ivec3 B = ~A;
+ static_assert(A == ~B, "GLM: Failed constexpr");
+ }
+
+ return Error;
+}
+
+static int test_vec4()
+{
+ int Error = 0;
+
+ {
+ constexpr glm::bvec4 B(true);
+ constexpr bool A = glm::all(B);
+ static_assert(A, "GLM: Failed constexpr");
+
+ constexpr glm::bvec4 D(true, false, true, false);
+ constexpr bool C = glm::any(D);
+ static_assert(C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec4 C(true);
+ constexpr glm::bvec4 B(true, false, true, false);
+ static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 O(glm::ivec4(1));
+ static_assert(glm::ivec4(1) == O, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 A(1);
+ static_assert(glm::ivec4(1) == A, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 N(glm::ivec4(1, 2, 3, 4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == N, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(glm::ivec3(1, 2, 3), 4);
+ static_assert(glm::ivec4(1, 2, 3, 4) == A, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 B(glm::ivec2(1, 2), glm::ivec2(3, 4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 C(1, glm::ivec3(2, 3, 4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 D(glm::ivec1(1), glm::ivec2(2, 3), glm::ivec1(4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == D, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 E(glm::ivec2(1, 2), glm::ivec1(3), glm::ivec1(4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == E, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 F(glm::ivec1(1), glm::ivec1(2), glm::ivec2(3, 4));
+ static_assert(glm::ivec4(1, 2, 3, 4) == F, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ static_assert(A[0] == 1, "GLM: Failed constexpr");
+ static_assert(glm::ivec4(1).x > 0, "GLM: Failed constexpr");
+ static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).x > 0, "GLM: Failed constexpr");
+ static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).y < 0, "GLM: Failed constexpr");
+ static_assert(glm::ivec4::length() == 4, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::bvec4 A1(true);
+ constexpr glm::bvec4 A2(true);
+ constexpr glm::bvec4 B1(false);
+ constexpr glm::bvec4 B2(false);
+ static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr");
+ static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ constexpr glm::ivec4 B = A + 1;
+ constexpr glm::ivec4 C(3);
+ static_assert(A + B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 D = +A;
+ static_assert(D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(3);
+ constexpr glm::ivec4 B = A - 1;
+ constexpr glm::ivec4 C(1);
+ static_assert(A - B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 D = -A;
+ static_assert(-D == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(3);
+ constexpr glm::ivec4 B = A * 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 C(1);
+ static_assert(B * C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(3);
+ constexpr glm::ivec4 B = A / 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec4 C(1);
+ static_assert(B / C == A, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(3);
+ constexpr glm::ivec4 B = A % 2;
+ constexpr glm::ivec4 C(1);
+ static_assert(B == C, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 D(2);
+ static_assert(A % D == C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ constexpr glm::ivec4 B = A & 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A & C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ constexpr glm::ivec4 B = A | 1;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(A == (A | C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ constexpr glm::ivec4 B = A ^ 0;
+ static_assert(A == B, "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(0);
+ static_assert(A == (A ^ C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(1);
+ constexpr glm::ivec4 B = A << 1;
+ static_assert(B == glm::ivec4(2), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == (A << C), "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(2);
+ constexpr glm::ivec4 B = A >> 1;
+ static_assert(B == glm::ivec4(1), "GLM: Failed constexpr");
+
+ constexpr glm::ivec1 C(1);
+ static_assert(B == A >> C, "GLM: Failed constexpr");
+ }
+
+ {
+ constexpr glm::ivec4 A(~0);
+ constexpr glm::ivec4 B = ~A;
+ static_assert(A == ~B, "GLM: Failed constexpr");
+ }
+
+ return Error;
+}
+
+static int test_quat()
+{
+ int Error = 0;
+
+ {
+ static_assert(glm::quat::length() == 4, "GLM: Failed constexpr");
+ static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::quat(1.0f, 0.0f, 0.0f, 0.0f).w > 0.0f, "GLM: Failed constexpr");
+
+ glm::quat constexpr Q = glm::identity<glm::quat>();
+ static_assert(Q.x - glm::quat(1.0f, glm::vec3(0.0f)).x <= glm::epsilon<float>(), "GLM: Failed constexpr");
+ }
+
+ return Error;
+}
+
+static int test_mat2x2()
+{
+ int Error = 0;
+
+ static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr");
+
+ return Error;
+}
+
+#endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE
+
+int main()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ Error += test_vec1();
+ Error += test_vec2();
+ Error += test_vec3();
+ Error += test_vec4();
+ Error += test_quat();
+ Error += test_mat2x2();
+# endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp b/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp
new file mode 100644
index 0000000..07afd9c
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp
@@ -0,0 +1,145 @@
+#include <glm/glm.hpp>
+
+#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <cstring>
+
+static int test_vec_memcpy()
+{
+ int Error = 0;
+
+ {
+ glm::ivec1 const A = glm::ivec1(76);
+ glm::ivec1 B;
+ std::memcpy(&B, &A, sizeof(glm::ivec1));
+ Error += B == A ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 const A = glm::ivec2(76);
+ glm::ivec2 B;
+ std::memcpy(&B, &A, sizeof(glm::ivec2));
+ Error += B == A ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 const A = glm::ivec3(76);
+ glm::ivec3 B;
+ std::memcpy(&B, &A, sizeof(glm::ivec3));
+ Error += B == A ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 const A = glm::ivec4(76);
+ glm::ivec4 B;
+ std::memcpy(&B, &A, sizeof(glm::ivec4));
+ Error += B == A ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_mat_memcpy()
+{
+ int Error = 0;
+
+ {
+ glm::mat2x2 const A = glm::mat2x2(76);
+ glm::mat2x2 B;
+ std::memcpy(&B, &A, sizeof(glm::mat2x2));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat2x3 const A = glm::mat2x3(76);
+ glm::mat2x3 B;
+ std::memcpy(&B, &A, sizeof(glm::mat2x3));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat2x4 const A = glm::mat2x4(76);
+ glm::mat2x4 B;
+ std::memcpy(&B, &A, sizeof(glm::mat2x4));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x2 const A = glm::mat3x2(76);
+ glm::mat3x2 B;
+ std::memcpy(&B, &A, sizeof(glm::mat3x2));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x3 const A = glm::mat3x3(76);
+ glm::mat3x3 B;
+ std::memcpy(&B, &A, sizeof(glm::mat3x3));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x4 const A = glm::mat3x4(76);
+ glm::mat3x4 B;
+ std::memcpy(&B, &A, sizeof(glm::mat3x4));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x2 const A = glm::mat4x2(76);
+ glm::mat4x2 B;
+ std::memcpy(&B, &A, sizeof(glm::mat4x2));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x3 const A = glm::mat4x3(76);
+ glm::mat4x3 B;
+ std::memcpy(&B, &A, sizeof(glm::mat4x3));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x4 const A = glm::mat4x4(76);
+ glm::mat4x4 B;
+ std::memcpy(&B, &A, sizeof(glm::mat4x4));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_quat_memcpy()
+{
+ int Error = 0;
+
+ {
+ glm::quat const A = glm::quat(1, 0, 0, 0);
+ glm::quat B;
+ std::memcpy(&B, &A, sizeof(glm::quat));
+ Error += glm::all(glm::equal(B, A, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+#endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+
+int main()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+ Error += test_vec_memcpy();
+ Error += test_mat_memcpy();
+ Error += test_quat_memcpy();
+# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp b/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp
new file mode 100644
index 0000000..70713c4
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp
@@ -0,0 +1,10 @@
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp b/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp
new file mode 100644
index 0000000..45b51bf
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_ARCH_UNKNOWN
+# define GLM_FORCE_ARCH_UNKNOWN
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp b/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp
new file mode 100644
index 0000000..44d7fc3
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_COMPILER_UNKNOWN
+# define GLM_FORCE_COMPILER_UNKNOWN
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_ctor_init.cpp b/3rdparty/glm/source/test/core/core_force_ctor_init.cpp
new file mode 100644
index 0000000..298b7ed
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_ctor_init.cpp
@@ -0,0 +1,139 @@
+#define GLM_FORCE_CTOR_INIT
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+static int test_vec()
+{
+ int Error = 0;
+
+ glm::vec1 V1;
+ Error += glm::all(glm::equal(V1, glm::vec1(0), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dvec1 U1;
+ Error += glm::all(glm::equal(U1, glm::dvec1(0), glm::epsilon<double>())) ? 0 : 1;
+
+ glm::vec2 V2;
+ Error += glm::all(glm::equal(V2, glm::vec2(0, 0), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dvec2 U2;
+ Error += glm::all(glm::equal(U2, glm::dvec2(0, 0), glm::epsilon<double>())) ? 0 : 1;
+
+ glm::vec3 V3;
+ Error += glm::all(glm::equal(V3, glm::vec3(0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dvec3 U3;
+ Error += glm::all(glm::equal(U3, glm::dvec3(0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
+
+ glm::vec4 V4;
+ Error += glm::all(glm::equal(V4, glm::vec4(0, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dvec4 U4;
+ Error += glm::all(glm::equal(U4, glm::dvec4(0, 0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mat()
+{
+ int Error = 0;
+
+ {
+ glm::mat2x2 F;
+ Error += glm::all(glm::equal(F, glm::mat2x2(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat2x2 D;
+ Error += glm::all(glm::equal(D, glm::dmat2x2(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat2x3 F;
+ Error += glm::all(glm::equal(F, glm::mat2x3(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat2x3 D;
+ Error += glm::all(glm::equal(D, glm::dmat2x3(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat2x4 F;
+ Error += glm::all(glm::equal(F, glm::mat2x4(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat2x4 D;
+ Error += glm::all(glm::equal(D, glm::dmat2x4(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x2 F;
+ Error += glm::all(glm::equal(F, glm::mat3x2(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat3x2 D;
+ Error += glm::all(glm::equal(D, glm::dmat3x2(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x3 F;
+ Error += glm::all(glm::equal(F, glm::mat3x3(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat3x3 D;
+ Error += glm::all(glm::equal(D, glm::dmat3x3(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x4 F;
+ Error += glm::all(glm::equal(F, glm::mat3x4(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat3x4 D;
+ Error += glm::all(glm::equal(D, glm::dmat3x4(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x2 F;
+ Error += glm::all(glm::equal(F, glm::mat4x2(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat4x2 D;
+ Error += glm::all(glm::equal(D, glm::dmat4x2(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x3 F;
+ Error += glm::all(glm::equal(F, glm::mat4x3(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat4x3 D;
+ Error += glm::all(glm::equal(D, glm::dmat4x3(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x4 F;
+ Error += glm::all(glm::equal(F, glm::mat4x4(1), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dmat4x4 D;
+ Error += glm::all(glm::equal(D, glm::dmat4x4(1), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_qua()
+{
+ int Error = 0;
+
+ glm::quat F;
+ Error += glm::all(glm::equal(F, glm::quat(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::dquat D;
+ Error += glm::all(glm::equal(D, glm::dquat(1, 0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec();
+ Error += test_mat();
+ Error += test_qua();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_cxx03.cpp b/3rdparty/glm/source/test/core/core_force_cxx03.cpp
new file mode 100644
index 0000000..fc6e9c5
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_cxx03.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_CXX03
+# define GLM_FORCE_CXX03
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_cxx98.cpp b/3rdparty/glm/source/test/core/core_force_cxx98.cpp
new file mode 100644
index 0000000..42a5c25
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_cxx98.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_CXX98
+# define GLM_FORCE_CXX98
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp b/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp
new file mode 100644
index 0000000..62299d6
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_CXX_UNKNOWN
+# define GLM_FORCE_CXX_UNKNOWN
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp b/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp
new file mode 100644
index 0000000..23b3615
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp
@@ -0,0 +1,12 @@
+#define GLM_FORCE_DEPTH_ZERO_TO_ONE
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp b/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp
new file mode 100644
index 0000000..7af5b79
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp
@@ -0,0 +1,17 @@
+#define GLM_FORCE_EXPLICIT_CTOR
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ glm::ivec4 B(1);
+ Error += B == glm::ivec4(1) ? 0 : 1;
+
+ //glm::vec4 A = B;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_inline.cpp b/3rdparty/glm/source/test/core/core_force_inline.cpp
new file mode 100644
index 0000000..cd23fd9
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_inline.cpp
@@ -0,0 +1,12 @@
+#define GLM_FORCE_INLINE
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_left_handed.cpp b/3rdparty/glm/source/test/core/core_force_left_handed.cpp
new file mode 100644
index 0000000..b7ec31b
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_left_handed.cpp
@@ -0,0 +1,12 @@
+#define GLM_FORCE_LEFT_HANDED
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp b/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp
new file mode 100644
index 0000000..fb7fa75
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp
@@ -0,0 +1,14 @@
+#ifndef GLM_FORCE_PLATFORM_UNKNOWN
+# define GLM_FORCE_PLATFORM_UNKNOWN
+#endif
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_pure.cpp b/3rdparty/glm/source/test/core/core_force_pure.cpp
new file mode 100644
index 0000000..a32a4ed
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_pure.cpp
@@ -0,0 +1,434 @@
+#ifndef GLM_FORCE_PURE
+# define GLM_FORCE_PURE
+#endif//GLM_FORCE_PURE
+#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+#define GLM_FORCE_SWIZZLE
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <ctime>
+#include <vector>
+
+static int test_vec4_ctor()
+{
+ int Error = 0;
+
+ {
+ glm::ivec4 A(1, 2, 3, 4);
+ glm::ivec4 B(A);
+ Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ }
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec4>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
+# endif
+
+#if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::vec4 a{ 0, 1, 2, 3 };
+ std::vector<glm::vec4> v = {
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 0, 1}};
+ }
+
+ {
+ glm::dvec4 a{ 0, 1, 2, 3 };
+ std::vector<glm::dvec4> v = {
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 0, 1}};
+ }
+#endif
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A.xyzw;
+ glm::ivec4 C(A.xyzw);
+ glm::ivec4 D(A.xyzw());
+ glm::ivec4 E(A.x, A.yzw);
+ glm::ivec4 F(A.x, A.yzw());
+ glm::ivec4 G(A.xyz, A.w);
+ glm::ivec4 H(A.xyz(), A.w);
+ glm::ivec4 I(A.xy, A.zw);
+ glm::ivec4 J(A.xy(), A.zw());
+ glm::ivec4 K(A.x, A.y, A.zw);
+ glm::ivec4 L(A.x, A.yz, A.w);
+ glm::ivec4 M(A.xy, A.z, A.w);
+
+ Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, I)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, J)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, K)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, L)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, M)) ? 0 : 1;
+ }
+# endif
+
+# if GLM_CONFIG_SWIZZLE
+ {
+ glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A.xyzw();
+ glm::ivec4 C(A.xyzw());
+ glm::ivec4 D(A.xyzw());
+ glm::ivec4 E(A.x, A.yzw());
+ glm::ivec4 F(A.x, A.yzw());
+ glm::ivec4 G(A.xyz(), A.w);
+ glm::ivec4 H(A.xyz(), A.w);
+ glm::ivec4 I(A.xy(), A.zw());
+ glm::ivec4 J(A.xy(), A.zw());
+ glm::ivec4 K(A.x, A.y, A.zw());
+ glm::ivec4 L(A.x, A.yz(), A.w);
+ glm::ivec4 M(A.xy(), A.z, A.w);
+
+ Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, I)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, J)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, K)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, L)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, M)) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE
+
+ {
+ glm::ivec4 A(1);
+ glm::ivec4 B(1, 1, 1, 1);
+
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ std::vector<glm::ivec4> Tests;
+ Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4));
+ Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4));
+ Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4)));
+ Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4));
+ Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4)));
+ Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4)));
+ Tests.push_back(glm::ivec4(1, 2, 3, 4));
+ Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4)));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_bvec4_ctor()
+{
+ int Error = 0;
+
+ glm::bvec4 const A(true);
+ glm::bvec4 const B(true);
+ glm::bvec4 const C(false);
+ glm::bvec4 const D = A && B;
+ glm::bvec4 const E = A && C;
+ glm::bvec4 const F = A || C;
+
+ Error += D == glm::bvec4(true) ? 0 : 1;
+ Error += E == glm::bvec4(false) ? 0 : 1;
+ Error += F == glm::bvec4(true) ? 0 : 1;
+
+ bool const G = A == C;
+ bool const H = A != C;
+
+ Error += !G ? 0 : 1;
+ Error += H ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec4_operators()
+{
+ int Error = 0;
+
+ {
+ glm::ivec4 A(1);
+ glm::ivec4 B(1);
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ glm::vec4 const C = A + B;
+ Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), 0.001f)) ? 0 : 1;
+
+ glm::vec4 D = B - A;
+ Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), 0.001f)) ? 0 : 1;
+
+ glm::vec4 E = A * B;
+ Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), 0.001f)) ? 0 : 1;
+
+ glm::vec4 F = B / A;
+ Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), 0.001f)) ? 0 : 1;
+
+ glm::vec4 G = A + 1.0f;
+ Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1;
+
+ glm::vec4 H = B - 1.0f;
+ Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), 0.001f)) ? 0 : 1;
+
+ glm::vec4 I = A * 2.0f;
+ Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1;
+
+ glm::vec4 J = B / 2.0f;
+ Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), 0.001f)) ? 0 : 1;
+
+ glm::vec4 K = 1.0f + A;
+ Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1;
+
+ glm::vec4 L = 1.0f - B;
+ Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), 0.001f)) ? 0 : 1;
+
+ glm::vec4 M = 2.0f * A;
+ Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1;
+
+ glm::vec4 const N = 2.0f / B;
+ Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ A += B;
+ Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1;
+
+ A += 1;
+ Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ B -= A;
+ Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1;
+
+ B -= 1;
+ Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ A *= B;
+ Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1;
+
+ A *= 2;
+ Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 4.0f, 6.0f, 8.0f);
+
+ B /= A;
+ Error += B == glm::ivec4(4, 2, 2, 2) ? 0 : 1;
+
+ B /= 2;
+ Error += B == glm::ivec4(2, 1, 1, 1) ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(2);
+
+ B /= B.y;
+ Error += B == glm::ivec4(1) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = -A;
+ Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = --A;
+ Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A--;
+ Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1;
+ Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = ++A;
+ Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A++;
+ Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1;
+ Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_vec4_equal()
+{
+ int Error = 0;
+
+ {
+ glm::uvec4 const A(1, 2, 3, 4);
+ glm::uvec4 const B(1, 2, 3, 4);
+ Error += A == B ? 0 : 1;
+ Error += A != B ? 1 : 0;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ glm::ivec4 const B(1, 2, 3, 4);
+ Error += A == B ? 0 : 1;
+ Error += A != B ? 1 : 0;
+ }
+
+ return Error;
+}
+
+static int test_vec4_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1;
+ Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1;
+ Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
+ Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1;
+ Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1;
+ Error += glm::vec4().length() == 4 ? 0 : 1;
+ Error += glm::dvec4().length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec4_swizzle_partial()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+ glm::ivec4 A(1, 2, 3, 4);
+
+ {
+ glm::ivec4 B(A.xy, A.zw);
+ Error += A == B ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(A.xy, 3, 4);
+ Error += A == B ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(1, A.yz, 4);
+ Error += A == B ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(1, 2, A.zw);
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 B(A.xyz, 4);
+ Error += A == B ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(1, A.yzw);
+ Error += A == B ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+static int test_operator_increment()
+{
+ int Error(0);
+
+ glm::ivec4 v0(1);
+ glm::ivec4 v1(v0);
+ glm::ivec4 v2(v0);
+ glm::ivec4 v3 = ++v1;
+ glm::ivec4 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec4_simd()
+{
+ int Error = 0;
+
+ glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock());
+ glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock());
+
+ glm::vec4 const c(b * a);
+ glm::vec4 const d(a + c);
+
+ Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec4_ctor();
+ Error += test_bvec4_ctor();
+ Error += test_vec4_size();
+ Error += test_vec4_operators();
+ Error += test_vec4_equal();
+ Error += test_vec4_swizzle_partial();
+ Error += test_vec4_simd();
+ Error += test_operator_increment();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp b/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp
new file mode 100644
index 0000000..7d5281c
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp
@@ -0,0 +1,13 @@
+#define GLM_FORCE_QUAT_DATA_XYZW
+#define GLM_FORCE_INLINE
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_size_t_length.cpp b/3rdparty/glm/source/test/core/core_force_size_t_length.cpp
new file mode 100644
index 0000000..19dac89
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_size_t_length.cpp
@@ -0,0 +1,12 @@
+#define GLM_FORCE_SIZE_T_LENGTH
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp b/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp
new file mode 100644
index 0000000..21d6e52
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp
@@ -0,0 +1,12 @@
+#define GLM_FORCE_UNRESTRICTED_GENTYPE
+
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp b/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp
new file mode 100644
index 0000000..d19509d
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp
@@ -0,0 +1,58 @@
+#define GLM_FORCE_XYZW_ONLY
+
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+
+static int test_comp()
+{
+ int Error = 0;
+
+ {
+ glm::ivec1 const A(1);
+ Error += A.x == 1 ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 const A(1, 2);
+ Error += A.x == 1 ? 0 : 1;
+ Error += A.y == 2 ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ Error += A.x == 1 ? 0 : 1;
+ Error += A.y == 2 ? 0 : 1;
+ Error += A.z == 3 ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ Error += A.x == 1 ? 0 : 1;
+ Error += A.y == 2 ? 0 : 1;
+ Error += A.z == 3 ? 0 : 1;
+ Error += A.w == 4 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+ int Error = 0;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_func_common.cpp b/3rdparty/glm/source/test/core/core_func_common.cpp
new file mode 100644
index 0000000..b8640de
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_common.cpp
@@ -0,0 +1,1349 @@
+#define GLM_FORCE_EXPLICIT_CTOR
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/random.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/common.hpp>
+#include <glm/vec4.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec2.hpp>
+#include <vector>
+#include <cstdio>
+#include <cmath>
+#include <ctime>
+
+// This file has divisions by zero to test isnan
+#if GLM_COMPILER & GLM_COMPILER_VC
+# pragma warning(disable : 4723)
+#endif
+
+namespace floor_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ float A = 1.1f;
+ float B = glm::floor(A);
+ Error += glm::equal(B, 1.f, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ double A = 1.1;
+ double B = glm::floor(A);
+ Error += glm::equal(B, 1.0, 0.0001) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 A(1.1f);
+ glm::vec1 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::vec1(1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec1 A(1.1);
+ glm::dvec1 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::dvec1(1.0), 0.0001)) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.1f);
+ glm::vec2 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::vec2(1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec2 A(1.1);
+ glm::dvec2 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::dvec2(1.0), 0.0001)) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 A(1.1f);
+ glm::vec3 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::vec3(1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec3 A(1.1);
+ glm::dvec3 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::dvec3(1.0), 0.0001)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A(1.1f);
+ glm::vec4 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::vec4(1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec4 A(1.1);
+ glm::dvec4 B = glm::floor(A);
+
+ Error += glm::all(glm::equal(B, glm::dvec4(1.0), 0.0001)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace floor
+
+namespace modf_
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ float X(1.5f);
+ float I(0.0f);
+ float A = glm::modf(X, I);
+
+ Error += glm::equal(I, 1.0f, 0.0001f) ? 0 : 1;
+ Error += glm::equal(A, 0.5f, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 X(1.1f, 1.2f, 1.5f, 1.7f);
+ glm::vec4 I(0.0f);
+ glm::vec4 A = glm::modf(X, I);
+
+ Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1;
+ Error += glm::all(glm::equal(A, glm::vec4(0.1f, 0.2f, 0.5f, 0.7f), 0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec4 X(1.1, 1.2, 1.5, 1.7);
+ glm::dvec4 I(0.0);
+ glm::dvec4 A = glm::modf(X, I);
+
+ Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1;
+ Error += glm::all(glm::equal(A, glm::dvec4(0.1, 0.2, 0.5, 0.7), 0.000000001)) ? 0 : 1;
+ }
+
+ {
+ double X(1.5);
+ double I(0.0);
+ double A = glm::modf(X, I);
+
+ Error += glm::equal(I, 1.0, 0.0001) ? 0 : 1;
+ Error += glm::equal(A, 0.5, 0.0001) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace modf
+
+namespace mod_
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ float A(1.5f);
+ float B(1.0f);
+ float C = glm::mod(A, B);
+
+ Error += glm::equal(C, 0.5f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ float A(-0.2f);
+ float B(1.0f);
+ float C = glm::mod(A, B);
+
+ Error += glm::equal(C, 0.8f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ float A(3.0);
+ float B(2.0f);
+ float C = glm::mod(A, B);
+
+ Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A(3.0);
+ float B(2.0f);
+ glm::vec4 C = glm::mod(A, B);
+
+ Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A(3.0);
+ glm::vec4 B(2.0f);
+ glm::vec4 C = glm::mod(A, B);
+
+ Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace mod_
+
+namespace floatBitsToInt
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ float A = 1.0f;
+ int B = glm::floatBitsToInt(A);
+ float C = glm::intBitsToFloat(B);
+ Error += glm::equal(A, C, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f, 2.0f);
+ glm::ivec2 B = glm::floatBitsToInt(A);
+ glm::vec2 C = glm::intBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = glm::floatBitsToInt(A);
+ glm::vec3 C = glm::intBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = glm::floatBitsToInt(A);
+ glm::vec4 C = glm::intBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace floatBitsToInt
+
+namespace floatBitsToUint
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ float A = 1.0f;
+ glm::uint B = glm::floatBitsToUint(A);
+ float C = glm::uintBitsToFloat(B);
+ Error += glm::equal(A, C, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f, 2.0f);
+ glm::uvec2 B = glm::floatBitsToUint(A);
+ glm::vec2 C = glm::uintBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 A(1.0f, 2.0f, 3.0f);
+ glm::uvec3 B = glm::floatBitsToUint(A);
+ glm::vec3 C = glm::uintBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::uvec4 B = glm::floatBitsToUint(A);
+ glm::vec4 C = glm::uintBitsToFloat(B);
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace floatBitsToUint
+
+namespace min_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(1));
+ bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon<float>()));
+ Error += A1 ? 0 : 1;
+
+ glm::vec2 B0 = glm::min(glm::vec2(1), glm::vec2(1));
+ glm::vec2 B1 = glm::min(glm::vec2(1), 1.0f);
+ bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon<float>()));
+ Error += B2 ? 0 : 1;
+
+ glm::vec3 C0 = glm::min(glm::vec3(1), glm::vec3(1));
+ glm::vec3 C1 = glm::min(glm::vec3(1), 1.0f);
+ bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon<float>()));
+ Error += C2 ? 0 : 1;
+
+ glm::vec4 D0 = glm::min(glm::vec4(1), glm::vec4(1));
+ glm::vec4 D1 = glm::min(glm::vec4(1), 1.0f);
+ bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon<float>()));
+ Error += D2 ? 0 : 1;
+
+ return Error;
+ }
+
+ int min_tern(int a, int b)
+ {
+ return a < b ? a : b;
+ }
+
+ int min_int(int x, int y)
+ {
+ return y ^ ((x ^ y) & -(x < y));
+ }
+
+ static int perf(std::size_t Count)
+ {
+ std::vector<int> A(Count);
+ std::vector<int> B(Count);
+
+ std::size_t const InternalCount = 200000;
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ A[i] = glm::linearRand(-1000, 1000);
+ B[i] = glm::linearRand(-1000, 1000);
+ }
+
+ int Error = 0;
+
+ glm::int32 SumA = 0;
+ {
+ std::clock_t Timestamp0 = std::clock();
+
+ for (std::size_t j = 0; j < InternalCount; ++j)
+ for (std::size_t i = 0; i < Count; ++i)
+ SumA += min_tern(A[i], B[i]);
+
+ std::clock_t Timestamp1 = std::clock();
+
+ std::printf("min_tern Time %d clocks\n", static_cast<int>(Timestamp1 - Timestamp0));
+ }
+
+ glm::int32 SumB = 0;
+ {
+ std::clock_t Timestamp0 = std::clock();
+
+ for (std::size_t j = 0; j < InternalCount; ++j)
+ for (std::size_t i = 0; i < Count; ++i)
+ SumB += min_int(A[i], B[i]);
+
+ std::clock_t Timestamp1 = std::clock();
+
+ std::printf("min_int Time %d clocks\n", static_cast<int>(Timestamp1 - Timestamp0));
+ }
+
+ Error += SumA == SumB ? 0 : 1;
+
+ return Error;
+ }
+}//namespace min_
+
+namespace max_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(1));
+ bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon<float>()));
+ Error += A1 ? 0 : 1;
+
+
+ glm::vec2 B0 = glm::max(glm::vec2(1), glm::vec2(1));
+ glm::vec2 B1 = glm::max(glm::vec2(1), 1.0f);
+ bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon<float>()));
+ Error += B2 ? 0 : 1;
+
+ glm::vec3 C0 = glm::max(glm::vec3(1), glm::vec3(1));
+ glm::vec3 C1 = glm::max(glm::vec3(1), 1.0f);
+ bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon<float>()));
+ Error += C2 ? 0 : 1;
+
+ glm::vec4 D0 = glm::max(glm::vec4(1), glm::vec4(1));
+ glm::vec4 D1 = glm::max(glm::vec4(1), 1.0f);
+ bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon<float>()));
+ Error += D2 ? 0 : 1;
+
+ return Error;
+ }
+}//namespace max_
+
+namespace clamp_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ return Error;
+ }
+}//namespace clamp_
+
+namespace mix_
+{
+ template<typename T, typename B>
+ struct entry
+ {
+ T x;
+ T y;
+ B a;
+ T Result;
+ };
+
+ entry<float, bool> const TestBool[] =
+ {
+ {0.0f, 1.0f, false, 0.0f},
+ {0.0f, 1.0f, true, 1.0f},
+ {-1.0f, 1.0f, false, -1.0f},
+ {-1.0f, 1.0f, true, 1.0f}
+ };
+
+ entry<float, float> const TestFloat[] =
+ {
+ {0.0f, 1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 1.0f, 1.0f},
+ {-1.0f, 1.0f, 0.0f, -1.0f},
+ {-1.0f, 1.0f, 1.0f, 1.0f}
+ };
+
+ entry<glm::vec2, bool> const TestVec2Bool[] =
+ {
+ {glm::vec2(0.0f), glm::vec2(1.0f), false, glm::vec2(0.0f)},
+ {glm::vec2(0.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)},
+ {glm::vec2(-1.0f), glm::vec2(1.0f), false, glm::vec2(-1.0f)},
+ {glm::vec2(-1.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)}
+ };
+
+ entry<glm::vec2, glm::bvec2> const TestBVec2[] =
+ {
+ {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(0.0f)},
+ {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)},
+ {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(-1.0f)},
+ {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)},
+ {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true, false), glm::vec2(1.0f, -1.0f)}
+ };
+
+ entry<glm::vec3, bool> const TestVec3Bool[] =
+ {
+ {glm::vec3(0.0f), glm::vec3(1.0f), false, glm::vec3(0.0f)},
+ {glm::vec3(0.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)},
+ {glm::vec3(-1.0f), glm::vec3(1.0f), false, glm::vec3(-1.0f)},
+ {glm::vec3(-1.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)}
+ };
+
+ entry<glm::vec3, glm::bvec3> const TestBVec3[] =
+ {
+ {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(0.0f)},
+ {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)},
+ {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(-1.0f)},
+ {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)},
+ {glm::vec3(1.0f, 2.0f, 3.0f), glm::vec3(4.0f, 5.0f, 6.0f), glm::bvec3(true, false, true), glm::vec3(4.0f, 2.0f, 6.0f)}
+ };
+
+ entry<glm::vec4, bool> const TestVec4Bool[] =
+ {
+ {glm::vec4(0.0f), glm::vec4(1.0f), false, glm::vec4(0.0f)},
+ {glm::vec4(0.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)},
+ {glm::vec4(-1.0f), glm::vec4(1.0f), false, glm::vec4(-1.0f)},
+ {glm::vec4(-1.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)}
+ };
+
+ entry<glm::vec4, glm::bvec4> const TestBVec4[] =
+ {
+ {glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), glm::vec4(2.0f, 2.0f, 3.0f, 3.0f), glm::bvec4(false, true, false, true), glm::vec4(0.0f, 2.0f, 1.0f, 3.0f)},
+ {glm::vec4(0.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)},
+ {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(false), glm::vec4(-1.0f)},
+ {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)},
+ {glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(5.0f, 6.0f, 7.0f, 8.0f), glm::bvec4(true, false, true, false), glm::vec4(5.0f, 2.0f, 7.0f, 4.0f)}
+ };
+
+ static int test()
+ {
+ int Error = 0;
+
+ // Float with bool
+ {
+ for(std::size_t i = 0; i < sizeof(TestBool) / sizeof(entry<float, bool>); ++i)
+ {
+ float Result = glm::mix(TestBool[i].x, TestBool[i].y, TestBool[i].a);
+ Error += glm::equal(Result, TestBool[i].Result, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // Float with float
+ {
+ for(std::size_t i = 0; i < sizeof(TestFloat) / sizeof(entry<float, float>); ++i)
+ {
+ float Result = glm::mix(TestFloat[i].x, TestFloat[i].y, TestFloat[i].a);
+ Error += glm::equal(Result, TestFloat[i].Result, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec2 with bool
+ {
+ for(std::size_t i = 0; i < sizeof(TestVec2Bool) / sizeof(entry<glm::vec2, bool>); ++i)
+ {
+ glm::vec2 Result = glm::mix(TestVec2Bool[i].x, TestVec2Bool[i].y, TestVec2Bool[i].a);
+ Error += glm::equal(Result.x, TestVec2Bool[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestVec2Bool[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec2 with bvec2
+ {
+ for(std::size_t i = 0; i < sizeof(TestBVec2) / sizeof(entry<glm::vec2, glm::bvec2>); ++i)
+ {
+ glm::vec2 Result = glm::mix(TestBVec2[i].x, TestBVec2[i].y, TestBVec2[i].a);
+ Error += glm::equal(Result.x, TestBVec2[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestBVec2[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec3 with bool
+ {
+ for(std::size_t i = 0; i < sizeof(TestVec3Bool) / sizeof(entry<glm::vec3, bool>); ++i)
+ {
+ glm::vec3 Result = glm::mix(TestVec3Bool[i].x, TestVec3Bool[i].y, TestVec3Bool[i].a);
+ Error += glm::equal(Result.x, TestVec3Bool[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestVec3Bool[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.z, TestVec3Bool[i].Result.z, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec3 with bvec3
+ {
+ for(std::size_t i = 0; i < sizeof(TestBVec3) / sizeof(entry<glm::vec3, glm::bvec3>); ++i)
+ {
+ glm::vec3 Result = glm::mix(TestBVec3[i].x, TestBVec3[i].y, TestBVec3[i].a);
+ Error += glm::equal(Result.x, TestBVec3[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestBVec3[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.z, TestBVec3[i].Result.z, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec4 with bool
+ {
+ for(std::size_t i = 0; i < sizeof(TestVec4Bool) / sizeof(entry<glm::vec4, bool>); ++i)
+ {
+ glm::vec4 Result = glm::mix(TestVec4Bool[i].x, TestVec4Bool[i].y, TestVec4Bool[i].a);
+ Error += glm::equal(Result.x, TestVec4Bool[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestVec4Bool[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.z, TestVec4Bool[i].Result.z, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.w, TestVec4Bool[i].Result.w, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ // vec4 with bvec4
+ {
+ for(std::size_t i = 0; i < sizeof(TestBVec4) / sizeof(entry<glm::vec4, glm::bvec4>); ++i)
+ {
+ glm::vec4 Result = glm::mix(TestBVec4[i].x, TestBVec4[i].y, TestBVec4[i].a);
+ Error += glm::equal(Result.x, TestBVec4[i].Result.x, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.y, TestBVec4[i].Result.y, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.z, TestBVec4[i].Result.z, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(Result.w, TestBVec4[i].Result.w, glm::epsilon<float>()) ? 0 : 1;
+ }
+ }
+
+ return Error;
+ }
+}//namespace mix_
+
+namespace step_
+{
+ template<typename EDGE, typename VEC>
+ struct entry
+ {
+ EDGE edge;
+ VEC x;
+ VEC result;
+ };
+
+ entry<float, glm::vec4> TestVec4Scalar [] =
+ {
+ { 1.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) },
+ { 0.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) },
+ { 0.0f, glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(0.0f) }
+ };
+
+ entry<glm::vec4, glm::vec4> TestVec4Vector [] =
+ {
+ { glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(-2.0f, -3.0f, -4.0f, -5.0f), glm::vec4(0.0f) },
+ { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) },
+ { glm::vec4( 2.0f, 3.0f, 4.0f, 5.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(0.0f) },
+ { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4(-1.0f,-2.0f,-3.0f,-4.0f), glm::vec4(0.0f) }
+ };
+
+ static int test()
+ {
+ int Error = 0;
+
+ // scalar
+ {
+ float const Edge = 2.0f;
+
+ float const A = glm::step(Edge, 1.0f);
+ Error += glm::equal(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ float const B = glm::step(Edge, 3.0f);
+ Error += glm::equal(B, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ float const C = glm::step(Edge, 2.0f);
+ Error += glm::equal(C, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ // vec4 and float
+ {
+ for (std::size_t i = 0; i < sizeof(TestVec4Scalar) / sizeof(entry<float, glm::vec4>); ++i)
+ {
+ glm::vec4 Result = glm::step(TestVec4Scalar[i].edge, TestVec4Scalar[i].x);
+ Error += glm::all(glm::equal(Result, TestVec4Scalar[i].result, glm::epsilon<float>())) ? 0 : 1;
+ }
+ }
+
+ // vec4 and vec4
+ {
+ for (std::size_t i = 0; i < sizeof(TestVec4Vector) / sizeof(entry<glm::vec4, glm::vec4>); ++i)
+ {
+ glm::vec4 Result = glm::step(TestVec4Vector[i].edge, TestVec4Vector[i].x);
+ Error += glm::all(glm::equal(Result, TestVec4Vector[i].result, glm::epsilon<float>())) ? 0 : 1;
+ }
+ }
+
+ return Error;
+ }
+}//namespace step_
+
+namespace round_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ float A = glm::round(0.0f);
+ Error += glm::equal(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::round(0.5f);
+ Error += glm::equal(B, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::round(1.0f);
+ Error += glm::equal(C, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::round(0.1f);
+ Error += glm::equal(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::round(0.9f);
+ Error += glm::equal(E, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::round(1.5f);
+ Error += glm::equal(F, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::round(1.9f);
+ Error += glm::equal(G, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ float A = glm::round(-0.0f);
+ Error += glm::equal(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::round(-0.5f);
+ Error += glm::equal(B, -1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::round(-1.0f);
+ Error += glm::equal(C, -1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::round(-0.1f);
+ Error += glm::equal(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::round(-0.9f);
+ Error += glm::equal(E, -1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::round(-1.5f);
+ Error += glm::equal(F, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::round(-1.9f);
+ Error += glm::equal(G, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace round_
+
+namespace roundEven
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ float A1 = glm::roundEven(-1.5f);
+ Error += glm::equal(A1, -2.0f, 0.0001f) ? 0 : 1;
+
+ float A2 = glm::roundEven(1.5f);
+ Error += glm::equal(A2, 2.0f, 0.0001f) ? 0 : 1;
+
+ float A5 = glm::roundEven(-2.5f);
+ Error += glm::equal(A5, -2.0f, 0.0001f) ? 0 : 1;
+
+ float A6 = glm::roundEven(2.5f);
+ Error += glm::equal(A6, 2.0f, 0.0001f) ? 0 : 1;
+
+ float A3 = glm::roundEven(-3.5f);
+ Error += glm::equal(A3, -4.0f, 0.0001f) ? 0 : 1;
+
+ float A4 = glm::roundEven(3.5f);
+ Error += glm::equal(A4, 4.0f, 0.0001f) ? 0 : 1;
+
+ float C7 = glm::roundEven(-4.5f);
+ Error += glm::equal(C7, -4.0f, 0.0001f) ? 0 : 1;
+
+ float C8 = glm::roundEven(4.5f);
+ Error += glm::equal(C8, 4.0f, 0.0001f) ? 0 : 1;
+
+ float C1 = glm::roundEven(-5.5f);
+ Error += glm::equal(C1, -6.0f, 0.0001f) ? 0 : 1;
+
+ float C2 = glm::roundEven(5.5f);
+ Error += glm::equal(C2, 6.0f, 0.0001f) ? 0 : 1;
+
+ float C3 = glm::roundEven(-6.5f);
+ Error += glm::equal(C3, -6.0f, 0.0001f) ? 0 : 1;
+
+ float C4 = glm::roundEven(6.5f);
+ Error += glm::equal(C4, 6.0f, 0.0001f) ? 0 : 1;
+
+ float C5 = glm::roundEven(-7.5f);
+ Error += glm::equal(C5, -8.0f, 0.0001f) ? 0 : 1;
+
+ float C6 = glm::roundEven(7.5f);
+ Error += glm::equal(C6, 8.0f, 0.0001f) ? 0 : 1;
+
+ Error += 0;
+ }
+
+ {
+ float A7 = glm::roundEven(-2.4f);
+ Error += glm::equal(A7, -2.0f, 0.0001f) ? 0 : 1;
+
+ float A8 = glm::roundEven(2.4f);
+ Error += glm::equal(A8, 2.0f, 0.0001f) ? 0 : 1;
+
+ float B1 = glm::roundEven(-2.6f);
+ Error += glm::equal(B1, -3.0f, 0.0001f) ? 0 : 1;
+
+ float B2 = glm::roundEven(2.6f);
+ Error += glm::equal(B2, 3.0f, 0.0001f) ? 0 : 1;
+
+ float B3 = glm::roundEven(-2.0f);
+ Error += glm::equal(B3, -2.0f, 0.0001f) ? 0 : 1;
+
+ float B4 = glm::roundEven(2.0f);
+ Error += glm::equal(B4, 2.0f, 0.0001f) ? 0 : 1;
+
+ Error += 0;
+ }
+
+ {
+ float A = glm::roundEven(0.0f);
+ Error += glm::equal(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::roundEven(0.5f);
+ Error += glm::equal(B, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::roundEven(1.0f);
+ Error += glm::equal(C, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::roundEven(0.1f);
+ Error += glm::equal(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::roundEven(0.9f);
+ Error += glm::equal(E, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::roundEven(1.5f);
+ Error += glm::equal(F, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::roundEven(1.9f);
+ Error += glm::equal(G, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ float A = glm::roundEven(-0.0f);
+ Error += glm::equal(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::roundEven(-0.5f);
+ Error += glm::equal(B, -0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::roundEven(-1.0f);
+ Error += glm::equal(C, -1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::roundEven(-0.1f);
+ Error += glm::equal(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::roundEven(-0.9f);
+ Error += glm::equal(E, -1.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::roundEven(-1.5f);
+ Error += glm::equal(F, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::roundEven(-1.9f);
+ Error += glm::equal(G, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ float A = glm::roundEven(1.5f);
+ Error += glm::equal(A, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::roundEven(2.5f);
+ Error += glm::equal(B, 2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::roundEven(3.5f);
+ Error += glm::equal(C, 4.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::roundEven(4.5f);
+ Error += glm::equal(D, 4.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::roundEven(5.5f);
+ Error += glm::equal(E, 6.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::roundEven(6.5f);
+ Error += glm::equal(F, 6.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::roundEven(7.5f);
+ Error += glm::equal(G, 8.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ float A = glm::roundEven(-1.5f);
+ Error += glm::equal(A, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float B = glm::roundEven(-2.5f);
+ Error += glm::equal(B, -2.0f, glm::epsilon<float>()) ? 0 : 1;
+ float C = glm::roundEven(-3.5f);
+ Error += glm::equal(C, -4.0f, glm::epsilon<float>()) ? 0 : 1;
+ float D = glm::roundEven(-4.5f);
+ Error += glm::equal(D, -4.0f, glm::epsilon<float>()) ? 0 : 1;
+ float E = glm::roundEven(-5.5f);
+ Error += glm::equal(E, -6.0f, glm::epsilon<float>()) ? 0 : 1;
+ float F = glm::roundEven(-6.5f);
+ Error += glm::equal(F, -6.0f, glm::epsilon<float>()) ? 0 : 1;
+ float G = glm::roundEven(-7.5f);
+ Error += glm::equal(G, -8.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace roundEven
+
+namespace isnan_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ float Zero_f = 0.0;
+ double Zero_d = 0.0;
+
+ {
+ Error += true == glm::isnan(0.0/Zero_d) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::dvec2(0.0 / Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::dvec3(0.0 / Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::dvec4(0.0 / Zero_d))) ? 0 : 1;
+ }
+
+ {
+ Error += true == glm::isnan(0.0f/Zero_f) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::vec2(0.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace isnan_
+
+namespace isinf_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ float Zero_f = 0.0;
+ double Zero_d = 0.0;
+
+ {
+ Error += true == glm::isinf( 1.0/Zero_d) ? 0 : 1;
+ Error += true == glm::isinf(-1.0/Zero_d) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec2( 1.0/Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec2(-1.0/Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec3( 1.0/Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec3(-1.0/Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec4( 1.0/Zero_d))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::dvec4(-1.0/Zero_d))) ? 0 : 1;
+ }
+
+ {
+ Error += true == glm::isinf( 1.0f/Zero_f) ? 0 : 1;
+ Error += true == glm::isinf(-1.0f/Zero_f) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec2( 1.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec2(-1.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec3( 1.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec3(-1.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec4( 1.0f/Zero_f))) ? 0 : 1;
+ Error += true == glm::any(glm::isinf(glm::vec4(-1.0f/Zero_f))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace isinf_
+
+namespace sign
+{
+ template<typename genFIType>
+ GLM_FUNC_QUALIFIER genFIType sign_if(genFIType x)
+ {
+ GLM_STATIC_ASSERT(
+ std::numeric_limits<genFIType>::is_iec559 ||
+ (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), "'sign' only accept signed inputs");
+
+ genFIType result;
+ if(x > genFIType(0))
+ result = genFIType(1);
+ else if(x < genFIType(0))
+ result = genFIType(-1);
+ else
+ result = genFIType(0);
+ return result;
+ }
+
+ template<typename genFIType>
+ GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x)
+ {
+ GLM_STATIC_ASSERT(
+ std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
+ "'sign' only accept integer inputs");
+
+ return (x >> 31) | (static_cast<unsigned>(-x) >> 31);
+ }
+
+ GLM_FUNC_QUALIFIER int sign_alu2(int x)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
+
+# if GLM_COMPILER & GLM_COMPILER_VC
+# pragma warning(push)
+# pragma warning(disable : 4146) //cast truncates constant value
+# endif
+
+ return -(static_cast<unsigned>(x) >> 31) | (-static_cast<unsigned>(x) >> 31);
+
+# if GLM_COMPILER & GLM_COMPILER_VC
+# pragma warning(pop)
+# endif
+ }
+
+ template<typename genFIType>
+ GLM_FUNC_QUALIFIER genFIType sign_sub(genFIType x)
+ {
+ GLM_STATIC_ASSERT(
+ std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
+ "'sign' only accept integer inputs");
+
+ return (static_cast<unsigned>(-x) >> 31) - (static_cast<unsigned>(x) >> 31);
+ }
+
+ template<typename genFIType>
+ GLM_FUNC_QUALIFIER genFIType sign_cmp(genFIType x)
+ {
+ GLM_STATIC_ASSERT(
+ std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
+ "'sign' only accept integer inputs");
+
+ return (x > 0) - (x < 0);
+ }
+
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ };
+
+ int test_int32()
+ {
+ type<glm::int32> const Data[] =
+ {
+ { std::numeric_limits<glm::int32>::max(), 1},
+ { std::numeric_limits<glm::int32>::min(), -1},
+ { 0, 0},
+ { 1, 1},
+ { 2, 1},
+ { 3, 1},
+ {-1,-1},
+ {-2,-1},
+ {-3,-1}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::int32>); ++i)
+ {
+ glm::int32 Result = glm::sign(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::int32>); ++i)
+ {
+ glm::int32 Result = sign_cmp(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::int32>); ++i)
+ {
+ glm::int32 Result = sign_if(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::int32>); ++i)
+ {
+ glm::int32 Result = sign_alu1(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::int32>); ++i)
+ {
+ glm::int32 Result = sign_alu2(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_i32vec4()
+ {
+ type<glm::ivec4> const Data[] =
+ {
+ {glm::ivec4( 1), glm::ivec4( 1)},
+ {glm::ivec4( 0), glm::ivec4( 0)},
+ {glm::ivec4( 2), glm::ivec4( 1)},
+ {glm::ivec4( 3), glm::ivec4( 1)},
+ {glm::ivec4(-1), glm::ivec4(-1)},
+ {glm::ivec4(-2), glm::ivec4(-1)},
+ {glm::ivec4(-3), glm::ivec4(-1)}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::ivec4>); ++i)
+ {
+ glm::ivec4 Result = glm::sign(Data[i].Value);
+ Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_f32vec4()
+ {
+ type<glm::vec4> const Data[] =
+ {
+ {glm::vec4( 1), glm::vec4( 1)},
+ {glm::vec4( 0), glm::vec4( 0)},
+ {glm::vec4( 2), glm::vec4( 1)},
+ {glm::vec4( 3), glm::vec4( 1)},
+ {glm::vec4(-1), glm::vec4(-1)},
+ {glm::vec4(-2), glm::vec4(-1)},
+ {glm::vec4(-3), glm::vec4(-1)}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::vec4>); ++i)
+ {
+ glm::vec4 Result = glm::sign(Data[i].Value);
+ Error += glm::all(glm::equal(Data[i].Return, Result, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ static int test()
+ {
+ int Error = 0;
+
+ Error += test_int32();
+ Error += test_i32vec4();
+ Error += test_f32vec4();
+
+ return Error;
+ }
+
+ int perf_rand(std::size_t Samples)
+ {
+ int Error = 0;
+
+ std::size_t const Count = Samples;
+ std::vector<glm::int32> Input, Output;
+ Input.resize(Count);
+ Output.resize(Count);
+ for(std::size_t i = 0; i < Count; ++i)
+ Input[i] = static_cast<glm::int32>(glm::linearRand(-65536.f, 65536.f));
+
+ std::clock_t Timestamp0 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_cmp(Input[i]);
+
+ std::clock_t Timestamp1 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_if(Input[i]);
+
+ std::clock_t Timestamp2 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_alu1(Input[i]);
+
+ std::clock_t Timestamp3 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_alu2(Input[i]);
+
+ std::clock_t Timestamp4 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_sub(Input[i]);
+
+ std::clock_t Timestamp5 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = glm::sign(Input[i]);
+
+ std::clock_t Timestamp6 = std::clock();
+
+ std::printf("sign_cmp(rand) Time %d clocks\n", static_cast<int>(Timestamp1 - Timestamp0));
+ std::printf("sign_if(rand) Time %d clocks\n", static_cast<int>(Timestamp2 - Timestamp1));
+ std::printf("sign_alu1(rand) Time %d clocks\n", static_cast<int>(Timestamp3 - Timestamp2));
+ std::printf("sign_alu2(rand) Time %d clocks\n", static_cast<int>(Timestamp4 - Timestamp3));
+ std::printf("sign_sub(rand) Time %d clocks\n", static_cast<int>(Timestamp5 - Timestamp4));
+ std::printf("glm::sign(rand) Time %d clocks\n", static_cast<int>(Timestamp6 - Timestamp5));
+
+ return Error;
+ }
+
+ int perf_linear(std::size_t Samples)
+ {
+ int Error = 0;
+
+ std::size_t const Count = Samples;
+ std::vector<glm::int32> Input, Output;
+ Input.resize(Count);
+ Output.resize(Count);
+ for(std::size_t i = 0; i < Count; ++i)
+ Input[i] = static_cast<glm::int32>(i);
+
+ std::clock_t Timestamp0 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_cmp(Input[i]);
+
+ std::clock_t Timestamp1 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_if(Input[i]);
+
+ std::clock_t Timestamp2 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_alu1(Input[i]);
+
+ std::clock_t Timestamp3 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_alu2(Input[i]);
+
+ std::clock_t Timestamp4 = std::clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Output[i] = sign_sub(Input[i]);
+
+ std::clock_t Timestamp5 = std::clock();
+
+ std::printf("sign_cmp(linear) Time %d clocks\n", static_cast<int>(Timestamp1 - Timestamp0));
+ std::printf("sign_if(linear) Time %d clocks\n", static_cast<int>(Timestamp2 - Timestamp1));
+ std::printf("sign_alu1(linear) Time %d clocks\n", static_cast<int>(Timestamp3 - Timestamp2));
+ std::printf("sign_alu2(linear) Time %d clocks\n", static_cast<int>(Timestamp4 - Timestamp3));
+ std::printf("sign_sub(linear) Time %d clocks\n", static_cast<int>(Timestamp5 - Timestamp4));
+
+ return Error;
+ }
+
+ int perf_linear_cal(std::size_t Samples)
+ {
+ int Error = 0;
+
+ glm::int32 const Count = static_cast<glm::int32>(Samples);
+
+ std::clock_t Timestamp0 = std::clock();
+ glm::int32 Sum = 0;
+
+ for(glm::int32 i = 1; i < Count; ++i)
+ Sum += sign_cmp(i);
+
+ std::clock_t Timestamp1 = std::clock();
+
+ for(glm::int32 i = 1; i < Count; ++i)
+ Sum += sign_if(i);
+
+ std::clock_t Timestamp2 = std::clock();
+
+ for(glm::int32 i = 1; i < Count; ++i)
+ Sum += sign_alu1(i);
+
+ std::clock_t Timestamp3 = std::clock();
+
+ for(glm::int32 i = 1; i < Count; ++i)
+ Sum += sign_alu2(i);
+
+ std::clock_t Timestamp4 = std::clock();
+
+ for(glm::int32 i = 1; i < Count; ++i)
+ Sum += sign_sub(i);
+
+ std::clock_t Timestamp5 = std::clock();
+
+ std::printf("Sum %d\n", static_cast<int>(Sum));
+
+ std::printf("sign_cmp(linear_cal) Time %d clocks\n", static_cast<int>(Timestamp1 - Timestamp0));
+ std::printf("sign_if(linear_cal) Time %d clocks\n", static_cast<int>(Timestamp2 - Timestamp1));
+ std::printf("sign_alu1(linear_cal) Time %d clocks\n", static_cast<int>(Timestamp3 - Timestamp2));
+ std::printf("sign_alu2(linear_cal) Time %d clocks\n", static_cast<int>(Timestamp4 - Timestamp3));
+ std::printf("sign_sub(linear_cal) Time %d clocks\n", static_cast<int>(Timestamp5 - Timestamp4));
+
+ return Error;
+ }
+
+ static int perf(std::size_t Samples)
+ {
+ int Error(0);
+
+ Error += perf_linear_cal(Samples);
+ Error += perf_linear(Samples);
+ Error += perf_rand(Samples);
+
+ return Error;
+ }
+}//namespace sign
+
+namespace frexp_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ {
+ glm::vec1 const x(1024);
+ glm::ivec1 exp;
+ glm::vec1 A = glm::frexp(x, exp);
+ Error += glm::all(glm::equal(A, glm::vec1(0.5), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(exp, glm::ivec1(11))) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 const x(1024, 0.24);
+ glm::ivec2 exp;
+ glm::vec2 A = glm::frexp(x, exp);
+ Error += glm::all(glm::equal(A, glm::vec2(0.5, 0.96), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(exp, glm::ivec2(11, -2))) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 const x(1024, 0.24, 0);
+ glm::ivec3 exp;
+ glm::vec3 A = glm::frexp(x, exp);
+ Error += glm::all(glm::equal(A, glm::vec3(0.5, 0.96, 0.0), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(exp, glm::ivec3(11, -2, 0))) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const x(1024, 0.24, 0, -1.33);
+ glm::ivec4 exp;
+ glm::vec4 A = glm::frexp(x, exp);
+ Error += glm::all(glm::equal(A, glm::vec4(0.5, 0.96, 0.0, -0.665), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace frexp_
+
+namespace ldexp_
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ glm::vec1 A = glm::vec1(0.5);
+ glm::ivec1 exp = glm::ivec1(11);
+ glm::vec1 x = glm::ldexp(A, exp);
+ Error += glm::all(glm::equal(x, glm::vec1(1024),0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A = glm::vec2(0.5, 0.96);
+ glm::ivec2 exp = glm::ivec2(11, -2);
+ glm::vec2 x = glm::ldexp(A, exp);
+ Error += glm::all(glm::equal(x, glm::vec2(1024, .24),0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 A = glm::vec3(0.5, 0.96, 0.0);
+ glm::ivec3 exp = glm::ivec3(11, -2, 0);
+ glm::vec3 x = glm::ldexp(A, exp);
+ Error += glm::all(glm::equal(x, glm::vec3(1024, .24, 0),0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A = glm::vec4(0.5, 0.96, 0.0, -0.665);
+ glm::ivec4 exp = glm::ivec4(11, -2, 0, 1);
+ glm::vec4 x = glm::ldexp(A, exp);
+ Error += glm::all(glm::equal(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace ldexp_
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::abs(1.0f) > 0.0f, "GLM: Failed constexpr");
+ constexpr glm::vec1 const A = glm::abs(glm::vec1(1.0f));
+ constexpr glm::vec2 const B = glm::abs(glm::vec2(1.0f));
+ constexpr glm::vec3 const C = glm::abs(glm::vec3(1.0f));
+ constexpr glm::vec4 const D = glm::abs(glm::vec4(1.0f));
+#endif // GLM_HAS_CONSTEXPR
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_constexpr();
+ Error += sign::test();
+ Error += floor_::test();
+ Error += mod_::test();
+ Error += modf_::test();
+ Error += floatBitsToInt::test();
+ Error += floatBitsToUint::test();
+ Error += mix_::test();
+ Error += step_::test();
+ Error += max_::test();
+ Error += min_::test();
+ Error += clamp_::test();
+ Error += round_::test();
+ Error += roundEven::test();
+ Error += isnan_::test();
+ Error += isinf_::test();
+ Error += frexp_::test();
+ Error += ldexp_::test();
+
+# ifdef NDEBUG
+ std::size_t Samples = 1000;
+# else
+ std::size_t Samples = 1;
+# endif
+ Error += sign::perf(Samples);
+
+ Error += min_::perf(Samples);
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_exponential.cpp b/3rdparty/glm/source/test/core/core_func_exponential.cpp
new file mode 100644
index 0000000..380cdfb
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_exponential.cpp
@@ -0,0 +1,185 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/common.hpp>
+#include <glm/exponential.hpp>
+
+static int test_pow()
+{
+ int Error(0);
+
+ float A = glm::pow(2.f, 2.f);
+ Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::pow(glm::vec1(2.f), glm::vec1(2.f));
+ Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::pow(glm::vec2(2.f), glm::vec2(2.f));
+ Error += glm::all(glm::equal(C, glm::vec2(4.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::pow(glm::vec3(2.f), glm::vec3(2.f));
+ Error += glm::all(glm::equal(D, glm::vec3(4.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::pow(glm::vec4(2.f), glm::vec4(2.f));
+ Error += glm::all(glm::equal(E, glm::vec4(4.f), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_sqrt()
+{
+ int Error = 0;
+
+ float A = glm::sqrt(4.f);
+ Error += glm::equal(A, 2.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::sqrt(glm::vec1(4.f));
+ Error += glm::all(glm::equal(B, glm::vec1(2.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::sqrt(glm::vec2(4.f));
+ Error += glm::all(glm::equal(C, glm::vec2(2.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::sqrt(glm::vec3(4.f));
+ Error += glm::all(glm::equal(D, glm::vec3(2.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::sqrt(glm::vec4(4.f));
+ Error += glm::all(glm::equal(E, glm::vec4(2.f), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_exp()
+{
+ int Error = 0;
+
+ float A = glm::exp(1.f);
+ Error += glm::equal(A, glm::e<float>(), 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::exp(glm::vec1(1.f));
+ Error += glm::all(glm::equal(B, glm::vec1(glm::e<float>()), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::exp(glm::vec2(1.f));
+ Error += glm::all(glm::equal(C, glm::vec2(glm::e<float>()), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::exp(glm::vec3(1.f));
+ Error += glm::all(glm::equal(D, glm::vec3(glm::e<float>()), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::exp(glm::vec4(1.f));
+ Error += glm::all(glm::equal(E, glm::vec4(glm::e<float>()), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_log()
+{
+ int Error = 0;
+
+ float const A = glm::log(glm::e<float>());
+ Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 const B = glm::log(glm::vec1(glm::e<float>()));
+ Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 const C = glm::log(glm::vec2(glm::e<float>()));
+ Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 const D = glm::log(glm::vec3(glm::e<float>()));
+ Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 const E = glm::log(glm::vec4(glm::e<float>()));
+ Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_exp2()
+{
+ int Error = 0;
+
+ float A = glm::exp2(4.f);
+ Error += glm::equal(A, 16.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::exp2(glm::vec1(4.f));
+ Error += glm::all(glm::equal(B, glm::vec1(16.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::exp2(glm::vec2(4.f, 3.f));
+ Error += glm::all(glm::equal(C, glm::vec2(16.f, 8.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::exp2(glm::vec3(4.f, 3.f, 2.f));
+ Error += glm::all(glm::equal(D, glm::vec3(16.f, 8.f, 4.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::exp2(glm::vec4(4.f, 3.f, 2.f, 1.f));
+ Error += glm::all(glm::equal(E, glm::vec4(16.f, 8.f, 4.f, 2.f), 0.01f)) ? 0 : 1;
+
+# if GLM_HAS_CXX11_STL
+ //large exponent
+ float F = glm::exp2(23.f);
+ Error += glm::equal(F, 8388608.f, 0.01f) ? 0 : 1;
+# endif
+
+ return Error;
+}
+
+static int test_log2()
+{
+ int Error = 0;
+
+ float A = glm::log2(16.f);
+ Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::log2(glm::vec1(16.f));
+ Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::log2(glm::vec2(16.f, 8.f));
+ Error += glm::all(glm::equal(C, glm::vec2(4.f, 3.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::log2(glm::vec3(16.f, 8.f, 4.f));
+ Error += glm::all(glm::equal(D, glm::vec3(4.f, 3.f, 2.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::log2(glm::vec4(16.f, 8.f, 4.f, 2.f));
+ Error += glm::all(glm::equal(E, glm::vec4(4.f, 3.f, 2.f, 1.f), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_inversesqrt()
+{
+ int Error = 0;
+
+ float A = glm::inversesqrt(16.f) * glm::sqrt(16.f);
+ Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1;
+
+ glm::vec1 B = glm::inversesqrt(glm::vec1(16.f)) * glm::sqrt(16.f);
+ Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec2 C = glm::inversesqrt(glm::vec2(16.f)) * glm::sqrt(16.f);
+ Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec3 D = glm::inversesqrt(glm::vec3(16.f)) * glm::sqrt(16.f);
+ Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1;
+
+ glm::vec4 E = glm::inversesqrt(glm::vec4(16.f)) * glm::sqrt(16.f);
+ Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_pow();
+ Error += test_sqrt();
+ Error += test_exp();
+ Error += test_log();
+ Error += test_exp2();
+ Error += test_log2();
+ Error += test_inversesqrt();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_geometric.cpp b/3rdparty/glm/source/test/core/core_func_geometric.cpp
new file mode 100644
index 0000000..7ef9c68
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_geometric.cpp
@@ -0,0 +1,200 @@
+#include <glm/geometric.hpp>
+#include <glm/trigonometric.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_double2.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <limits>
+
+namespace length
+{
+ int test()
+ {
+ float Length1 = glm::length(glm::vec1(1));
+ float Length2 = glm::length(glm::vec2(1, 0));
+ float Length3 = glm::length(glm::vec3(1, 0, 0));
+ float Length4 = glm::length(glm::vec4(1, 0, 0, 0));
+
+ int Error = 0;
+
+ Error += glm::abs(Length1 - 1.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Length2 - 1.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Length3 - 1.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Length4 - 1.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+
+ return Error;
+ }
+}//namespace length
+
+namespace distance
+{
+ int test()
+ {
+ float Distance1 = glm::distance(glm::vec1(1), glm::vec1(1));
+ float Distance2 = glm::distance(glm::vec2(1, 0), glm::vec2(1, 0));
+ float Distance3 = glm::distance(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0));
+ float Distance4 = glm::distance(glm::vec4(1, 0, 0, 0), glm::vec4(1, 0, 0, 0));
+
+ int Error = 0;
+
+ Error += glm::abs(Distance1) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Distance2) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Distance3) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Distance4) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+
+ return Error;
+ }
+}//namespace distance
+
+namespace dot
+{
+ int test()
+ {
+ float Dot1 = glm::dot(glm::vec1(1), glm::vec1(1));
+ float Dot2 = glm::dot(glm::vec2(1), glm::vec2(1));
+ float Dot3 = glm::dot(glm::vec3(1), glm::vec3(1));
+ float Dot4 = glm::dot(glm::vec4(1), glm::vec4(1));
+
+ int Error = 0;
+
+ Error += glm::abs(Dot1 - 1.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Dot2 - 2.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Dot3 - 3.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += glm::abs(Dot4 - 4.0f) < std::numeric_limits<float>::epsilon() ? 0 : 1;
+
+ return Error;
+ }
+}//namespace dot
+
+namespace cross
+{
+ int test()
+ {
+ glm::vec3 Cross1 = glm::cross(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0));
+ glm::vec3 Cross2 = glm::cross(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0));
+
+ int Error = 0;
+
+ Error += glm::all(glm::lessThan(glm::abs(Cross1 - glm::vec3(0, 0, 1)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
+ Error += glm::all(glm::lessThan(glm::abs(Cross2 - glm::vec3(0, 0,-1)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace cross
+
+namespace normalize
+{
+ int test()
+ {
+ glm::vec3 Normalize1 = glm::normalize(glm::vec3(1, 0, 0));
+ glm::vec3 Normalize2 = glm::normalize(glm::vec3(2, 0, 0));
+
+ glm::vec3 Normalize3 = glm::normalize(glm::vec3(-0.6, 0.7, -0.5));
+
+ glm::vec3 ro = glm::vec3(glm::cos(5.f) * 3.f, 2.f, glm::sin(5.f) * 3.f);
+ glm::vec3 w = glm::normalize(glm::vec3(0, -0.2f, 0) - ro);
+ glm::vec3 u = glm::normalize(glm::cross(w, glm::vec3(0, 1, 0)));
+ glm::vec3 v = glm::cross(u, w);
+
+ int Error = 0;
+
+ Error += glm::all(glm::lessThan(glm::abs(Normalize1 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
+ Error += glm::all(glm::lessThan(glm::abs(Normalize2 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace normalize
+
+namespace faceforward
+{
+ int test()
+ {
+ int Error = 0;
+
+ {
+ glm::vec3 N(0.0f, 0.0f, 1.0f);
+ glm::vec3 I(1.0f, 0.0f, 1.0f);
+ glm::vec3 Nref(0.0f, 0.0f, 1.0f);
+ glm::vec3 F = glm::faceforward(N, I, Nref);
+ }
+
+ return Error;
+ }
+}//namespace faceforward
+
+namespace reflect
+{
+ int test()
+ {
+ int Error = 0;
+
+ {
+ glm::vec2 A(1.0f,-1.0f);
+ glm::vec2 B(0.0f, 1.0f);
+ glm::vec2 C = glm::reflect(A, B);
+ Error += glm::all(glm::equal(C, glm::vec2(1.0, 1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec2 A(1.0f,-1.0f);
+ glm::dvec2 B(0.0f, 1.0f);
+ glm::dvec2 C = glm::reflect(A, B);
+ Error += glm::all(glm::equal(C, glm::dvec2(1.0, 1.0), 0.0001)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace reflect
+
+namespace refract
+{
+ int test()
+ {
+ int Error = 0;
+
+ {
+ float A(-1.0f);
+ float B(1.0f);
+ float C = glm::refract(A, B, 0.5f);
+ Error += glm::equal(C, -1.0f, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(0.0f,-1.0f);
+ glm::vec2 B(0.0f, 1.0f);
+ glm::vec2 C = glm::refract(A, B, 0.5f);
+ Error += glm::all(glm::equal(C, glm::vec2(0.0, -1.0), 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dvec2 A(0.0f,-1.0f);
+ glm::dvec2 B(0.0f, 1.0f);
+ glm::dvec2 C = glm::refract(A, B, 0.5);
+ Error += glm::all(glm::equal(C, glm::dvec2(0.0, -1.0), 0.0001)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace refract
+
+int main()
+{
+ int Error(0);
+
+ Error += length::test();
+ Error += distance::test();
+ Error += dot::test();
+ Error += cross::test();
+ Error += normalize::test();
+ Error += faceforward::test();
+ Error += reflect::test();
+ Error += refract::test();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_integer.cpp b/3rdparty/glm/source/test/core/core_func_integer.cpp
new file mode 100644
index 0000000..95d650c
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_integer.cpp
@@ -0,0 +1,1556 @@
+#include <glm/integer.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/ext/vector_int1.hpp>
+#include <glm/ext/vector_int2.hpp>
+#include <glm/ext/vector_int3.hpp>
+#include <glm/ext/vector_int4.hpp>
+#include <glm/ext/vector_uint1.hpp>
+#include <glm/ext/vector_uint2.hpp>
+#include <glm/ext/vector_uint3.hpp>
+#include <glm/ext/vector_uint4.hpp>
+#include <glm/ext/scalar_int_sized.hpp>
+#include <glm/ext/scalar_uint_sized.hpp>
+#include <vector>
+#include <ctime>
+#include <cstdio>
+
+enum result
+{
+ SUCCESS,
+ FAIL,
+ ASSERT,
+ STATIC_ASSERT
+};
+
+namespace bitfieldInsert
+{
+ template<typename genType>
+ struct type
+ {
+ genType Base;
+ genType Insert;
+ int Offset;
+ int Bits;
+ genType Return;
+ };
+
+ typedef type<glm::uint> typeU32;
+
+ typeU32 const Data32[] =
+ {
+ {0x00000000, 0xffffffff, 0, 32, 0xffffffff},
+ {0x00000000, 0xffffffff, 0, 31, 0x7fffffff},
+ {0x00000000, 0xffffffff, 0, 0, 0x00000000},
+ {0xff000000, 0x000000ff, 8, 8, 0xff00ff00},
+ {0xffff0000, 0xffff0000, 16, 16, 0x00000000},
+ {0x0000ffff, 0x0000ffff, 16, 16, 0xffffffff}
+ };
+
+ static int test()
+ {
+ int Error = 0;
+ glm::uint count = sizeof(Data32) / sizeof(typeU32);
+
+ for(glm::uint i = 0; i < count; ++i)
+ {
+ glm::uint Return = glm::bitfieldInsert(
+ Data32[i].Base,
+ Data32[i].Insert,
+ Data32[i].Offset,
+ Data32[i].Bits);
+
+ Error += Data32[i].Return == Return ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//bitfieldInsert
+
+namespace bitfieldExtract
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ int Offset;
+ int Bits;
+ genType Return;
+ result Result;
+ };
+
+ typedef type<glm::uint> typeU32;
+
+ typeU32 const Data32[] =
+ {
+ {0xffffffff, 0,32, 0xffffffff, SUCCESS},
+ {0xffffffff, 8, 0, 0x00000000, SUCCESS},
+ {0x00000000, 0,32, 0x00000000, SUCCESS},
+ {0x0f0f0f0f, 0,32, 0x0f0f0f0f, SUCCESS},
+ {0x00000000, 8, 0, 0x00000000, SUCCESS},
+ {0x80000000,31, 1, 0x00000001, SUCCESS},
+ {0x7fffffff,31, 1, 0x00000000, SUCCESS},
+ {0x00000300, 8, 8, 0x00000003, SUCCESS},
+ {0x0000ff00, 8, 8, 0x000000ff, SUCCESS},
+ {0xfffffff0, 0, 5, 0x00000010, SUCCESS},
+ {0x000000ff, 1, 3, 0x00000007, SUCCESS},
+ {0x000000ff, 0, 3, 0x00000007, SUCCESS},
+ {0x00000000, 0, 2, 0x00000000, SUCCESS},
+ {0xffffffff, 0, 8, 0x000000ff, SUCCESS},
+ {0xffff0000,16,16, 0x0000ffff, SUCCESS},
+ {0xfffffff0, 0, 8, 0x00000000, FAIL},
+ {0xffffffff,16,16, 0x00000000, FAIL},
+ //{0xffffffff,32, 1, 0x00000000, ASSERT}, // Throw an assert
+ //{0xffffffff, 0,33, 0x00000000, ASSERT}, // Throw an assert
+ //{0xffffffff,16,16, 0x00000000, ASSERT}, // Throw an assert
+ };
+
+ static int test()
+ {
+ int Error = 0;
+
+ glm::uint count = sizeof(Data32) / sizeof(typeU32);
+
+ for(glm::uint i = 0; i < count; ++i)
+ {
+ glm::uint Return = glm::bitfieldExtract(
+ Data32[i].Value,
+ Data32[i].Offset,
+ Data32[i].Bits);
+
+ bool Compare = Data32[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS && Compare)
+ continue;
+ else if(Data32[i].Result == FAIL && !Compare)
+ continue;
+
+ Error += 1;
+ }
+
+ return Error;
+ }
+}//extractField
+
+namespace bitfieldReverse
+{
+/*
+ GLM_FUNC_QUALIFIER unsigned int bitfieldReverseLoop(unsigned int v)
+ {
+ unsigned int Result(0);
+ unsigned int const BitSize = static_cast<unsigned int>(sizeof(unsigned int) * 8);
+ for(unsigned int i = 0; i < BitSize; ++i)
+ {
+ unsigned int const BitSet(v & (static_cast<unsigned int>(1) << i));
+ unsigned int const BitFirst(BitSet >> i);
+ Result |= BitFirst << (BitSize - 1 - i);
+ }
+ return Result;
+ }
+
+ GLM_FUNC_QUALIFIER glm::uint64_t bitfieldReverseLoop(glm::uint64_t v)
+ {
+ glm::uint64_t Result(0);
+ glm::uint64_t const BitSize = static_cast<glm::uint64_t>(sizeof(unsigned int) * 8);
+ for(glm::uint64_t i = 0; i < BitSize; ++i)
+ {
+ glm::uint64_t const BitSet(v & (static_cast<glm::uint64_t>(1) << i));
+ glm::uint64_t const BitFirst(BitSet >> i);
+ Result |= BitFirst << (BitSize - 1 - i);
+ }
+ return Result;
+ }
+*/
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> bitfieldReverseLoop(glm::vec<L, T, Q> const& v)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
+
+ glm::vec<L, T, Q> Result(0);
+ T const BitSize = static_cast<T>(sizeof(T) * 8);
+ for(T i = 0; i < BitSize; ++i)
+ {
+ glm::vec<L, T, Q> const BitSet(v & (static_cast<T>(1) << i));
+ glm::vec<L, T, Q> const BitFirst(BitSet >> i);
+ Result |= BitFirst << (BitSize - 1 - i);
+ }
+ return Result;
+ }
+
+ template<typename T>
+ GLM_FUNC_QUALIFIER T bitfieldReverseLoop(T v)
+ {
+ return bitfieldReverseLoop(glm::vec<1, T>(v)).x;
+ }
+
+ GLM_FUNC_QUALIFIER glm::uint32 bitfieldReverseUint32(glm::uint32 x)
+ {
+ x = (x & 0x55555555) << 1 | (x & 0xAAAAAAAA) >> 1;
+ x = (x & 0x33333333) << 2 | (x & 0xCCCCCCCC) >> 2;
+ x = (x & 0x0F0F0F0F) << 4 | (x & 0xF0F0F0F0) >> 4;
+ x = (x & 0x00FF00FF) << 8 | (x & 0xFF00FF00) >> 8;
+ x = (x & 0x0000FFFF) << 16 | (x & 0xFFFF0000) >> 16;
+ return x;
+ }
+
+ GLM_FUNC_QUALIFIER glm::uint64 bitfieldReverseUint64(glm::uint64 x)
+ {
+ x = (x & 0x5555555555555555) << 1 | (x & 0xAAAAAAAAAAAAAAAA) >> 1;
+ x = (x & 0x3333333333333333) << 2 | (x & 0xCCCCCCCCCCCCCCCC) >> 2;
+ x = (x & 0x0F0F0F0F0F0F0F0F) << 4 | (x & 0xF0F0F0F0F0F0F0F0) >> 4;
+ x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8;
+ x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16;
+ x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32;
+ return x;
+ }
+
+ template<bool EXEC = false>
+ struct compute_bitfieldReverseStep
+ {
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER static glm::vec<L, T, Q> call(glm::vec<L, T, Q> const& v, T, T)
+ {
+ return v;
+ }
+ };
+
+ template<>
+ struct compute_bitfieldReverseStep<true>
+ {
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER static glm::vec<L, T, Q> call(glm::vec<L, T, Q> const& v, T Mask, T Shift)
+ {
+ return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
+ }
+ };
+
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> bitfieldReverseOps(glm::vec<L, T, Q> const& v)
+ {
+ glm::vec<L, T, Q> x(v);
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, static_cast<T>(0x5555555555555555ull), static_cast<T>( 1));
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, static_cast<T>(0x3333333333333333ull), static_cast<T>( 2));
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, static_cast<T>(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 16>::call(x, static_cast<T>(0x00FF00FF00FF00FFull), static_cast<T>( 8));
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 32>::call(x, static_cast<T>(0x0000FFFF0000FFFFull), static_cast<T>(16));
+ x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 64>::call(x, static_cast<T>(0x00000000FFFFFFFFull), static_cast<T>(32));
+ return x;
+ }
+
+ template<typename genType>
+ GLM_FUNC_QUALIFIER genType bitfieldReverseOps(genType x)
+ {
+ return bitfieldReverseOps(glm::vec<1, genType, glm::defaultp>(x)).x;
+ }
+
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ result Result;
+ };
+
+ typedef type<glm::uint> typeU32;
+
+ typeU32 const Data32[] =
+ {
+ {0x00000001, 0x80000000, SUCCESS},
+ {0x0000000f, 0xf0000000, SUCCESS},
+ {0x000000ff, 0xff000000, SUCCESS},
+ {0xf0000000, 0x0000000f, SUCCESS},
+ {0xff000000, 0x000000ff, SUCCESS},
+ {0xffffffff, 0xffffffff, SUCCESS},
+ {0x00000000, 0x00000000, SUCCESS}
+ };
+
+ typedef type<glm::uint64> typeU64;
+
+ typeU64 const Data64[] =
+ {
+ {0x00000000000000ff, 0xff00000000000000, SUCCESS},
+ {0x000000000000000f, 0xf000000000000000, SUCCESS},
+ {0xf000000000000000, 0x000000000000000f, SUCCESS},
+ {0xffffffffffffffff, 0xffffffffffffffff, SUCCESS},
+ {0x0000000000000000, 0x0000000000000000, SUCCESS}
+ };
+
+ static int test32_bitfieldReverse()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data32) / sizeof(typeU32);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint Return = glm::bitfieldReverse(Data32[i].Value);
+
+ bool Compare = Data32[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test32_bitfieldReverseLoop()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data32) / sizeof(typeU32);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint Return = bitfieldReverseLoop(Data32[i].Value);
+
+ bool Compare = Data32[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test32_bitfieldReverseUint32()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data32) / sizeof(typeU32);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint Return = bitfieldReverseUint32(Data32[i].Value);
+
+ bool Compare = Data32[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test32_bitfieldReverseOps()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data32) / sizeof(typeU32);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint Return = bitfieldReverseOps(Data32[i].Value);
+
+ bool Compare = Data32[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test64_bitfieldReverse()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data64) / sizeof(typeU64);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint64 Return = glm::bitfieldReverse(Data64[i].Value);
+
+ bool Compare = Data64[i].Return == Return;
+
+ if(Data64[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test64_bitfieldReverseLoop()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data64) / sizeof(typeU64);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint64 Return = bitfieldReverseLoop(Data64[i].Value);
+
+ bool Compare = Data64[i].Return == Return;
+
+ if(Data32[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test64_bitfieldReverseUint64()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data64) / sizeof(typeU64);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint64 Return = bitfieldReverseUint64(Data64[i].Value);
+
+ bool Compare = Data64[i].Return == Return;
+
+ if(Data64[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test64_bitfieldReverseOps()
+ {
+ int Error = 0;
+ std::size_t const Count = sizeof(Data64) / sizeof(typeU64);
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::uint64 Return = bitfieldReverseOps(Data64[i].Value);
+
+ bool Compare = Data64[i].Return == Return;
+
+ if(Data64[i].Result == SUCCESS)
+ Error += Compare ? 0 : 1;
+ else
+ Error += Compare ? 1 : 0;
+ }
+
+ return Error;
+ }
+
+ static int test()
+ {
+ int Error = 0;
+
+ Error += test32_bitfieldReverse();
+ Error += test32_bitfieldReverseLoop();
+ Error += test32_bitfieldReverseUint32();
+ Error += test32_bitfieldReverseOps();
+
+ Error += test64_bitfieldReverse();
+ Error += test64_bitfieldReverseLoop();
+ Error += test64_bitfieldReverseUint64();
+ Error += test64_bitfieldReverseOps();
+
+ return Error;
+ }
+
+ static int perf32(glm::uint32 Count)
+ {
+ int Error = 0;
+
+ std::vector<glm::uint32> Data;
+ Data.resize(static_cast<std::size_t>(Count));
+
+ std::clock_t Timestamps0 = std::clock();
+
+ for(glm::uint32 k = 0; k < Count; ++k)
+ Data[k] = glm::bitfieldReverse(k);
+
+ std::clock_t Timestamps1 = std::clock();
+
+ for(glm::uint32 k = 0; k < Count; ++k)
+ Data[k] = bitfieldReverseLoop(k);
+
+ std::clock_t Timestamps2 = std::clock();
+
+ for(glm::uint32 k = 0; k < Count; ++k)
+ Data[k] = bitfieldReverseUint32(k);
+
+ std::clock_t Timestamps3 = std::clock();
+
+ for(glm::uint32 k = 0; k < Count; ++k)
+ Data[k] = bitfieldReverseOps(k);
+
+ std::clock_t Timestamps4 = std::clock();
+
+ std::printf("glm::bitfieldReverse: %d clocks\n", static_cast<int>(Timestamps1 - Timestamps0));
+ std::printf("bitfieldReverseLoop: %d clocks\n", static_cast<int>(Timestamps2 - Timestamps1));
+ std::printf("bitfieldReverseUint32: %d clocks\n", static_cast<int>(Timestamps3 - Timestamps2));
+ std::printf("bitfieldReverseOps: %d clocks\n", static_cast<int>(Timestamps4 - Timestamps3));
+
+ return Error;
+ }
+
+ static int perf64(glm::uint64 Count)
+ {
+ int Error = 0;
+
+ std::vector<glm::uint64> Data;
+ Data.resize(static_cast<std::size_t>(Count));
+
+ std::clock_t Timestamps0 = std::clock();
+
+ for(glm::uint64 k = 0; k < Count; ++k)
+ Data[static_cast<std::size_t>(k)] = glm::bitfieldReverse(k);
+
+ std::clock_t Timestamps1 = std::clock();
+
+ for(glm::uint64 k = 0; k < Count; ++k)
+ Data[static_cast<std::size_t>(k)] = bitfieldReverseLoop<glm::uint64>(k);
+
+ std::clock_t Timestamps2 = std::clock();
+
+ for(glm::uint64 k = 0; k < Count; ++k)
+ Data[static_cast<std::size_t>(k)] = bitfieldReverseUint64(k);
+
+ std::clock_t Timestamps3 = std::clock();
+
+ for(glm::uint64 k = 0; k < Count; ++k)
+ Data[static_cast<std::size_t>(k)] = bitfieldReverseOps(k);
+
+ std::clock_t Timestamps4 = std::clock();
+
+ std::printf("glm::bitfieldReverse - 64: %d clocks\n", static_cast<int>(Timestamps1 - Timestamps0));
+ std::printf("bitfieldReverseLoop - 64: %d clocks\n", static_cast<int>(Timestamps2 - Timestamps1));
+ std::printf("bitfieldReverseUint - 64: %d clocks\n", static_cast<int>(Timestamps3 - Timestamps2));
+ std::printf("bitfieldReverseOps - 64: %d clocks\n", static_cast<int>(Timestamps4 - Timestamps3));
+
+ return Error;
+ }
+
+ static int perf(std::size_t Samples)
+ {
+ int Error = 0;
+
+ Error += perf32(static_cast<glm::uint32>(Samples));
+ Error += perf64(static_cast<glm::uint64>(Samples));
+
+ return Error;
+ }
+}//bitfieldReverse
+
+namespace findMSB
+{
+ template<typename genType, typename retType>
+ struct type
+ {
+ genType Value;
+ retType Return;
+ };
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ template<typename genIUType>
+ static int findMSB_intrinsic(genIUType Value)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
+
+ if(Value == 0)
+ return -1;
+
+ unsigned long Result(0);
+ _BitScanReverse(&Result, Value);
+ return int(Result);
+ }
+# endif//GLM_HAS_BITSCAN_WINDOWS
+
+# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC
+ template<typename genIUType>
+ static int findMSB_avx(genIUType Value)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
+
+ if(Value == 0)
+ return -1;
+
+ return int(_tzcnt_u32(Value));
+ }
+# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS
+
+ template<typename genIUType>
+ static int findMSB_095(genIUType Value)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
+
+ if(Value == genIUType(0) || Value == genIUType(-1))
+ return -1;
+ else if(Value > 0)
+ {
+ genIUType Bit = genIUType(-1);
+ for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){}
+ return static_cast<int>(Bit);
+ }
+ else //if(Value < 0)
+ {
+ int const BitCount(sizeof(genIUType) * 8);
+ int MostSignificantBit(-1);
+ for(int BitIndex(0); BitIndex < BitCount; ++BitIndex)
+ MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex;
+ assert(MostSignificantBit >= 0);
+ return MostSignificantBit;
+ }
+ }
+
+ template<typename genIUType>
+ static int findMSB_nlz1(genIUType x)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
+
+ if (x == 0)
+ return -1;
+
+ int n = 0;
+ if (x <= 0x0000FFFF) {n = n +16; x = x <<16;}
+ if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;}
+ if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;}
+ if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;}
+ if (x <= 0x7FFFFFFF) {n = n + 1;}
+ return 31 - n;
+ }
+
+ static int findMSB_nlz2(unsigned int x)
+ {
+ unsigned int y;
+ int n = 32;
+
+ y = x >>16; if (y != 0) {n = n -16; x = y;}
+ y = x >> 8; if (y != 0) {n = n - 8; x = y;}
+ y = x >> 4; if (y != 0) {n = n - 4; x = y;}
+ y = x >> 2; if (y != 0) {n = n - 2; x = y;}
+ y = x >> 1; if (y != 0) return n - 2;
+ return 32 - (n - static_cast<int>(x));
+ }
+
+ static int findMSB_pop(unsigned int x)
+ {
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return 31 - glm::bitCount(~x);
+ }
+
+ static int perf_int(std::size_t Count)
+ {
+ type<int, int> const Data[] =
+ {
+ {0x00000000, -1},
+ {0x00000001, 0},
+ {0x00000002, 1},
+ {0x00000003, 1},
+ {0x00000004, 2},
+ {0x00000005, 2},
+ {0x00000007, 2},
+ {0x00000008, 3},
+ {0x00000010, 4},
+ {0x00000020, 5},
+ {0x00000040, 6},
+ {0x00000080, 7},
+ {0x00000100, 8},
+ {0x00000200, 9},
+ {0x00000400, 10},
+ {0x00000800, 11},
+ {0x00001000, 12},
+ {0x00002000, 13},
+ {0x00004000, 14},
+ {0x00008000, 15},
+ {0x00010000, 16},
+ {0x00020000, 17},
+ {0x00040000, 18},
+ {0x00080000, 19},
+ {0x00100000, 20},
+ {0x00200000, 21},
+ {0x00400000, 22},
+ {0x00800000, 23},
+ {0x01000000, 24},
+ {0x02000000, 25},
+ {0x04000000, 26},
+ {0x08000000, 27},
+ {0x10000000, 28},
+ {0x20000000, 29},
+ {0x40000000, 30}
+ };
+
+ int Error(0);
+
+ std::clock_t Timestamps0 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = glm::findMSB(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps1 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_nlz1(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps2 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_nlz2(static_cast<unsigned int>(Data[i].Value));
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps3 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_095(static_cast<unsigned int>(Data[i].Value));
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps4 = std::clock();
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_intrinsic(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+# endif//GLM_HAS_BITSCAN_WINDOWS
+
+ std::clock_t Timestamps5 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_pop(static_cast<unsigned int>(Data[i].Value));
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps6 = std::clock();
+
+# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int, int>); ++i)
+ {
+ int Result = findMSB_avx(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps7 = std::clock();
+# endif
+
+ std::printf("glm::findMSB: %d clocks\n", static_cast<int>(Timestamps1 - Timestamps0));
+ std::printf("findMSB - nlz1: %d clocks\n", static_cast<int>(Timestamps2 - Timestamps1));
+ std::printf("findMSB - nlz2: %d clocks\n", static_cast<int>(Timestamps3 - Timestamps2));
+ std::printf("findMSB - 0.9.5: %d clocks\n", static_cast<int>(Timestamps4 - Timestamps3));
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ std::printf("findMSB - intrinsics: %d clocks\n", static_cast<int>(Timestamps5 - Timestamps4));
+# endif//GLM_HAS_BITSCAN_WINDOWS
+ std::printf("findMSB - pop: %d clocks\n", static_cast<int>(Timestamps6 - Timestamps5));
+
+# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC
+ std::printf("findMSB - avx tzcnt: %d clocks\n", static_cast<int>(Timestamps7 - Timestamps6));
+# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS
+
+ return Error;
+ }
+
+ static int test_ivec4()
+ {
+ type<glm::ivec4, glm::ivec4> const Data[] =
+ {
+ {glm::ivec4(0x00000000), glm::ivec4(-1)},
+ {glm::ivec4(0x00000001), glm::ivec4( 0)},
+ {glm::ivec4(0x00000002), glm::ivec4( 1)},
+ {glm::ivec4(0x00000003), glm::ivec4( 1)},
+ {glm::ivec4(0x00000004), glm::ivec4( 2)},
+ {glm::ivec4(0x00000005), glm::ivec4( 2)},
+ {glm::ivec4(0x00000007), glm::ivec4( 2)},
+ {glm::ivec4(0x00000008), glm::ivec4( 3)},
+ {glm::ivec4(0x00000010), glm::ivec4( 4)},
+ {glm::ivec4(0x00000020), glm::ivec4( 5)},
+ {glm::ivec4(0x00000040), glm::ivec4( 6)},
+ {glm::ivec4(0x00000080), glm::ivec4( 7)},
+ {glm::ivec4(0x00000100), glm::ivec4( 8)},
+ {glm::ivec4(0x00000200), glm::ivec4( 9)},
+ {glm::ivec4(0x00000400), glm::ivec4(10)},
+ {glm::ivec4(0x00000800), glm::ivec4(11)},
+ {glm::ivec4(0x00001000), glm::ivec4(12)},
+ {glm::ivec4(0x00002000), glm::ivec4(13)},
+ {glm::ivec4(0x00004000), glm::ivec4(14)},
+ {glm::ivec4(0x00008000), glm::ivec4(15)},
+ {glm::ivec4(0x00010000), glm::ivec4(16)},
+ {glm::ivec4(0x00020000), glm::ivec4(17)},
+ {glm::ivec4(0x00040000), glm::ivec4(18)},
+ {glm::ivec4(0x00080000), glm::ivec4(19)},
+ {glm::ivec4(0x00100000), glm::ivec4(20)},
+ {glm::ivec4(0x00200000), glm::ivec4(21)},
+ {glm::ivec4(0x00400000), glm::ivec4(22)},
+ {glm::ivec4(0x00800000), glm::ivec4(23)},
+ {glm::ivec4(0x01000000), glm::ivec4(24)},
+ {glm::ivec4(0x02000000), glm::ivec4(25)},
+ {glm::ivec4(0x04000000), glm::ivec4(26)},
+ {glm::ivec4(0x08000000), glm::ivec4(27)},
+ {glm::ivec4(0x10000000), glm::ivec4(28)},
+ {glm::ivec4(0x20000000), glm::ivec4(29)},
+ {glm::ivec4(0x40000000), glm::ivec4(30)}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<glm::ivec4, glm::ivec4>); ++i)
+ {
+ glm::ivec4 Result0 = glm::findMSB(Data[i].Value);
+ Error += glm::all(glm::equal(Data[i].Return, Result0)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ static int test_int()
+ {
+ typedef type<glm::uint, int> entry;
+
+ entry const Data[] =
+ {
+ {0x00000000, -1},
+ {0x00000001, 0},
+ {0x00000002, 1},
+ {0x00000003, 1},
+ {0x00000004, 2},
+ {0x00000005, 2},
+ {0x00000007, 2},
+ {0x00000008, 3},
+ {0x00000010, 4},
+ {0x00000020, 5},
+ {0x00000040, 6},
+ {0x00000080, 7},
+ {0x00000100, 8},
+ {0x00000200, 9},
+ {0x00000400, 10},
+ {0x00000800, 11},
+ {0x00001000, 12},
+ {0x00002000, 13},
+ {0x00004000, 14},
+ {0x00008000, 15},
+ {0x00010000, 16},
+ {0x00020000, 17},
+ {0x00040000, 18},
+ {0x00080000, 19},
+ {0x00100000, 20},
+ {0x00200000, 21},
+ {0x00400000, 22},
+ {0x00800000, 23},
+ {0x01000000, 24},
+ {0x02000000, 25},
+ {0x04000000, 26},
+ {0x08000000, 27},
+ {0x10000000, 28},
+ {0x20000000, 29},
+ {0x40000000, 30}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = glm::findMSB(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = findMSB_nlz1(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+/*
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = findMSB_nlz2(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+*/
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = findMSB_095(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = findMSB_intrinsic(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+# endif//GLM_HAS_BITSCAN_WINDOWS
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i)
+ {
+ int Result0 = findMSB_pop(Data[i].Value);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ static int test()
+ {
+ int Error(0);
+
+ Error += test_ivec4();
+ Error += test_int();
+
+ return Error;
+ }
+
+ static int perf(std::size_t Samples)
+ {
+ int Error(0);
+
+ Error += perf_int(Samples);
+
+ return Error;
+ }
+}//findMSB
+
+namespace findLSB
+{
+ template<typename genType, typename retType>
+ struct type
+ {
+ genType Value;
+ retType Return;
+ };
+
+ typedef type<int, int> entry;
+
+ entry const DataI32[] =
+ {
+ {0x00000001, 0},
+ {0x00000003, 0},
+ {0x00000002, 1},
+ // {0x80000000, 31}, // Clang generates an error with this
+ {0x00010000, 16},
+ {0x7FFF0000, 16},
+ {0x7F000000, 24},
+ {0x7F00FF00, 8},
+ {0x00000000, -1}
+ };
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ template<typename genIUType>
+ static int findLSB_intrinsic(genIUType Value)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
+
+ if(Value == 0)
+ return -1;
+
+ unsigned long Result(0);
+ _BitScanForward(&Result, Value);
+ return int(Result);
+ }
+# endif
+
+ template<typename genIUType>
+ static int findLSB_095(genIUType Value)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
+ if(Value == 0)
+ return -1;
+
+ genIUType Bit;
+ for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){}
+ return Bit;
+ }
+
+ template<typename genIUType>
+ static int findLSB_ntz2(genIUType x)
+ {
+ if(x == 0)
+ return -1;
+
+ return glm::bitCount(~x & (x - static_cast<genIUType>(1)));
+ }
+
+ template<typename genIUType>
+ static int findLSB_branchfree(genIUType x)
+ {
+ bool IsNull(x == 0);
+ int const Keep(!IsNull);
+ int const Discard(IsNull);
+
+ return static_cast<int>(glm::bitCount(~x & (x - static_cast<genIUType>(1)))) * Keep + Discard * -1;
+ }
+
+ static int test_int()
+ {
+ int Error(0);
+
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = glm::findLSB(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_095(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_intrinsic(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+# endif
+
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_ntz2(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_branchfree(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ static int test()
+ {
+ int Error(0);
+
+ Error += test_int();
+
+ return Error;
+ }
+
+ static int perf_int(std::size_t Count)
+ {
+ int Error(0);
+
+ std::clock_t Timestamps0 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = glm::findLSB(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps1 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_095(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps2 = std::clock();
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_intrinsic(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+# endif
+
+ std::clock_t Timestamps3 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_ntz2(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps4 = std::clock();
+
+ for(std::size_t k = 0; k < Count; ++k)
+ for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i)
+ {
+ int Result = findLSB_branchfree(DataI32[i].Value);
+ Error += DataI32[i].Return == Result ? 0 : 1;
+ }
+
+ std::clock_t Timestamps5 = std::clock();
+
+ std::printf("glm::findLSB: %d clocks\n", static_cast<int>(Timestamps1 - Timestamps0));
+ std::printf("findLSB - 0.9.5: %d clocks\n", static_cast<int>(Timestamps2 - Timestamps1));
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ std::printf("findLSB - intrinsics: %d clocks\n", static_cast<int>(Timestamps3 - Timestamps2));
+# endif
+
+ std::printf("findLSB - ntz2: %d clocks\n", static_cast<int>(Timestamps4 - Timestamps3));
+ std::printf("findLSB - branchfree: %d clocks\n", static_cast<int>(Timestamps5 - Timestamps4));
+
+ return Error;
+ }
+
+ static int perf(std::size_t Samples)
+ {
+ int Error(0);
+
+ Error += perf_int(Samples);
+
+ return Error;
+ }
+}//findLSB
+
+namespace uaddCarry
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ glm::uint x = std::numeric_limits<glm::uint>::max();
+ glm::uint y = 0;
+ glm::uint Carry = 0;
+ glm::uint Result = glm::uaddCarry(x, y, Carry);
+
+ Error += Carry == 0 ? 0 : 1;
+ Error += Result == std::numeric_limits<glm::uint>::max() ? 0 : 1;
+ }
+
+ {
+ glm::uint x = std::numeric_limits<glm::uint>::max();
+ glm::uint y = 1;
+ glm::uint Carry = 0;
+ glm::uint Result = glm::uaddCarry(x, y, Carry);
+
+ Error += Carry == 1 ? 0 : 1;
+ Error += Result == 0 ? 0 : 1;
+ }
+
+ {
+ glm::uvec1 x(std::numeric_limits<glm::uint>::max());
+ glm::uvec1 y(0);
+ glm::uvec1 Carry(0);
+ glm::uvec1 Result(glm::uaddCarry(x, y, Carry));
+
+ Error += glm::all(glm::equal(Carry, glm::uvec1(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec1(std::numeric_limits<glm::uint>::max()))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec1 x(std::numeric_limits<glm::uint>::max());
+ glm::uvec1 y(1);
+ glm::uvec1 Carry(0);
+ glm::uvec1 Result(glm::uaddCarry(x, y, Carry));
+
+ Error += glm::all(glm::equal(Carry, glm::uvec1(1))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec1(0))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace uaddCarry
+
+namespace usubBorrow
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ glm::uint x = 16;
+ glm::uint y = 17;
+ glm::uint Borrow = 0;
+ glm::uint Result = glm::usubBorrow(x, y, Borrow);
+
+ Error += Borrow == 1 ? 0 : 1;
+ Error += Result == 1 ? 0 : 1;
+ }
+
+ {
+ glm::uvec1 x(16);
+ glm::uvec1 y(17);
+ glm::uvec1 Borrow(0);
+ glm::uvec1 Result(glm::usubBorrow(x, y, Borrow));
+
+ Error += glm::all(glm::equal(Borrow, glm::uvec1(1))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec1(1))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec2 x(16);
+ glm::uvec2 y(17);
+ glm::uvec2 Borrow(0);
+ glm::uvec2 Result(glm::usubBorrow(x, y, Borrow));
+
+ Error += glm::all(glm::equal(Borrow, glm::uvec2(1))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec2(1))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec3 x(16);
+ glm::uvec3 y(17);
+ glm::uvec3 Borrow(0);
+ glm::uvec3 Result(glm::usubBorrow(x, y, Borrow));
+
+ Error += glm::all(glm::equal(Borrow, glm::uvec3(1))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec3(1))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec4 x(16);
+ glm::uvec4 y(17);
+ glm::uvec4 Borrow(0);
+ glm::uvec4 Result(glm::usubBorrow(x, y, Borrow));
+
+ Error += glm::all(glm::equal(Borrow, glm::uvec4(1))) ? 0 : 1;
+ Error += glm::all(glm::equal(Result, glm::uvec4(1))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace usubBorrow
+
+namespace umulExtended
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ glm::uint x = 2;
+ glm::uint y = 3;
+ glm::uint msb = 0;
+ glm::uint lsb = 0;
+ glm::umulExtended(x, y, msb, lsb);
+
+ Error += msb == 0 ? 0 : 1;
+ Error += lsb == 6 ? 0 : 1;
+ }
+
+ {
+ glm::uvec1 x(2);
+ glm::uvec1 y(3);
+ glm::uvec1 msb(0);
+ glm::uvec1 lsb(0);
+ glm::umulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::uvec1(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::uvec1(6))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec2 x(2);
+ glm::uvec2 y(3);
+ glm::uvec2 msb(0);
+ glm::uvec2 lsb(0);
+ glm::umulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::uvec2(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::uvec2(6))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec3 x(2);
+ glm::uvec3 y(3);
+ glm::uvec3 msb(0);
+ glm::uvec3 lsb(0);
+ glm::umulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::uvec3(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::uvec3(6))) ? 0 : 1;
+ }
+
+ {
+ glm::uvec4 x(2);
+ glm::uvec4 y(3);
+ glm::uvec4 msb(0);
+ glm::uvec4 lsb(0);
+ glm::umulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::uvec4(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::uvec4(6))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace umulExtended
+
+namespace imulExtended
+{
+ static int test()
+ {
+ int Error(0);
+
+ {
+ int x = 2;
+ int y = 3;
+ int msb = 0;
+ int lsb = 0;
+ glm::imulExtended(x, y, msb, lsb);
+
+ Error += msb == 0 ? 0 : 1;
+ Error += lsb == 6 ? 0 : 1;
+ }
+
+ {
+ glm::ivec1 x(2);
+ glm::ivec1 y(3);
+ glm::ivec1 msb(0);
+ glm::ivec1 lsb(0);
+ glm::imulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::ivec1(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::ivec1(6))) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 x(2);
+ glm::ivec2 y(3);
+ glm::ivec2 msb(0);
+ glm::ivec2 lsb(0);
+ glm::imulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::ivec2(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::ivec2(6))) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 x(2);
+ glm::ivec3 y(3);
+ glm::ivec3 msb(0);
+ glm::ivec3 lsb(0);
+ glm::imulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::ivec3(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::ivec3(6))) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 x(2);
+ glm::ivec4 y(3);
+ glm::ivec4 msb(0);
+ glm::ivec4 lsb(0);
+ glm::imulExtended(x, y, msb, lsb);
+
+ Error += glm::all(glm::equal(msb, glm::ivec4(0))) ? 0 : 1;
+ Error += glm::all(glm::equal(lsb, glm::ivec4(6))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace imulExtended
+
+namespace bitCount
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ };
+
+ type<int> const DataI32[] =
+ {
+ {0x00000001, 1},
+ {0x00000003, 2},
+ {0x00000002, 1},
+ {0x7fffffff, 31},
+ {0x00000000, 0}
+ };
+
+ template<typename T>
+ inline int bitCount_if(T v)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
+
+ int Count(0);
+ for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)
+ {
+ if(v & static_cast<T>(1 << i))
+ ++Count;
+ }
+ return Count;
+ }
+
+ template<typename T>
+ inline int bitCount_vec(T v)
+ {
+ GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
+
+ int Count(0);
+ for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)
+ {
+ Count += static_cast<int>((v >> i) & static_cast<T>(1));
+ }
+ return Count;
+ }
+
+ template<bool EXEC = false>
+ struct compute_bitfieldBitCountStep
+ {
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER static glm::vec<L, T, Q> call(glm::vec<L, T, Q> const& v, T, T)
+ {
+ return v;
+ }
+ };
+
+ template<>
+ struct compute_bitfieldBitCountStep<true>
+ {
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ GLM_FUNC_QUALIFIER static glm::vec<L, T, Q> call(glm::vec<L, T, Q> const& v, T Mask, T Shift)
+ {
+ return (v & Mask) + ((v >> Shift) & Mask);
+ }
+ };
+
+ template<glm::length_t L, typename T, glm::qualifier Q>
+ static glm::vec<L, int, Q> bitCount_bitfield(glm::vec<L, T, Q> const& v)
+ {
+ glm::vec<L, typename glm::detail::make_unsigned<T>::type, Q> x(*reinterpret_cast<glm::vec<L, typename glm::detail::make_unsigned<T>::type, Q> const *>(&v));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 2>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x5555555555555555ull), static_cast<typename glm::detail::make_unsigned<T>::type>( 1));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 4>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x3333333333333333ull), static_cast<typename glm::detail::make_unsigned<T>::type>( 2));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 8>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x0F0F0F0F0F0F0F0Full), static_cast<typename glm::detail::make_unsigned<T>::type>( 4));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 16>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x00FF00FF00FF00FFull), static_cast<typename glm::detail::make_unsigned<T>::type>( 8));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 32>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x0000FFFF0000FFFFull), static_cast<typename glm::detail::make_unsigned<T>::type>(16));
+ x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 64>::call(x, static_cast<typename glm::detail::make_unsigned<T>::type>(0x00000000FFFFFFFFull), static_cast<typename glm::detail::make_unsigned<T>::type>(32));
+ return glm::vec<L, int, Q>(x);
+ }
+
+ template<typename genType>
+ static int bitCount_bitfield(genType x)
+ {
+ return bitCount_bitfield(glm::vec<1, genType, glm::defaultp>(x)).x;
+ }
+
+ static int perf(std::size_t Size)
+ {
+ int Error(0);
+
+ std::vector<int> v;
+ v.resize(Size);
+
+ std::vector<glm::ivec4> w;
+ w.resize(Size);
+
+
+ std::clock_t TimestampsA = std::clock();
+
+ // bitCount - TimeIf
+ {
+ for(std::size_t i = 0, n = v.size(); i < n; ++i)
+ v[i] = bitCount_if(static_cast<int>(i));
+ }
+
+ std::clock_t TimestampsB = std::clock();
+
+ // bitCount - TimeVec
+ {
+ for(std::size_t i = 0, n = v.size(); i < n; ++i)
+ v[i] = bitCount_vec(i);
+ }
+
+ std::clock_t TimestampsC = std::clock();
+
+ // bitCount - TimeDefault
+ {
+ for(std::size_t i = 0, n = v.size(); i < n; ++i)
+ v[i] = glm::bitCount(i);
+ }
+
+ std::clock_t TimestampsD = std::clock();
+
+ // bitCount - TimeVec4
+ {
+ for(std::size_t i = 0, n = v.size(); i < n; ++i)
+ w[i] = glm::bitCount(glm::ivec4(static_cast<int>(i)));
+ }
+
+ std::clock_t TimestampsE = std::clock();
+
+ {
+ for(std::size_t i = 0, n = v.size(); i < n; ++i)
+ v[i] = bitCount_bitfield(static_cast<int>(i));
+ }
+
+ std::clock_t TimestampsF = std::clock();
+
+ std::printf("bitCount - TimeIf %d\n", static_cast<int>(TimestampsB - TimestampsA));
+ std::printf("bitCount - TimeVec %d\n", static_cast<int>(TimestampsC - TimestampsB));
+ std::printf("bitCount - TimeDefault %d\n", static_cast<int>(TimestampsD - TimestampsC));
+ std::printf("bitCount - TimeVec4 %d\n", static_cast<int>(TimestampsE - TimestampsD));
+ std::printf("bitCount - bitfield %d\n", static_cast<int>(TimestampsF - TimestampsE));
+
+ return Error;
+ }
+
+ static int test()
+ {
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(DataI32) / sizeof(type<int>); i < n; ++i)
+ {
+ int ResultA = glm::bitCount(DataI32[i].Value);
+ int ResultB = bitCount_if(DataI32[i].Value);
+ int ResultC = bitCount_vec(DataI32[i].Value);
+ int ResultE = bitCount_bitfield(DataI32[i].Value);
+
+ Error += DataI32[i].Return == ResultA ? 0 : 1;
+ Error += DataI32[i].Return == ResultB ? 0 : 1;
+ Error += DataI32[i].Return == ResultC ? 0 : 1;
+ Error += DataI32[i].Return == ResultE ? 0 : 1;
+
+ assert(!Error);
+ }
+
+ return Error;
+ }
+}//bitCount
+
+int main()
+{
+ int Error = 0;
+
+ Error += ::bitCount::test();
+ Error += ::bitfieldReverse::test();
+ Error += ::findMSB::test();
+ Error += ::findLSB::test();
+ Error += ::umulExtended::test();
+ Error += ::imulExtended::test();
+ Error += ::uaddCarry::test();
+ Error += ::usubBorrow::test();
+ Error += ::bitfieldInsert::test();
+ Error += ::bitfieldExtract::test();
+
+# ifdef NDEBUG
+ std::size_t const Samples = 1000;
+# else
+ std::size_t const Samples = 1;
+# endif
+
+ ::bitCount::perf(Samples);
+ ::bitfieldReverse::perf(Samples);
+ ::findMSB::perf(Samples);
+ ::findLSB::perf(Samples);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp b/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp
new file mode 100644
index 0000000..0fa11fb
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp
@@ -0,0 +1,291 @@
+// This has the programs for computing the number of 1-bits
+// in a word, or byte, etc.
+// Max line length is 57, to fit in hacker.book.
+#include <cstdio>
+#include <cstdlib> //To define "exit", req'd by XLC.
+#include <ctime>
+
+unsigned rotatel(unsigned x, int n)
+{
+ if (static_cast<unsigned>(n) > 63) { std::printf("rotatel, n out of range.\n"); std::exit(1);}
+ return (x << n) | (x >> (32 - n));
+}
+
+int pop0(unsigned x)
+{
+ x = (x & 0x55555555) + ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F);
+ x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF);
+ x = (x & 0x0000FFFF) + ((x >>16) & 0x0000FFFF);
+ return x;
+}
+
+int pop1(unsigned x)
+{
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0F0F0F0F;
+ x = x + (x >> 8);
+ x = x + (x >> 16);
+ return x & 0x0000003F;
+}
+/* Note: an alternative to the last three executable lines above is:
+ return x*0x01010101 >> 24;
+if your machine has a fast multiplier (suggested by Jari Kirma). */
+
+int pop2(unsigned x)
+{
+ unsigned n;
+
+ n = (x >> 1) & 033333333333; // Count bits in
+ x = x - n; // each 3-bit
+ n = (n >> 1) & 033333333333; // field.
+ x = x - n;
+ x = (x + (x >> 3)) & 030707070707; // 6-bit sums.
+ return x%63; // Add 6-bit sums.
+}
+
+/* An alternative to the "return" statement above is:
+ return ((x * 0404040404) >> 26) + // Add 6-bit sums.
+ (x >> 30);
+which runs faster on most machines (suggested by Norbert Juffa). */
+
+int pop3(unsigned x)
+{
+ unsigned n;
+
+ n = (x >> 1) & 0x77777777; // Count bits in
+ x = x - n; // each 4-bit
+ n = (n >> 1) & 0x77777777; // field.
+ x = x - n;
+ n = (n >> 1) & 0x77777777;
+ x = x - n;
+ x = (x + (x >> 4)) & 0x0F0F0F0F; // Get byte sums.
+ x = x*0x01010101; // Add the bytes.
+ return x >> 24;
+}
+
+int pop4(unsigned x)
+{
+ int n;
+
+ n = 0;
+ while (x != 0) {
+ n = n + 1;
+ x = x & (x - 1);
+ }
+ return n;
+}
+
+int pop5(unsigned x)
+{
+ int i, sum;
+
+ // Rotate and sum method // Shift right & subtract
+
+ sum = x; // sum = x;
+ for (i = 1; i <= 31; i++) { // while (x != 0) {
+ x = rotatel(x, 1); // x = x >> 1;
+ sum = sum + x; // sum = sum - x;
+ } // }
+ return -sum; // return sum;
+}
+
+int pop5a(unsigned x)
+{
+ int sum;
+
+ // Shift right & subtract
+
+ sum = x;
+ while (x != 0) {
+ x = x >> 1;
+ sum = sum - x;
+ }
+ return sum;
+}
+
+int pop6(unsigned x)
+{ // Table lookup.
+ static char table[256] = {
+ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};
+
+ return table[x & 0xFF] +
+ table[(x >> 8) & 0xFF] +
+ table[(x >> 16) & 0xFF] +
+ table[(x >> 24)];
+}
+
+// The following works only for 8-bit quantities.
+int pop7(unsigned x)
+{
+ x = x*0x08040201; // Make 4 copies.
+ x = x >> 3; // So next step hits proper bits.
+ x = x & 0x11111111; // Every 4th bit.
+ x = x*0x11111111; // Sum the digits (each 0 or 1).
+ x = x >> 28; // Position the result.
+ return x;
+}
+
+// The following works only for 7-bit quantities.
+int pop8(unsigned x)
+{
+ x = x*0x02040810; // Make 4 copies, left-adjusted.
+ x = x & 0x11111111; // Every 4th bit.
+ x = x*0x11111111; // Sum the digits (each 0 or 1).
+ x = x >> 28; // Position the result.
+ return x;
+}
+
+// The following works only for 15-bit quantities.
+int pop9(unsigned x)
+{
+ unsigned long long y;
+ y = x * 0x0002000400080010ULL;
+ y = y & 0x1111111111111111ULL;
+ y = y * 0x1111111111111111ULL;
+ y = y >> 60;
+ return static_cast<int>(y);
+}
+
+int errors;
+void error(int x, int y)
+{
+ errors = errors + 1;
+ std::printf("Error for x = %08x, got %08x\n", x, y);
+}
+
+int main()
+{
+# ifdef NDEBUG
+
+ int i, n;
+ static unsigned test[] = {0,0, 1,1, 2,1, 3,2, 4,1, 5,2, 6,2, 7,3,
+ 8,1, 9,2, 10,2, 11,3, 12,2, 13,3, 14,3, 15,4, 16,1, 17,2,
+ 0x3F,6, 0x40,1, 0x41,2, 0x7f,7, 0x80,1, 0x81,2, 0xfe,7, 0xff,8,
+ 0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15,
+ 0x55555555,16, 0xAAAAAAAA, 16, 0xFF000000,8, 0xC0C0C0C0,8,
+ 0x0FFFFFF0,24, 0x80000000,1, 0xFFFFFFFF,32};
+
+ std::size_t const Count = 1000000;
+
+ n = sizeof(test)/4;
+
+ std::clock_t TimestampBeg = 0;
+ std::clock_t TimestampEnd = 0;
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop0: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop1: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop2: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop3: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop4: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop5: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop5a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop6: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if ((test[i] & 0xffffff00) == 0)
+ if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop7: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if ((test[i] & 0xffffff80) == 0)
+ if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop8: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if ((test[i] & 0xffff8000) == 0)
+ if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("pop9: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ if (errors == 0)
+ std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
+
+# endif//NDEBUG
+}
diff --git a/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp b/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp
new file mode 100644
index 0000000..7b42d33
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp
@@ -0,0 +1,416 @@
+#include <glm/glm.hpp>
+#include <cstdio>
+#include <cstdlib> //To define "exit", req'd by XLC.
+#include <ctime>
+
+int nlz(unsigned x)
+{
+ int pop(unsigned x);
+
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return pop(~x);
+}
+
+int pop(unsigned x)
+{
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0F0F0F0F;
+ x = x + (x << 8);
+ x = x + (x << 16);
+ return x >> 24;
+}
+
+int ntz1(unsigned x)
+{
+ return 32 - nlz(~x & (x-1));
+}
+
+int ntz2(unsigned x)
+{
+ return pop(~x & (x - 1));
+}
+
+int ntz3(unsigned x)
+{
+ int n;
+
+ if (x == 0) return(32);
+ n = 1;
+ if ((x & 0x0000FFFF) == 0) {n = n +16; x = x >>16;}
+ if ((x & 0x000000FF) == 0) {n = n + 8; x = x >> 8;}
+ if ((x & 0x0000000F) == 0) {n = n + 4; x = x >> 4;}
+ if ((x & 0x00000003) == 0) {n = n + 2; x = x >> 2;}
+ return n - (x & 1);
+}
+
+int ntz4(unsigned x)
+{
+ unsigned y;
+ int n;
+
+ if (x == 0) return 32;
+ n = 31;
+ y = x <<16; if (y != 0) {n = n -16; x = y;}
+ y = x << 8; if (y != 0) {n = n - 8; x = y;}
+ y = x << 4; if (y != 0) {n = n - 4; x = y;}
+ y = x << 2; if (y != 0) {n = n - 2; x = y;}
+ y = x << 1; if (y != 0) {n = n - 1;}
+ return n;
+}
+
+int ntz4a(unsigned x)
+{
+ unsigned y;
+ int n;
+
+ if (x == 0) return 32;
+ n = 31;
+ y = x <<16; if (y != 0) {n = n -16; x = y;}
+ y = x << 8; if (y != 0) {n = n - 8; x = y;}
+ y = x << 4; if (y != 0) {n = n - 4; x = y;}
+ y = x << 2; if (y != 0) {n = n - 2; x = y;}
+ n = n - ((x << 1) >> 31);
+ return n;
+}
+
+int ntz5(char x)
+{
+ if (x & 15) {
+ if (x & 3) {
+ if (x & 1) return 0;
+ else return 1;
+ }
+ else if (x & 4) return 2;
+ else return 3;
+ }
+ else if (x & 0x30) {
+ if (x & 0x10) return 4;
+ else return 5;
+ }
+ else if (x & 0x40) return 6;
+ else if (x) return 7;
+ else return 8;
+}
+
+int ntz6(unsigned x)
+{
+ int n;
+
+ x = ~x & (x - 1);
+ n = 0; // n = 32;
+ while(x != 0)
+ { // while (x != 0) {
+ n = n + 1; // n = n - 1;
+ x = x >> 1; // x = x + x;
+ } // }
+ return n; // return n;
+}
+
+int ntz6a(unsigned x)
+{
+ int n = 32;
+
+ while (x != 0) {
+ n = n - 1;
+ x = x + x;
+ }
+ return n;
+}
+
+/* Dean Gaudet's algorithm. To be most useful there must be a good way
+to evaluate the C "conditional expression" (a?b:c construction) without
+branching. The result of a?b:c is b if a is true (nonzero), and c if a
+is false (0).
+ For example, a compare to zero op that sets a target GPR to 1 if the
+operand is 0, and to 0 if the operand is nonzero, will do it. With this
+instruction, the algorithm is entirely branch-free. But the most
+interesting thing about it is the high degree of parallelism. All six
+lines with conditional expressions can be executed in parallel (on a
+machine with sufficient computational units).
+ Although the instruction count is 30 measured statically, it could
+execute in only 10 cycles on a machine with sufficient parallelism.
+ The first two uses of y can instead be x, which would increase the
+useful parallelism on most machines (the assignments to y, bz, and b4
+could then all run in parallel). */
+
+int ntz7(unsigned x)
+{
+ unsigned y, bz, b4, b3, b2, b1, b0;
+
+ y = x & -x; // Isolate rightmost 1-bit.
+ bz = y ? 0 : 1; // 1 if y = 0.
+ b4 = (y & 0x0000FFFF) ? 0 : 16;
+ b3 = (y & 0x00FF00FF) ? 0 : 8;
+ b2 = (y & 0x0F0F0F0F) ? 0 : 4;
+ b1 = (y & 0x33333333) ? 0 : 2;
+ b0 = (y & 0x55555555) ? 0 : 1;
+ return bz + b4 + b3 + b2 + b1 + b0;
+}
+
+// This file has divisions by zero to test isnan
+#if GLM_COMPILER & GLM_COMPILER_VC
+# pragma warning(disable : 4800)
+#endif
+
+int ntz7_christophe(unsigned x)
+{
+ unsigned y, bz, b4, b3, b2, b1, b0;
+
+ y = x & -x; // Isolate rightmost 1-bit.
+ bz = unsigned(!bool(y)); // 1 if y = 0.
+ b4 = unsigned(!bool(y & 0x0000FFFF)) * 16;
+ b3 = unsigned(!bool(y & 0x00FF00FF)) * 8;
+ b2 = unsigned(!bool(y & 0x0F0F0F0F)) * 4;
+ b1 = unsigned(!bool(y & 0x33333333)) * 2;
+ b0 = unsigned(!bool(y & 0x55555555)) * 1;
+ return bz + b4 + b3 + b2 + b1 + b0;
+}
+
+/* Below is David Seal's algorithm, found at
+http://www.ciphersbyritter.com/NEWS4/BITCT.HTM Table
+entries marked "u" are unused. 6 ops including a
+multiply, plus an indexed load. */
+
+#define u 99
+int ntz8(unsigned x)
+{
+ static char table[64] =
+ {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
+ 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15,
+ 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26,
+ 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u};
+
+ x = (x & -x)*0x0450FBAF;
+ return table[x >> 26];
+}
+
+/* Seal's algorithm with multiply expanded.
+9 elementary ops plus an indexed load. */
+
+int ntz8a(unsigned x)
+{
+ static char table[64] =
+ {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
+ 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15,
+ 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26,
+ 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u};
+
+ x = (x & -x);
+ x = (x << 4) + x; // x = x*17.
+ x = (x << 6) + x; // x = x*65.
+ x = (x << 16) - x; // x = x*65535.
+ return table[x >> 26];
+}
+
+/* Reiser's algorithm. Three ops including a "remainder,"
+plus an indexed load. */
+
+int ntz9(unsigned x)
+{
+ static char table[37] = {
+ 32, 0, 1, 26, 2, 23, 27,
+ u, 3, 16, 24, 30, 28, 11, u, 13, 4,
+ 7, 17, u, 25, 22, 31, 15, 29, 10, 12,
+ 6, u, 21, 14, 9, 5, 20, 8, 19, 18};
+
+ x = (x & -x)%37;
+ return table[x];
+}
+
+/* Using a de Bruijn sequence. This is a table lookup with a 32-entry
+table. The de Bruijn sequence used here is
+ 0000 0100 1101 0111 0110 0101 0001 1111,
+obtained from Danny Dube's October 3, 1997, posting in
+comp.compression.research. Thanks to Norbert Juffa for this reference. */
+
+int ntz10(unsigned x) {
+
+ static char table[32] =
+ { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26,
+ 31,23,18, 5,21, 9,15,11, 30,17, 8,14,29,13,28,27};
+
+ if (x == 0) return 32;
+ x = (x & -x)*0x04D7651F;
+ return table[x >> 27];
+}
+
+/* Norbert Juffa's code, answer to exercise 1 of Chapter 5 (2nd ed). */
+
+#define SLOW_MUL
+int ntz11 (unsigned int n) {
+
+ static unsigned char tab[32] =
+ { 0, 1, 2, 24, 3, 19, 6, 25,
+ 22, 4, 20, 10, 16, 7, 12, 26,
+ 31, 23, 18, 5, 21, 9, 15, 11,
+ 30, 17, 8, 14, 29, 13, 28, 27
+ };
+ unsigned int k;
+ n = n & (-n); /* isolate lsb */
+ printf("n = %d\n", n);
+#if defined(SLOW_MUL)
+ k = (n << 11) - n;
+ k = (k << 2) + k;
+ k = (k << 8) + n;
+ k = (k << 5) - k;
+#else
+ k = n * 0x4d7651f;
+#endif
+ return n ? tab[k>>27] : 32;
+}
+
+int errors;
+void error(int x, int y) {
+ errors = errors + 1;
+ std::printf("Error for x = %08x, got %d\n", x, y);
+}
+
+int main()
+{
+# ifdef NDEBUG
+
+ int i, m, n;
+ static unsigned test[] = {0,32, 1,0, 2,1, 3,0, 4,2, 5,0, 6,1, 7,0,
+ 8,3, 9,0, 16,4, 32,5, 64,6, 128,7, 255,0, 256,8, 512,9, 1024,10,
+ 2048,11, 4096,12, 8192,13, 16384,14, 32768,15, 65536,16,
+ 0x20000,17, 0x40000,18, 0x80000,19, 0x100000,20, 0x200000,21,
+ 0x400000,22, 0x800000,23, 0x1000000,24, 0x2000000,25,
+ 0x4000000,26, 0x8000000,27, 0x10000000,28, 0x20000000,29,
+ 0x40000000,30, 0x80000000,31, 0xFFFFFFF0,4, 0x3000FF00,8,
+ 0xC0000000,30, 0x60000000,29, 0x00011000, 12};
+
+ std::size_t const Count = 1000;
+
+ n = sizeof(test)/4;
+
+ std::clock_t TimestampBeg = 0;
+ std::clock_t TimestampEnd = 0;
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz1(test[i]) != test[i+1]) error(test[i], ntz1(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz1: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz2(test[i]) != test[i+1]) error(test[i], ntz2(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz2: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz3(test[i]) != test[i+1]) error(test[i], ntz3(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz3: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz4(test[i]) != test[i+1]) error(test[i], ntz4(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz4: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz4a(test[i]) != test[i+1]) error(test[i], ntz4a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz4a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for(std::size_t k = 0; k < Count; ++k)
+ for(i = 0; i < n; i += 2)
+ {
+ m = test[i+1];
+ if(m > 8)
+ m = 8;
+ if(ntz5(static_cast<char>(test[i])) != m)
+ error(test[i], ntz5(static_cast<char>(test[i])));
+ }
+ TimestampEnd = std::clock();
+
+ std::printf("ntz5: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz6(test[i]) != test[i+1]) error(test[i], ntz6(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz6: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz6a(test[i]) != test[i+1]) error(test[i], ntz6a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz6a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz7(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz7: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz7_christophe(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz7_christophe: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz8(test[i]) != test[i+1]) error(test[i], ntz8(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz8: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz8a(test[i]) != test[i+1]) error(test[i], ntz8a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz8a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz9(test[i]) != test[i+1]) error(test[i], ntz9(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz9: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (ntz10(test[i]) != test[i+1]) error(test[i], ntz10(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("ntz10: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ if (errors == 0)
+ std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
+
+# endif//NDEBUG
+}
diff --git a/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp b/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp
new file mode 100644
index 0000000..c435467
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp
@@ -0,0 +1,440 @@
+#include <glm/glm.hpp>
+#include <cstdio>
+#include <cstdlib> // To define "exit", req'd by XLC.
+#include <ctime>
+
+#define LE 1 // 1 for little-endian, 0 for big-endian.
+
+int pop(unsigned x) {
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0F0F0F0F;
+ x = x + (x << 8);
+ x = x + (x << 16);
+ return x >> 24;
+}
+
+int nlz1(unsigned x) {
+ int n;
+
+ if (x == 0) return(32);
+ n = 0;
+ if (x <= 0x0000FFFF) {n = n +16; x = x <<16;}
+ if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;}
+ if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;}
+ if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;}
+ if (x <= 0x7FFFFFFF) {n = n + 1;}
+ return n;
+}
+
+int nlz1a(unsigned x) {
+ int n;
+
+/* if (x == 0) return(32); */
+ if (static_cast<int>(x) <= 0) return (~x >> 26) & 32;
+ n = 1;
+ if ((x >> 16) == 0) {n = n +16; x = x <<16;}
+ if ((x >> 24) == 0) {n = n + 8; x = x << 8;}
+ if ((x >> 28) == 0) {n = n + 4; x = x << 4;}
+ if ((x >> 30) == 0) {n = n + 2; x = x << 2;}
+ n = n - (x >> 31);
+ return n;
+}
+// On basic Risc, 12 to 20 instructions.
+
+int nlz2(unsigned x) {
+ unsigned y;
+ int n;
+
+ n = 32;
+ y = x >>16; if (y != 0) {n = n -16; x = y;}
+ y = x >> 8; if (y != 0) {n = n - 8; x = y;}
+ y = x >> 4; if (y != 0) {n = n - 4; x = y;}
+ y = x >> 2; if (y != 0) {n = n - 2; x = y;}
+ y = x >> 1; if (y != 0) return n - 2;
+ return n - x;
+}
+
+// As above but coded as a loop for compactness:
+// 23 to 33 basic Risc instructions.
+int nlz2a(unsigned x) {
+ unsigned y;
+ int n, c;
+
+ n = 32;
+ c = 16;
+ do {
+ y = x >> c; if (y != 0) {n = n - c; x = y;}
+ c = c >> 1;
+ } while (c != 0);
+ return n - x;
+}
+
+int nlz3(int x) {
+ int y, n;
+
+ n = 0;
+ y = x;
+L: if (x < 0) return n;
+ if (y == 0) return 32 - n;
+ n = n + 1;
+ x = x << 1;
+ y = y >> 1;
+ goto L;
+}
+
+int nlz4(unsigned x) {
+ int y, m, n;
+
+ y = -(x >> 16); // If left half of x is 0,
+ m = (y >> 16) & 16; // set n = 16. If left half
+ n = 16 - m; // is nonzero, set n = 0 and
+ x = x >> m; // shift x right 16.
+ // Now x is of the form 0000xxxx.
+ y = x - 0x100; // If positions 8-15 are 0,
+ m = (y >> 16) & 8; // add 8 to n and shift x left 8.
+ n = n + m;
+ x = x << m;
+
+ y = x - 0x1000; // If positions 12-15 are 0,
+ m = (y >> 16) & 4; // add 4 to n and shift x left 4.
+ n = n + m;
+ x = x << m;
+
+ y = x - 0x4000; // If positions 14-15 are 0,
+ m = (y >> 16) & 2; // add 2 to n and shift x left 2.
+ n = n + m;
+ x = x << m;
+
+ y = x >> 14; // Set y = 0, 1, 2, or 3.
+ m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp.
+ return n + 2 - m;
+}
+
+int nlz5(unsigned x) {
+ int pop(unsigned x);
+
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return pop(~x);
+}
+
+/* The four programs below are not valid ANSI C programs. This is
+because they refer to the same storage locations as two different types.
+However, they work with xlc/AIX, gcc/AIX, and gcc/NT. If you try to
+code them more compactly by declaring a variable xx to be "double," and
+then using
+
+ n = 1054 - (*((unsigned *)&xx + LE) >> 20);
+
+then you are violating not only the rule above, but also the ANSI C
+rule that pointer arithmetic can be performed only on pointers to
+array elements.
+ When coded with the above statement, the program fails with xlc,
+gcc/AIX, and gcc/NT, at some optimization levels.
+ BTW, these programs use the "anonymous union" feature of C++, not
+available in C. */
+
+int nlz6(unsigned k)
+{
+ union {
+ unsigned asInt[2];
+ double asDouble;
+ };
+ int n;
+
+ asDouble = static_cast<double>(k) + 0.5;
+ n = 1054 - (asInt[LE] >> 20);
+ return n;
+}
+
+int nlz7(unsigned k)
+{
+ union {
+ unsigned asInt[2];
+ double asDouble;
+ };
+ int n;
+
+ asDouble = static_cast<double>(k);
+ n = 1054 - (asInt[LE] >> 20);
+ n = (n & 31) + (n >> 9);
+ return n;
+}
+
+ /* In single qualifier, round-to-nearest mode, the basic method fails for:
+ k = 0, k = 01FFFFFF, 03FFFFFE <= k <= 03FFFFFF,
+ 07FFFFFC <= k <= 07FFFFFF,
+ 0FFFFFF8 <= k <= 0FFFFFFF,
+ ...
+ 7FFFFFC0 <= k <= 7FFFFFFF.
+ FFFFFF80 <= k <= FFFFFFFF.
+ For k = 0 it gives 158, and for the other values it is too low by 1. */
+
+int nlz8(unsigned k)
+{
+ union {
+ unsigned asInt;
+ float asFloat;
+ };
+ int n;
+
+ k = k & ~(k >> 1); /* Fix problem with rounding. */
+ asFloat = static_cast<float>(k) + 0.5f;
+ n = 158 - (asInt >> 23);
+ return n;
+}
+
+/* The example below shows how to make a macro for nlz. It uses an
+extension to the C and C++ languages that is provided by the GNU C/C++
+compiler, namely, that of allowing statements and declarations in
+expressions (see "Using and Porting GNU CC", by Richard M. Stallman
+(1998). The underscores are necessary to protect against the
+possibility that the macro argument will conflict with one of its local
+variables, e.g., NLZ(k). */
+
+int nlz9(unsigned k)
+{
+ union {
+ unsigned asInt;
+ float asFloat;
+ };
+ int n;
+
+ k = k & ~(k >> 1); /* Fix problem with rounding. */
+ asFloat = static_cast<float>(k);
+ n = 158 - (asInt >> 23);
+ n = (n & 31) + (n >> 6); /* Fix problem with k = 0. */
+ return n;
+}
+
+/* Below are three nearly equivalent programs for computing the number
+of leading zeros in a word. This material is not in HD, but may be in a
+future edition.
+ Immediately below is Robert Harley's algorithm, found at the
+comp.arch newsgroup entry dated 7/12/96, pointed out to me by Norbert
+Juffa.
+ Table entries marked "u" are unused. 14 ops including a multiply,
+plus an indexed load.
+ The smallest multiplier that works is 0x045BCED1 = 17*65*129*513 (all
+of form 2**k + 1). There are no multipliers of three terms of the form
+2**k +- 1 that work, with a table size of 64 or 128. There are some,
+with a table size of 64, if you precede the multiplication with x = x -
+(x >> 1), but that seems less elegant. There are also some if you use a
+table size of 256, the smallest is 0x01033CBF = 65*255*1025 (this would
+save two instructions in the form of this algorithm with the
+multiplication expanded into shifts and adds, but the table size is
+getting a bit large). */
+
+#define u 99
+int nlz10(unsigned x)
+{
+ static char table[64] =
+ {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u,
+ u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u,
+ 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18,
+ 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u};
+
+ x = x | (x >> 1); // Propagate leftmost
+ x = x | (x >> 2); // 1-bit to the right.
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ x = x*0x06EB14F9; // Multiplier is 7*255**3.
+ return table[x >> 26];
+}
+
+/* Harley's algorithm with multiply expanded.
+19 elementary ops plus an indexed load. */
+
+int nlz10a(unsigned x)
+{
+ static char table[64] =
+ {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u,
+ u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u,
+ 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18,
+ 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u};
+
+ x = x | (x >> 1); // Propagate leftmost
+ x = x | (x >> 2); // 1-bit to the right.
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >> 16);
+ x = (x << 3) - x; // Multiply by 7.
+ x = (x << 8) - x; // Multiply by 255.
+ x = (x << 8) - x; // Again.
+ x = (x << 8) - x; // Again.
+ return table[x >> 26];
+}
+
+/* Julius Goryavsky's version of Harley's algorithm.
+17 elementary ops plus an indexed load, if the machine
+has "and not." */
+
+int nlz10b(unsigned x)
+{
+ static char table[64] =
+ {32,20,19, u, u,18, u, 7, 10,17, u, u,14, u, 6, u,
+ u, 9, u,16, u, u, 1,26, u,13, u, u,24, 5, u, u,
+ u,21, u, 8,11, u,15, u, u, u, u, 2,27, 0,25, u,
+ 22, u,12, u, u, 3,28, u, 23, u, 4,29, u, u,30,31};
+
+ x = x | (x >> 1); // Propagate leftmost
+ x = x | (x >> 2); // 1-bit to the right.
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x & ~(x >> 16);
+ x = x*0xFD7049FF; // Activate this line or the following 3.
+ // x = (x << 9) - x; // Multiply by 511.
+ // x = (x << 11) - x; // Multiply by 2047.
+ // x = (x << 14) - x; // Multiply by 16383.
+ return table[x >> 26];
+}
+
+int errors;
+void error(int x, int y)
+{
+ errors = errors + 1;
+ std::printf("Error for x = %08x, got %d\n", x, y);
+}
+
+int main()
+{
+# ifdef NDEBUG
+
+ int i, n;
+ static unsigned test[] = {0,32, 1,31, 2,30, 3,30, 4,29, 5,29, 6,29,
+ 7,29, 8,28, 9,28, 16,27, 32,26, 64,25, 128,24, 255,24, 256,23,
+ 512,22, 1024,21, 2048,20, 4096,19, 8192,18, 16384,17, 32768,16,
+ 65536,15, 0x20000,14, 0x40000,13, 0x80000,12, 0x100000,11,
+ 0x200000,10, 0x400000,9, 0x800000,8, 0x1000000,7, 0x2000000,6,
+ 0x4000000,5, 0x8000000,4, 0x0FFFFFFF,4, 0x10000000,3,
+ 0x3000FFFF,2, 0x50003333,1, 0x7FFFFFFF,1, 0x80000000,0,
+ 0xFFFFFFFF,0};
+ std::size_t const Count = 1000;
+
+ n = sizeof(test)/4;
+
+ std::clock_t TimestampBeg = 0;
+ std::clock_t TimestampEnd = 0;
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz1(test[i]) != test[i+1]) error(test[i], nlz1(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz1: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz1a(test[i]) != test[i+1]) error(test[i], nlz1a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz1a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz2(test[i]) != test[i+1]) error(test[i], nlz2(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz2: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz2a(test[i]) != test[i+1]) error(test[i], nlz2a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz2a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz3(test[i]) != test[i+1]) error(test[i], nlz3(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz3: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz4(test[i]) != test[i+1]) error(test[i], nlz4(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz4: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz5(test[i]) != test[i+1]) error(test[i], nlz5(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz5: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz6(test[i]) != test[i+1]) error(test[i], nlz6(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz6: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz7(test[i]) != test[i+1]) error(test[i], nlz7(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz7: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz8(test[i]) != test[i+1]) error(test[i], nlz8(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz8: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz9(test[i]) != test[i+1]) error(test[i], nlz9(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz9: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz10(test[i]) != test[i+1]) error(test[i], nlz10(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz10: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz10a(test[i]) != test[i+1]) error(test[i], nlz10a(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz10a: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ TimestampBeg = std::clock();
+ for (std::size_t k = 0; k < Count; ++k)
+ for (i = 0; i < n; i += 2) {
+ if (nlz10b(test[i]) != test[i+1]) error(test[i], nlz10b(test[i]));}
+ TimestampEnd = std::clock();
+
+ std::printf("nlz10b: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
+
+ if (errors == 0)
+ std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
+
+# endif//NDEBUG
+}
diff --git a/3rdparty/glm/source/test/core/core_func_matrix.cpp b/3rdparty/glm/source/test/core/core_func_matrix.cpp
new file mode 100644
index 0000000..c5b2007
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_matrix.cpp
@@ -0,0 +1,312 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/scalar_constants.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+#include <ctime>
+#include <cstdio>
+
+using namespace glm;
+
+int test_matrixCompMult()
+{
+ int Error(0);
+
+ {
+ mat2 m(0, 1, 2, 3);
+ mat2 n = matrixCompMult(m, m);
+ mat2 expected = mat2(0, 1, 4, 9);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat2x3 m(0, 1, 2, 3, 4, 5);
+ mat2x3 n = matrixCompMult(m, m);
+ mat2x3 expected = mat2x3(0, 1, 4, 9, 16, 25);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
+ mat2x4 n = matrixCompMult(m, m);
+ mat2x4 expected = mat2x4(0, 1, 4, 9, 16, 25, 36, 49);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
+ mat3 n = matrixCompMult(m, m);
+ mat3 expected = mat3(0, 1, 4, 9, 16, 25, 36, 49, 64);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3x2 m(0, 1, 2, 3, 4, 5);
+ mat3x2 n = matrixCompMult(m, m);
+ mat3x2 expected = mat3x2(0, 1, 4, 9, 16, 25);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ mat3x4 n = matrixCompMult(m, m);
+ mat3x4 expected = mat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ mat4 n = matrixCompMult(m, m);
+ mat4 expected = mat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
+ mat4x2 n = matrixCompMult(m, m);
+ mat4x2 expected = mat4x2(0, 1, 4, 9, 16, 25, 36, 49);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ mat4x3 n = matrixCompMult(m, m);
+ mat4x3 expected = mat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121);
+ Error += all(equal(n, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_outerProduct()
+{
+ { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); }
+ { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); }
+ { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); }
+
+ { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); }
+ { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); }
+
+ { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); }
+ { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); }
+
+ { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); }
+ { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); }
+
+ return 0;
+}
+
+int test_transpose()
+{
+ int Error(0);
+
+ {
+ mat2 const m(0, 1, 2, 3);
+ mat2 const t = transpose(m);
+ mat2 const expected = mat2(0, 2, 1, 3);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat2x3 m(0, 1, 2, 3, 4, 5);
+ mat3x2 t = transpose(m);
+ mat3x2 const expected = mat3x2(0, 3, 1, 4, 2, 5);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
+ mat4x2 t = transpose(m);
+ mat4x2 const expected = mat4x2(0, 4, 1, 5, 2, 6, 3, 7);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
+ mat3 t = transpose(m);
+ mat3 const expected = mat3(0, 3, 6, 1, 4, 7, 2, 5, 8);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3x2 m(0, 1, 2, 3, 4, 5);
+ mat2x3 t = transpose(m);
+ mat2x3 const expected = mat2x3(0, 2, 4, 1, 3, 5);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ mat4x3 t = transpose(m);
+ mat4x3 const expected = mat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ mat4 t = transpose(m);
+ mat4 const expected = mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
+ mat2x4 t = transpose(m);
+ mat2x4 const expected = mat2x4(0, 2, 4, 6, 1, 3, 5, 7);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ mat3x4 t = transpose(m);
+ mat3x4 const expected = mat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11);
+ Error += all(equal(t, expected, epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_determinant()
+{
+
+
+ return 0;
+}
+
+int test_inverse()
+{
+ int Error = 0;
+
+ {
+ glm::mat4x4 A4x4(
+ glm::vec4(1, 0, 1, 0),
+ glm::vec4(0, 1, 0, 0),
+ glm::vec4(0, 0, 1, 0),
+ glm::vec4(0, 0, 0, 1));
+ glm::mat4x4 B4x4 = inverse(A4x4);
+ glm::mat4x4 I4x4 = A4x4 * B4x4;
+ glm::mat4x4 Identity(1);
+ Error += all(equal(I4x4, Identity, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat3x3 A3x3(
+ glm::vec3(1, 0, 1),
+ glm::vec3(0, 1, 0),
+ glm::vec3(0, 0, 1));
+ glm::mat3x3 B3x3 = glm::inverse(A3x3);
+ glm::mat3x3 I3x3 = A3x3 * B3x3;
+ glm::mat3x3 Identity(1);
+ Error += all(equal(I3x3, Identity, epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::mat2x2 A2x2(
+ glm::vec2(1, 1),
+ glm::vec2(0, 1));
+ glm::mat2x2 B2x2 = glm::inverse(A2x2);
+ glm::mat2x2 I2x2 = A2x2 * B2x2;
+ glm::mat2x2 Identity(1);
+ Error += all(equal(I2x2, Identity, epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_inverse_simd()
+{
+ int Error = 0;
+
+ glm::mat4x4 const Identity(1);
+
+ glm::mat4x4 const A4x4(
+ glm::vec4(1, 0, 1, 0),
+ glm::vec4(0, 1, 0, 0),
+ glm::vec4(0, 0, 1, 0),
+ glm::vec4(0, 0, 0, 1));
+ glm::mat4x4 const B4x4 = glm::inverse(A4x4);
+ glm::mat4x4 const I4x4 = A4x4 * B4x4;
+
+ Error += glm::all(glm::equal(I4x4, Identity, 0.001f)) ? 0 : 1;
+
+ return Error;
+}
+
+template<typename VEC3, typename MAT4>
+int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Message)
+{
+ std::vector<MAT4> TestInputs;
+ TestInputs.resize(Count);
+ std::vector<MAT4> TestOutputs;
+ TestOutputs.resize(TestInputs.size());
+
+ VEC3 Axis(glm::normalize(VEC3(1.0f, 2.0f, 3.0f)));
+
+ for(std::size_t i = 0; i < TestInputs.size(); ++i)
+ {
+ typename MAT4::value_type f = static_cast<typename MAT4::value_type>(i + Instance) * typename MAT4::value_type(0.1) + typename MAT4::value_type(0.1);
+ TestInputs[i] = glm::rotate(glm::translate(MAT4(1), Axis * f), f, Axis);
+ //TestInputs[i] = glm::translate(MAT4(1), Axis * f);
+ }
+
+ std::clock_t StartTime = std::clock();
+
+ for(std::size_t i = 0; i < TestInputs.size(); ++i)
+ TestOutputs[i] = glm::inverse(TestInputs[i]);
+
+ std::clock_t EndTime = std::clock();
+
+ for(std::size_t i = 0; i < TestInputs.size(); ++i)
+ TestOutputs[i] = TestOutputs[i] * TestInputs[i];
+
+ typename MAT4::value_type Diff(0);
+ for(std::size_t Entry = 0; Entry < TestOutputs.size(); ++Entry)
+ {
+ MAT4 i(1.0);
+ MAT4 m(TestOutputs[Entry]);
+ for(glm::length_t y = 0; y < m.length(); ++y)
+ for(glm::length_t x = 0; x < m[y].length(); ++x)
+ Diff = glm::max(m[y][x], i[y][x]);
+ }
+
+ //glm::uint Ulp = 0;
+ //Ulp = glm::max(glm::float_distance(*Dst, *Src), Ulp);
+
+ std::printf("inverse<%s>(%f): %lu\n", Message, static_cast<double>(Diff), EndTime - StartTime);
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+ Error += test_matrixCompMult();
+ Error += test_outerProduct();
+ Error += test_transpose();
+ Error += test_determinant();
+ Error += test_inverse();
+ Error += test_inverse_simd();
+
+# ifdef NDEBUG
+ std::size_t const Samples = 1000;
+# else
+ std::size_t const Samples = 1;
+# endif//NDEBUG
+
+ for(std::size_t i = 0; i < 1; ++i)
+ {
+ Error += test_inverse_perf<glm::vec3, glm::mat4>(Samples, i, "mat4");
+ Error += test_inverse_perf<glm::dvec3, glm::dmat4>(Samples, i, "dmat4");
+ }
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_noise.cpp b/3rdparty/glm/source/test/core/core_func_noise.cpp
new file mode 100644
index 0000000..4f0b430
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_noise.cpp
@@ -0,0 +1,7 @@
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_packing.cpp b/3rdparty/glm/source/test/core/core_func_packing.cpp
new file mode 100644
index 0000000..c3cd14a
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_packing.cpp
@@ -0,0 +1,156 @@
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/packing.hpp>
+#include <vector>
+
+int test_packUnorm2x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.0f));
+ A.push_back(glm::vec2(0.5f, 0.7f));
+ A.push_back(glm::vec2(0.1f, 0.2f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint32 C = glm::packUnorm2x16(B);
+ glm::vec2 D = glm::unpackUnorm2x16(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm2x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2( 1.0f, 0.0f));
+ A.push_back(glm::vec2(-0.5f,-0.7f));
+ A.push_back(glm::vec2(-0.1f, 0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint32 C = glm::packSnorm2x16(B);
+ glm::vec2 D = glm::unpackSnorm2x16(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm4x8()
+{
+ int Error = 0;
+
+ glm::uint32 Packed = glm::packUnorm4x8(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f));
+ glm::u8vec4 Vec(255, 128, 0, 255);
+ glm::uint32 & Ref = *reinterpret_cast<glm::uint32*>(&Vec[0]);
+
+ Error += Packed == Ref ? 0 : 1;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f));
+ A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint32 C = glm::packUnorm4x8(B);
+ glm::vec4 D = glm::unpackUnorm4x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm4x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f));
+ A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint32 C = glm::packSnorm4x8(B);
+ glm::vec4 D = glm::unpackSnorm4x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packHalf2x16()
+{
+ int Error = 0;
+/*
+ std::vector<glm::hvec2> A;
+ A.push_back(glm::hvec2(glm::half( 1.0f), glm::half( 2.0f)));
+ A.push_back(glm::hvec2(glm::half(-1.0f), glm::half(-2.0f)));
+ A.push_back(glm::hvec2(glm::half(-1.1f), glm::half( 1.1f)));
+*/
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2( 1.0f, 2.0f));
+ A.push_back(glm::vec2(-1.0f,-2.0f));
+ A.push_back(glm::vec2(-1.1f, 1.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint C = glm::packHalf2x16(B);
+ glm::vec2 D = glm::unpackHalf2x16(C);
+ //Error += B == D ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packDouble2x32()
+{
+ int Error = 0;
+
+ std::vector<glm::uvec2> A;
+ A.push_back(glm::uvec2( 1, 2));
+ A.push_back(glm::uvec2(-1,-2));
+ A.push_back(glm::uvec2(-1000, 1100));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::uvec2 B(A[i]);
+ double C = glm::packDouble2x32(B);
+ glm::uvec2 D = glm::unpackDouble2x32(C);
+ Error += B == D ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_packSnorm4x8();
+ Error += test_packUnorm4x8();
+ Error += test_packSnorm2x16();
+ Error += test_packUnorm2x16();
+ Error += test_packHalf2x16();
+ Error += test_packDouble2x32();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_swizzle.cpp b/3rdparty/glm/source/test/core/core_func_swizzle.cpp
new file mode 100644
index 0000000..9758533
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_swizzle.cpp
@@ -0,0 +1,164 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/glm.hpp>
+
+static int test_ivec2_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::ivec2 A(1, 2);
+ glm::ivec2 B = A.yx();
+ glm::ivec2 C = B.yx();
+
+ Error += A != B ? 0 : 1;
+ Error += A == C ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec2 A(1, 2);
+ glm::ivec2 B = A.yx;
+ glm::ivec2 C = A.yx;
+
+ Error += A != B ? 0 : 1;
+ Error += B == C ? 0 : 1;
+
+ B.xy = B.yx;
+ C.xy = C.yx;
+
+ Error += B == C ? 0 : 1;
+
+ glm::ivec2 D(0, 0);
+ D.yx = A.xy;
+ Error += A.yx() == D ? 0 : 1;
+
+ glm::ivec2 E = A.yx;
+ Error += E == D ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE
+
+ return Error;
+}
+
+int test_ivec3_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::ivec3 A(1, 2, 3);
+ glm::ivec3 B = A.zyx();
+ glm::ivec3 C = B.zyx();
+
+ Error += A != B ? 0 : 1;
+ Error += A == C ? 0 : 1;
+ }
+# endif
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec2 B = A.yx;
+ glm::ivec2 C = A.yx;
+
+ Error += A.yx() == B ? 0 : 1;
+ Error += B == C ? 0 : 1;
+
+ B.xy = B.yx;
+ C.xy = C.yx;
+
+ Error += B == C ? 0 : 1;
+
+ glm::ivec2 D(0, 0);
+ D.yx = A.xy;
+
+ Error += A.yx() == D ? 0 : 1;
+
+ glm::ivec2 E(0, 0);
+ E.xy = A.xy();
+
+ Error += E == A.xy() ? 0 : 1;
+ Error += E.xy() == A.xy() ? 0 : 1;
+
+ glm::ivec3 const F = A.xxx + A.xxx;
+ Error += F == glm::ivec3(2) ? 0 : 1;
+
+ glm::ivec3 const G = A.xxx - A.xxx;
+ Error += G == glm::ivec3(0) ? 0 : 1;
+
+ glm::ivec3 const H = A.xxx * A.xxx;
+ Error += H == glm::ivec3(1) ? 0 : 1;
+
+ glm::ivec3 const I = A.xxx / A.xxx;
+ Error += I == glm::ivec3(1) ? 0 : 1;
+
+ glm::ivec3 J(1, 2, 3);
+ J.xyz += glm::ivec3(1);
+ Error += J == glm::ivec3(2, 3, 4) ? 0 : 1;
+
+ glm::ivec3 K(1, 2, 3);
+ K.xyz += A.xyz;
+ Error += K == glm::ivec3(2, 4, 6) ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+int test_ivec4_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::ivec4 A(1, 2, 3, 4);
+ glm::ivec4 B = A.wzyx();
+ glm::ivec4 C = B.wzyx();
+
+ Error += A != B ? 0 : 1;
+ Error += A == C ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+int test_vec4_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::vec4 A(1, 2, 3, 4);
+ glm::vec4 B = A.wzyx();
+ glm::vec4 C = B.wzyx();
+
+ Error += glm::any(glm::notEqual(A, B, 0.0001f)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+
+ float D = glm::dot(C.wzyx(), C.xyzw());
+ Error += glm::equal(D, 20.f, 0.001f) ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ivec2_swizzle();
+ Error += test_ivec3_swizzle();
+ Error += test_ivec4_swizzle();
+ Error += test_vec4_swizzle();
+
+ return Error;
+}
+
+
+
diff --git a/3rdparty/glm/source/test/core/core_func_trigonometric.cpp b/3rdparty/glm/source/test/core/core_func_trigonometric.cpp
new file mode 100644
index 0000000..3172340
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_trigonometric.cpp
@@ -0,0 +1,10 @@
+#include <glm/trigonometric.hpp>
+
+int main()
+{
+ int Error = 0;
+
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_func_vector_relational.cpp b/3rdparty/glm/source/test/core/core_func_vector_relational.cpp
new file mode 100644
index 0000000..0a4e7e7
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_func_vector_relational.cpp
@@ -0,0 +1,180 @@
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/gtc/vec1.hpp>
+
+static int test_not()
+{
+ int Error = 0;
+
+ {
+ glm::bvec1 v(false);
+ Error += glm::all(glm::not_(v)) ? 0 : 1;
+ }
+
+ {
+ glm::bvec2 v(false);
+ Error += glm::all(glm::not_(v)) ? 0 : 1;
+ }
+
+ {
+ glm::bvec3 v(false);
+ Error += glm::all(glm::not_(v)) ? 0 : 1;
+ }
+
+ {
+ glm::bvec4 v(false);
+ Error += glm::all(glm::not_(v)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_less()
+{
+ int Error = 0;
+
+ {
+ glm::vec2 const A(1, 2);
+ glm::vec2 const B(2, 3);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+ Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1;
+ }
+
+ {
+ glm::vec3 const A(1, 2, 3);
+ glm::vec3 const B(2, 3, 4);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+ Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1;
+ }
+
+ {
+ glm::vec4 const A(1, 2, 3, 4);
+ glm::vec4 const B(2, 3, 4, 5);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+ Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1;
+ }
+
+ {
+ glm::ivec2 const A(1, 2);
+ glm::ivec2 const B(2, 3);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+
+ glm::ivec2 const C(1, 3);
+ Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec3 const B(2, 3, 4);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+
+ glm::ivec3 const C(1, 3, 4);
+ Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ glm::ivec4 const B(2, 3, 4, 5);
+ Error += glm::all(glm::lessThan(A, B)) ? 0: 1;
+
+ glm::ivec4 const C(1, 3, 4, 5);
+ Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1;
+ }
+
+ return Error;
+}
+
+static int test_greater()
+{
+ int Error = 0;
+
+ {
+ glm::vec2 const A(1, 2);
+ glm::vec2 const B(2, 3);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+ Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1;
+ }
+
+ {
+ glm::vec3 const A(1, 2, 3);
+ glm::vec3 const B(2, 3, 4);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+ Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1;
+ }
+
+ {
+ glm::vec4 const A(1, 2, 3, 4);
+ glm::vec4 const B(2, 3, 4, 5);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+ Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1;
+ }
+
+ {
+ glm::ivec2 const A(1, 2);
+ glm::ivec2 const B(2, 3);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+
+ glm::ivec2 const C(1, 3);
+ Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec3 const B(2, 3, 4);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+
+ glm::ivec3 const C(1, 3, 4);
+ Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ glm::ivec4 const B(2, 3, 4, 5);
+ Error += glm::all(glm::greaterThan(B, A)) ? 0: 1;
+
+ glm::ivec4 const C(1, 3, 4, 5);
+ Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1;
+ }
+
+ return Error;
+}
+
+static int test_equal()
+{
+ int Error = 0;
+
+ {
+ glm::ivec2 const A(1, 2);
+ glm::ivec2 const B(1, 2);
+ Error += glm::all(glm::equal(B, A)) ? 0: 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec3 const B(1, 2, 3);
+ Error += glm::all(glm::equal(B, A)) ? 0: 1;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ glm::ivec4 const B(1, 2, 3, 4);
+ Error += glm::all(glm::equal(B, A)) ? 0: 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_not();
+ Error += test_less();
+ Error += test_greater();
+ Error += test_equal();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp b/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp
new file mode 100644
index 0000000..32bb63c
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp
@@ -0,0 +1,12 @@
+#ifndef GLM_FORCE_CXX98
+# define GLM_FORCE_CXX98
+#endif
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp b/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp
new file mode 100644
index 0000000..36010e3
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp
@@ -0,0 +1,22 @@
+#define GLM_FORCE_SIZE_T_LENGTH
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+template <typename genType>
+genType add(genType const& a, genType const& b)
+{
+ genType result(0);
+ for(glm::length_t i = 0; i < a.length(); ++i)
+ result[i] = a[i] + b[i];
+ return result;
+}
+
+int main()
+{
+ int Error = 0;
+
+ glm::ivec4 v(1);
+ Error += add(v, v) == glm::ivec4(2) ? 0 : 1;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_setup_message.cpp b/3rdparty/glm/source/test/core/core_setup_message.cpp
new file mode 100644
index 0000000..7594743
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_setup_message.cpp
@@ -0,0 +1,230 @@
+#define GLM_FORCE_MESSAGES
+#include <glm/vec3.hpp>
+#include <cstdio>
+
+int test_compiler()
+{
+ int Error(0);
+
+ if(GLM_COMPILER & GLM_COMPILER_VC)
+ {
+ switch(GLM_COMPILER)
+ {
+ case GLM_COMPILER_VC12:
+ std::printf("Visual C++ 12 - 2013\n");
+ break;
+ case GLM_COMPILER_VC14:
+ std::printf("Visual C++ 14 - 2015\n");
+ break;
+ case GLM_COMPILER_VC15:
+ std::printf("Visual C++ 15 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_3:
+ std::printf("Visual C++ 15.3 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_5:
+ std::printf("Visual C++ 15.5 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_6:
+ std::printf("Visual C++ 15.6 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_7:
+ std::printf("Visual C++ 15.7 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_8:
+ std::printf("Visual C++ 15.8 - 2017\n");
+ break;
+ case GLM_COMPILER_VC15_9:
+ std::printf("Visual C++ 15.9 - 2017\n");
+ break;
+ case GLM_COMPILER_VC16:
+ std::printf("Visual C++ 16 - 2019\n");
+ break;
+ default:
+ std::printf("Visual C++ version not detected\n");
+ Error += 1;
+ break;
+ }
+ }
+ else if(GLM_COMPILER & GLM_COMPILER_GCC)
+ {
+ switch(GLM_COMPILER)
+ {
+ case GLM_COMPILER_GCC46:
+ std::printf("GCC 4.6\n");
+ break;
+ case GLM_COMPILER_GCC47:
+ std::printf("GCC 4.7\n");
+ break;
+ case GLM_COMPILER_GCC48:
+ std::printf("GCC 4.8\n");
+ break;
+ case GLM_COMPILER_GCC49:
+ std::printf("GCC 4.9\n");
+ break;
+ case GLM_COMPILER_GCC5:
+ std::printf("GCC 5\n");
+ break;
+ case GLM_COMPILER_GCC6:
+ std::printf("GCC 6\n");
+ break;
+ case GLM_COMPILER_GCC7:
+ std::printf("GCC 7\n");
+ break;
+ case GLM_COMPILER_GCC8:
+ std::printf("GCC 8\n");
+ break;
+ default:
+ std::printf("GCC version not detected\n");
+ Error += 1;
+ break;
+ }
+ }
+ else if(GLM_COMPILER & GLM_COMPILER_CUDA)
+ {
+ std::printf("CUDA\n");
+ }
+ else if(GLM_COMPILER & GLM_COMPILER_CLANG)
+ {
+ switch(GLM_COMPILER)
+ {
+ case GLM_COMPILER_CLANG34:
+ std::printf("Clang 3.4\n");
+ break;
+ case GLM_COMPILER_CLANG35:
+ std::printf("Clang 3.5\n");
+ break;
+ case GLM_COMPILER_CLANG36:
+ std::printf("Clang 3.6\n");
+ break;
+ case GLM_COMPILER_CLANG37:
+ std::printf("Clang 3.7\n");
+ break;
+ case GLM_COMPILER_CLANG38:
+ std::printf("Clang 3.8\n");
+ break;
+ case GLM_COMPILER_CLANG39:
+ std::printf("Clang 3.9\n");
+ break;
+ case GLM_COMPILER_CLANG40:
+ std::printf("Clang 4.0\n");
+ break;
+ case GLM_COMPILER_CLANG41:
+ std::printf("Clang 4.1\n");
+ break;
+ case GLM_COMPILER_CLANG42:
+ std::printf("Clang 4.2\n");
+ break;
+ default:
+ std::printf("LLVM version not detected\n");
+ break;
+ }
+ }
+ else if(GLM_COMPILER & GLM_COMPILER_INTEL)
+ {
+ switch(GLM_COMPILER)
+ {
+ case GLM_COMPILER_INTEL14:
+ std::printf("ICC 14 - 2013 SP1\n");
+ break;
+ case GLM_COMPILER_INTEL15:
+ std::printf("ICC 15 - 2015\n");
+ break;
+ case GLM_COMPILER_INTEL16:
+ std::printf("ICC 16 - 2017\n");
+ break;
+ case GLM_COMPILER_INTEL17:
+ std::printf("ICC 17 - 20XX\n");
+ break;
+ default:
+ std::printf("Intel compiler version not detected\n");
+ Error += 1;
+ break;
+ }
+ }
+ else
+ {
+ std::printf("Undetected compiler\n");
+ Error += 1;
+ }
+
+ return Error;
+}
+
+int test_model()
+{
+ int Error = 0;
+
+ Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1;
+
+ if(GLM_MODEL == GLM_MODEL_32)
+ std::printf("GLM_MODEL_32\n");
+ else if(GLM_MODEL == GLM_MODEL_64)
+ std::printf("GLM_MODEL_64\n");
+
+ return Error;
+}
+
+int test_instruction_set()
+{
+ int Error = 0;
+
+ std::printf("GLM_ARCH: ");
+
+ if(GLM_ARCH & GLM_ARCH_ARM_BIT)
+ std::printf("ARM ");
+ if(GLM_ARCH & GLM_ARCH_NEON_BIT)
+ std::printf("NEON ");
+ if(GLM_ARCH & GLM_ARCH_AVX2_BIT)
+ std::printf("AVX2 ");
+ if(GLM_ARCH & GLM_ARCH_AVX_BIT)
+ std::printf("AVX ");
+ if(GLM_ARCH & GLM_ARCH_SSE42_BIT)
+ std::printf("SSE4.2 ");
+ if(GLM_ARCH & GLM_ARCH_SSE41_BIT)
+ std::printf("SSE4.1 ");
+ if(GLM_ARCH & GLM_ARCH_SSSE3_BIT)
+ std::printf("SSSE3 ");
+ if(GLM_ARCH & GLM_ARCH_SSE3_BIT)
+ std::printf("SSE3 ");
+ if(GLM_ARCH & GLM_ARCH_SSE2_BIT)
+ std::printf("SSE2 ");
+
+ std::printf("\n");
+
+ return Error;
+}
+
+int test_cpp_version()
+{
+ std::printf("__cplusplus: %d\n", static_cast<int>(__cplusplus));
+
+ return 0;
+}
+
+int test_operators()
+{
+ glm::ivec3 A(1);
+ glm::ivec3 B(1);
+ bool R = A != B;
+ bool S = A == B;
+
+ return (S && !R) ? 0 : 1;
+}
+
+int main()
+{
+ int Error = 0;
+
+# if !defined(GLM_FORCE_PLATFORM_UNKNOWN) && !defined(GLM_FORCE_COMPILER_UNKNOWN) && !defined(GLM_FORCE_ARCH_UNKNOWN) && !defined(GLM_FORCE_CXX_UNKNOWN)
+
+ Error += test_cpp_version();
+ Error += test_compiler();
+ Error += test_model();
+ Error += test_instruction_set();
+ Error += test_operators();
+
+# endif
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp b/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp
new file mode 100644
index 0000000..9feaee3
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp
@@ -0,0 +1,21 @@
+#ifndef GLM_FORCE_PLATFORM_UNKNOWN
+# define GLM_FORCE_PLATFORM_UNKNOWN
+#endif
+#ifndef GLM_FORCE_COMPILER_UNKNOWN
+# define GLM_FORCE_COMPILER_UNKNOWN
+#endif
+#ifndef GLM_FORCE_ARCH_UNKNOWN
+# define GLM_FORCE_ARCH_UNKNOWN
+#endif
+#ifndef GLM_FORCE_CXX_UNKNOWN
+# define GLM_FORCE_CXX_UNKNOWN
+#endif
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_setup_precision.cpp b/3rdparty/glm/source/test/core/core_setup_precision.cpp
new file mode 100644
index 0000000..b44bc50
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_setup_precision.cpp
@@ -0,0 +1,58 @@
+#define GLM_FORCE_INLINE
+#define GLM_PRECISION_HIGHP_FLOAT
+#include <glm/glm.hpp>
+#include <glm/ext.hpp>
+
+static int test_mat()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1;
+ Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1;
+ Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1;
+
+ Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1;
+ Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1;
+ Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1;
+ Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1;
+ Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1;
+ Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1;
+ Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1;
+ Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1;
+ Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1;
+ Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1;
+ Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_dvec()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1;
+ Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_mat();
+ Error += test_vec();
+ Error += test_dvec();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_aligned.cpp b/3rdparty/glm/source/test/core/core_type_aligned.cpp
new file mode 100644
index 0000000..dff0939
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_aligned.cpp
@@ -0,0 +1,92 @@
+#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+#include <glm/glm.hpp>
+
+#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+#include <type_traits>
+
+static_assert(sizeof(glm::bvec4) > sizeof(glm::bvec2), "Invalid sizeof");
+static_assert(sizeof(glm::ivec4) > sizeof(glm::uvec2), "Invalid sizeof");
+static_assert(sizeof(glm::dvec4) > sizeof(glm::dvec2), "Invalid sizeof");
+
+static_assert(sizeof(glm::bvec4) == sizeof(glm::bvec3), "Invalid sizeof");
+static_assert(sizeof(glm::uvec4) == sizeof(glm::uvec3), "Invalid sizeof");
+static_assert(sizeof(glm::dvec4) == sizeof(glm::dvec3), "Invalid sizeof");
+
+static int test_storage_aligned()
+{
+ int Error = 0;
+
+ size_t size1_aligned = sizeof(glm::detail::storage<1, int, true>::type);
+ Error += size1_aligned == sizeof(int) * 1 ? 0 : 1;
+ size_t size2_aligned = sizeof(glm::detail::storage<2, int, true>::type);
+ Error += size2_aligned == sizeof(int) * 2 ? 0 : 1;
+ size_t size4_aligned = sizeof(glm::detail::storage<4, int, true>::type);
+ Error += size4_aligned == sizeof(int) * 4 ? 0 : 1;
+
+ size_t align1_aligned = alignof(glm::detail::storage<1, int, true>::type);
+ Error += align1_aligned == 4 ? 0 : 1;
+ size_t align2_aligned = alignof(glm::detail::storage<2, int, true>::type);
+ Error += align2_aligned == 8 ? 0 : 1;
+ size_t align4_aligned = alignof(glm::detail::storage<4, int, true>::type);
+ Error += align4_aligned == 16 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_storage_unaligned()
+{
+ int Error = 0;
+
+ size_t align1_unaligned = alignof(glm::detail::storage<1, int, false>::type);
+ Error += align1_unaligned == sizeof(int) ? 0 : 1;
+ size_t align2_unaligned = alignof(glm::detail::storage<2, int, false>::type);
+ Error += align2_unaligned == sizeof(int) ? 0 : 1;
+ size_t align3_unaligned = alignof(glm::detail::storage<3, int, false>::type);
+ Error += align3_unaligned == sizeof(int) ? 0 : 1;
+ size_t align4_unaligned = alignof(glm::detail::storage<4, int, false>::type);
+ Error += align4_unaligned == sizeof(int) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec3_aligned()
+{
+ int Error = 0;
+
+ struct Struct1
+ {
+ glm::vec4 A;
+ float B;
+ glm::vec3 C;
+ };
+
+ std::size_t const Size1 = sizeof(Struct1);
+ Error += Size1 == 48 ? 0 : 1;
+
+ struct Struct2
+ {
+ glm::vec4 A;
+ glm::vec3 B;
+ float C;
+ };
+
+ std::size_t const Size2 = sizeof(Struct2);
+ Error += Size2 == 48 ? 0 : 1;
+
+ return Error;
+}
+
+#endif
+
+int main()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+ Error += test_storage_aligned();
+ Error += test_storage_unaligned();
+ Error += test_vec3_aligned();
+# endif
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_cast.cpp b/3rdparty/glm/source/test/core/core_type_cast.cpp
new file mode 100644
index 0000000..7ff1901
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_cast.cpp
@@ -0,0 +1,146 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/glm.hpp>
+#include <algorithm>
+#include <vector>
+#include <iterator>
+
+struct my_vec2
+{
+ operator glm::vec2() { return glm::vec2(x, y); }
+ float x, y;
+};
+
+int test_vec2_cast()
+{
+ glm::vec2 A(1.0f, 2.0f);
+ glm::lowp_vec2 B(A);
+ glm::mediump_vec2 C(A);
+ glm::highp_vec2 D(A);
+
+ glm::vec2 E = static_cast<glm::vec2>(A);
+ glm::lowp_vec2 F = static_cast<glm::lowp_vec2>(A);
+ glm::mediump_vec2 G = static_cast<glm::mediump_vec2>(A);
+ glm::highp_vec2 H = static_cast<glm::highp_vec2>(A);
+
+ my_vec2 I;
+ glm::vec2 J = static_cast<glm::vec2>(I);
+ glm::vec2 K(7.8f);
+
+ int Error(0);
+
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(B, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(C, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(D, H, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_vec3_cast()
+{
+ glm::vec3 A(1.0f, 2.0f, 3.0f);
+ glm::lowp_vec3 B(A);
+ glm::mediump_vec3 C(A);
+ glm::highp_vec3 D(A);
+
+ glm::vec3 E = static_cast<glm::vec3>(A);
+ glm::lowp_vec3 F = static_cast<glm::lowp_vec3>(A);
+ glm::mediump_vec3 G = static_cast<glm::mediump_vec3>(A);
+ glm::highp_vec3 H = static_cast<glm::highp_vec3>(A);
+
+ int Error(0);
+
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(B, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(C, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(D, H, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_vec4_cast()
+{
+ glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::lowp_vec4 B(A);
+ glm::mediump_vec4 C(A);
+ glm::highp_vec4 D(A);
+
+ glm::vec4 E = static_cast<glm::vec4>(A);
+ glm::lowp_vec4 F = static_cast<glm::lowp_vec4>(A);
+ glm::mediump_vec4 G = static_cast<glm::mediump_vec4>(A);
+ glm::highp_vec4 H = static_cast<glm::highp_vec4>(A);
+
+ int Error(0);
+
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(B, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(C, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(D, H, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_std_copy()
+{
+ int Error = 0;
+
+ {
+ std::vector<int> High;
+ High.resize(64);
+ std::vector<int> Medium(High.size());
+
+ std::copy(High.begin(), High.end(), Medium.begin());
+
+ *Medium.begin() = *High.begin();
+ }
+
+ {
+ std::vector<glm::dvec4> High4;
+ High4.resize(64);
+ std::vector<glm::vec4> Medium4(High4.size());
+
+ std::copy(High4.begin(), High4.end(), Medium4.begin());
+
+ *Medium4.begin() = *High4.begin();
+ }
+
+ {
+ std::vector<glm::dvec3> High3;
+ High3.resize(64);
+ std::vector<glm::vec3> Medium3(High3.size());
+
+ std::copy(High3.begin(), High3.end(), Medium3.begin());
+
+ *Medium3.begin() = *High3.begin();
+ }
+
+ {
+ std::vector<glm::dvec2> High2;
+ High2.resize(64);
+ std::vector<glm::vec2> Medium2(High2.size());
+
+ std::copy(High2.begin(), High2.end(), Medium2.begin());
+
+ *Medium2.begin() = *High2.begin();
+ }
+
+ glm::dvec4 v1;
+ glm::vec4 v2;
+
+ v2 = v1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_std_copy();
+ Error += test_vec2_cast();
+ Error += test_vec3_cast();
+ Error += test_vec4_cast();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_ctor.cpp b/3rdparty/glm/source/test/core/core_type_ctor.cpp
new file mode 100644
index 0000000..078fcdf
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_ctor.cpp
@@ -0,0 +1,351 @@
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/glm.hpp>
+
+static int test_vec1_ctor()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+ {
+ union pack
+ {
+ glm::vec1 f;
+ glm::ivec1 i;
+ } A, B;
+
+ A.f = glm::vec1(0);
+ Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1;
+
+ B.f = glm::vec1(1);
+ Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+
+ return Error;
+}
+
+static int test_vec2_ctor()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+ {
+ union pack
+ {
+ glm::vec2 f;
+ glm::ivec2 i;
+ } A, B;
+
+ A.f = glm::vec2(0);
+ Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1;
+
+ B.f = glm::vec2(1);
+ Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+static int test_vec3_ctor()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+ {
+ union pack
+ {
+ glm::vec3 f;
+ glm::ivec3 i;
+ } A, B;
+
+ A.f = glm::vec3(0);
+ Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1;
+
+ B.f = glm::vec3(1);
+ Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+static int test_vec4_ctor()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+ {
+ union pack
+ {
+ glm::vec4 f;
+ glm::ivec4 i;
+ } A, B;
+
+ A.f = glm::vec4(0);
+ Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1;
+
+ B.f = glm::vec4(1);
+ Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1;
+ }
+# endif
+
+ return Error;
+}
+
+static int test_mat2x2_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat2x2 f;
+ glm::mat2x2 i;
+ } A, B;
+
+ A.f = glm::mat2x2(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat2x2(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat2x3_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat2x3 f;
+ glm::mat2x3 i;
+ } A, B;
+
+ A.f = glm::mat2x3(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat2x3(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat2x4_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat2x4 f;
+ glm::mat2x4 i;
+ } A, B;
+
+ A.f = glm::mat2x4(0);
+ glm::vec4 const C(0, 0, 0, 0);
+ Error += glm::all(glm::equal(A.i[0], C, glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat2x4(1);
+ glm::vec4 const D(1, 0, 0, 0);
+ Error += glm::all(glm::equal(B.i[0], D, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat3x2_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat3x2 f;
+ glm::mat3x2 i;
+ } A, B;
+
+ A.f = glm::mat3x2(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat3x2(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat3x3_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat3x3 f;
+ glm::mat3x3 i;
+ } A, B;
+
+ A.f = glm::mat3x3(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat3x3(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat3x4_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat3x4 f;
+ glm::mat3x4 i;
+ } A, B;
+
+ A.f = glm::mat3x4(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat3x4(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat4x2_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat4x2 f;
+ glm::mat4x2 i;
+ } A, B;
+
+ A.f = glm::mat4x2(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat4x2(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat4x3_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat4x3 f;
+ glm::mat4x3 i;
+ } A, B;
+
+ A.f = glm::mat4x3(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat4x3(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_mat4x4_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::mat4 f;
+ glm::mat4 i;
+ } A, B;
+
+ A.f = glm::mat4(0);
+ Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::mat4(1);
+ Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+static int test_quat_ctor()
+{
+ int Error = 0;
+
+# if GLM_LANG & GLM_LANG_CXX11_FLAG
+ {
+ union pack
+ {
+ glm::quat f;
+ glm::quat i;
+ } A, B;
+
+ A.f = glm::quat(0, 0, 0, 0);
+ Error += glm::all(glm::equal(A.i, glm::quat(0, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+
+ B.f = glm::quat(1, 1, 1, 1);
+ Error += glm::all(glm::equal(B.i, glm::quat(1, 1, 1, 1), glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_LANG & GLM_LANG_CXX11_FLAG
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec1_ctor();
+ Error += test_vec2_ctor();
+ Error += test_vec3_ctor();
+ Error += test_vec4_ctor();
+ Error += test_mat2x2_ctor();
+ Error += test_mat2x3_ctor();
+ Error += test_mat2x4_ctor();
+ Error += test_mat3x2_ctor();
+ Error += test_mat3x3_ctor();
+ Error += test_mat3x4_ctor();
+ Error += test_mat4x2_ctor();
+ Error += test_mat4x3_ctor();
+ Error += test_mat4x4_ctor();
+ Error += test_quat_ctor();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_int.cpp b/3rdparty/glm/source/test/core/core_type_int.cpp
new file mode 100644
index 0000000..2631509
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_int.cpp
@@ -0,0 +1,26 @@
+#include <glm/glm.hpp>
+#include <glm/ext/scalar_int_sized.hpp>
+
+static int test_bit_operator()
+{
+ int Error = 0;
+
+ glm::ivec4 const a(1);
+ glm::ivec4 const b = ~a;
+ Error += glm::all(glm::equal(b, glm::ivec4(-2))) ? 0 : 1;
+
+ glm::int32 const c(1);
+ glm::int32 const d = ~c;
+ Error += d == -2 ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_bit_operator();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_length.cpp b/3rdparty/glm/source/test/core/core_type_length.cpp
new file mode 100644
index 0000000..f088cb3
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_length.cpp
@@ -0,0 +1,78 @@
+#include <glm/glm.hpp>
+
+static int test_length_mat_non_squared()
+{
+ int Error = 0;
+
+ Error += glm::mat2x3().length() == 2 ? 0 : 1;
+ Error += glm::mat2x4().length() == 2 ? 0 : 1;
+ Error += glm::mat3x2().length() == 3 ? 0 : 1;
+ Error += glm::mat3x4().length() == 3 ? 0 : 1;
+ Error += glm::mat4x2().length() == 4 ? 0 : 1;
+ Error += glm::mat4x3().length() == 4 ? 0 : 1;
+
+ Error += glm::dmat2x3().length() == 2 ? 0 : 1;
+ Error += glm::dmat2x4().length() == 2 ? 0 : 1;
+ Error += glm::dmat3x2().length() == 3 ? 0 : 1;
+ Error += glm::dmat3x4().length() == 3 ? 0 : 1;
+ Error += glm::dmat4x2().length() == 4 ? 0 : 1;
+ Error += glm::dmat4x3().length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_length_mat()
+{
+ int Error = 0;
+
+ Error += glm::mat2().length() == 2 ? 0 : 1;
+ Error += glm::mat3().length() == 3 ? 0 : 1;
+ Error += glm::mat4().length() == 4 ? 0 : 1;
+ Error += glm::mat2x2().length() == 2 ? 0 : 1;
+ Error += glm::mat3x3().length() == 3 ? 0 : 1;
+ Error += glm::mat4x4().length() == 4 ? 0 : 1;
+
+ Error += glm::dmat2().length() == 2 ? 0 : 1;
+ Error += glm::dmat3().length() == 3 ? 0 : 1;
+ Error += glm::dmat4().length() == 4 ? 0 : 1;
+ Error += glm::dmat2x2().length() == 2 ? 0 : 1;
+ Error += glm::dmat3x3().length() == 3 ? 0 : 1;
+ Error += glm::dmat4x4().length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_length_vec()
+{
+ int Error = 0;
+
+ Error += glm::vec2().length() == 2 ? 0 : 1;
+ Error += glm::vec3().length() == 3 ? 0 : 1;
+ Error += glm::vec4().length() == 4 ? 0 : 1;
+
+ Error += glm::ivec2().length() == 2 ? 0 : 1;
+ Error += glm::ivec3().length() == 3 ? 0 : 1;
+ Error += glm::ivec4().length() == 4 ? 0 : 1;
+
+ Error += glm::uvec2().length() == 2 ? 0 : 1;
+ Error += glm::uvec3().length() == 3 ? 0 : 1;
+ Error += glm::uvec4().length() == 4 ? 0 : 1;
+
+ Error += glm::dvec2().length() == 2 ? 0 : 1;
+ Error += glm::dvec3().length() == 3 ? 0 : 1;
+ Error += glm::dvec4().length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_length_vec();
+ Error += test_length_mat();
+ Error += test_length_mat_non_squared();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat2x2.cpp b/3rdparty/glm/source/test/core/core_type_mat2x2.cpp
new file mode 100644
index 0000000..2f8b018
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat2x2.cpp
@@ -0,0 +1,177 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/matrix.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+int test_operators()
+{
+ glm::mat2x2 l(1.0f);
+ glm::mat2x2 m(1.0f);
+ glm::vec2 u(1.0f);
+ glm::vec2 v(1.0f);
+ float x = 1.0f;
+ glm::vec2 a = m * u;
+ glm::vec2 b = v * m;
+ glm::mat2x2 n = x / m;
+ glm::mat2x2 o = m / x;
+ glm::mat2x2 p = x * m;
+ glm::mat2x2 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_inverse()
+{
+ int Error(0);
+
+ {
+ glm::mat2 const Matrix(1, 2, 3, 4);
+ glm::mat2 const Inverse = glm::inverse(Matrix);
+ glm::mat2 const Identity = Matrix * Inverse;
+
+ Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1;
+ }
+
+ {
+ glm::mat2 const Matrix(1, 2, 3, 4);
+ glm::mat2 const Identity = Matrix / Matrix;
+
+ Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_ctr()
+{
+ int Error = 0;
+
+ {
+ glm::mediump_mat2x2 const A(1.0f);
+ glm::highp_mat2x2 const B(A);
+ glm::mediump_mat2x2 const C(B);
+
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+#if GLM_HAS_INITIALIZER_LISTS
+ glm::mat2x2 m0(
+ glm::vec2(0, 1),
+ glm::vec2(2, 3));
+
+ glm::mat2x2 m1{0, 1, 2, 3};
+
+ glm::mat2x2 m2{
+ {0, 1},
+ {2, 3}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat2x2> v1{
+ {0, 1, 2, 3},
+ {0, 1, 2, 3}
+ };
+
+ std::vector<glm::mat2x2> v2{
+ {
+ { 0, 1},
+ { 4, 5}
+ },
+ {
+ { 0, 1},
+ { 4, 5}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat2 B(A);
+ glm::mat2 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+int test_size()
+{
+ int Error = 0;
+
+ Error += 16 == sizeof(glm::mat2x2) ? 0 : 1;
+ Error += 32 == sizeof(glm::dmat2x2) ? 0 : 1;
+ Error += glm::mat2x2().length() == 2 ? 0 : 1;
+ Error += glm::dmat2x2().length() == 2 ? 0 : 1;
+ Error += glm::mat2x2::length() == 2 ? 0 : 1;
+ Error += glm::dmat2x2::length() == 2 ? 0 : 1;
+
+ return Error;
+}
+
+int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_inverse();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_mat2x3.cpp b/3rdparty/glm/source/test/core/core_type_mat2x3.cpp
new file mode 100644
index 0000000..e3ad76b
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat2x3.cpp
@@ -0,0 +1,142 @@
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static int test_operators()
+{
+ glm::mat2x3 l(1.0f);
+ glm::mat2x3 m(1.0f);
+ glm::vec2 u(1.0f);
+ glm::vec3 v(1.0f);
+ float x = 1.0f;
+ glm::vec3 a = m * u;
+ glm::vec2 b = v * m;
+ glm::mat2x3 n = x / m;
+ glm::mat2x3 o = m / x;
+ glm::mat2x3 p = x * m;
+ glm::mat2x3 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if GLM_HAS_INITIALIZER_LISTS
+ glm::mat2x3 m0(
+ glm::vec3(0, 1, 2),
+ glm::vec3(3, 4, 5));
+
+ glm::mat2x3 m1{0, 1, 2, 3, 4, 5};
+
+ glm::mat2x3 m2{
+ {0, 1, 2},
+ {3, 4, 5}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat2x3> v1{
+ {0, 1, 2, 3, 4, 5},
+ {0, 1, 2, 3, 4, 5}
+ };
+
+ std::vector<glm::mat2x3> v2{
+ {
+ { 0, 1, 2},
+ { 4, 5, 6}
+ },
+ {
+ { 0, 1, 2},
+ { 4, 5, 6}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat2x3 B(A);
+ glm::mat2x3 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+int test_size()
+{
+ int Error = 0;
+
+ Error += 24 == sizeof(glm::mat2x3) ? 0 : 1;
+ Error += 48 == sizeof(glm::dmat2x3) ? 0 : 1;
+ Error += glm::mat2x3().length() == 2 ? 0 : 1;
+ Error += glm::dmat2x3().length() == 2 ? 0 : 1;
+ Error += glm::mat2x3::length() == 2 ? 0 : 1;
+ Error += glm::dmat2x3::length() == 2 ? 0 : 1;
+
+ return Error;
+}
+
+int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_mat2x4.cpp b/3rdparty/glm/source/test/core/core_type_mat2x4.cpp
new file mode 100644
index 0000000..ade3a44
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat2x4.cpp
@@ -0,0 +1,147 @@
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static int test_operators()
+{
+ glm::mat2x4 l(1.0f);
+ glm::mat2x4 m(1.0f);
+ glm::vec2 u(1.0f);
+ glm::vec4 v(1.0f);
+ float x = 1.0f;
+ glm::vec4 a = m * u;
+ glm::vec2 b = v * m;
+ glm::mat2x4 n = x / m;
+ glm::mat2x4 o = m / x;
+ glm::mat2x4 p = x * m;
+ glm::mat2x4 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat2x4 m0(
+ glm::vec4(0, 1, 2, 3),
+ glm::vec4(4, 5, 6, 7));
+
+ glm::mat2x4 m1{0, 1, 2, 3, 4, 5, 6, 7};
+
+ glm::mat2x4 m2{
+ {0, 1, 2, 3},
+ {4, 5, 6, 7}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat2x4> v1{
+ {0, 1, 2, 3, 4, 5, 6, 7},
+ {0, 1, 2, 3, 4, 5, 6, 7}
+ };
+
+ std::vector<glm::mat2x4> v2{
+ {
+ { 0, 1, 2, 3},
+ { 4, 5, 6, 7}
+ },
+ {
+ { 0, 1, 2, 3},
+ { 4, 5, 6, 7}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat2x4 B(A);
+ glm::mat2x4 Identity(1.0f);
+
+ for(glm::length_t i = 0, length = B.length(); i < length; ++i)
+ Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 32 == sizeof(glm::mat2x4) ? 0 : 1;
+ Error += 64 == sizeof(glm::dmat2x4) ? 0 : 1;
+ Error += glm::mat2x4().length() == 2 ? 0 : 1;
+ Error += glm::dmat2x4().length() == 2 ? 0 : 1;
+ Error += glm::mat2x4::length() == 2 ? 0 : 1;
+ Error += glm::dmat2x4::length() == 2 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
+
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat3x2.cpp b/3rdparty/glm/source/test/core/core_type_mat3x2.cpp
new file mode 100644
index 0000000..7a40f90
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat3x2.cpp
@@ -0,0 +1,148 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static bool test_operators()
+{
+ glm::mat3x2 l(1.0f);
+ glm::mat3x2 m(1.0f);
+ glm::vec3 u(1.0f);
+ glm::vec2 v(1.0f);
+ float x = 1.0f;
+ glm::vec2 a = m * u;
+ glm::vec3 b = v * m;
+ glm::mat3x2 n = x / m;
+ glm::mat3x2 o = m / x;
+ glm::mat3x2 p = x * m;
+ glm::mat3x2 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat3x2 m0(
+ glm::vec2(0, 1),
+ glm::vec2(2, 3),
+ glm::vec2(4, 5));
+
+ glm::mat3x2 m1{0, 1, 2, 3, 4, 5};
+
+ glm::mat3x2 m2{
+ {0, 1},
+ {2, 3},
+ {4, 5}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat3x2> v1{
+ {0, 1, 2, 3, 4, 5},
+ {0, 1, 2, 3, 4, 5}
+ };
+
+ std::vector<glm::mat3x2> v2{
+ {
+ { 0, 1},
+ { 2, 3},
+ { 4, 5}
+ },
+ {
+ { 0, 1},
+ { 2, 3},
+ { 4, 5}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat3x2 B(A);
+ glm::mat3x2 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 24 == sizeof(glm::mat3x2) ? 0 : 1;
+ Error += 48 == sizeof(glm::dmat3x2) ? 0 : 1;
+ Error += glm::mat3x2().length() == 3 ? 0 : 1;
+ Error += glm::dmat3x2().length() == 3 ? 0 : 1;
+ Error += glm::mat3x2::length() == 3 ? 0 : 1;
+ Error += glm::dmat3x2::length() == 3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat3x3.cpp b/3rdparty/glm/source/test/core/core_type_mat3x3.cpp
new file mode 100644
index 0000000..99e1f41
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat3x3.cpp
@@ -0,0 +1,197 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/matrix.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static int test_mat3x3()
+{
+ glm::dmat3 Mat0(
+ glm::dvec3(0.6f, 0.2f, 0.3f),
+ glm::dvec3(0.2f, 0.7f, 0.5f),
+ glm::dvec3(0.3f, 0.5f, 0.7f));
+ glm::dmat3 Inv0 = glm::inverse(Mat0);
+ glm::dmat3 Res0 = Mat0 * Inv0;
+
+ return glm::all(glm::equal(Res0, glm::dmat3(1.0), 0.01)) ? 0 : 1;
+}
+
+static int test_operators()
+{
+ glm::mat3x3 l(1.0f);
+ glm::mat3x3 m(1.0f);
+ glm::vec3 u(1.0f);
+ glm::vec3 v(1.0f);
+ float x = 1.0f;
+ glm::vec3 a = m * u;
+ glm::vec3 b = v * m;
+ glm::mat3x3 n = x / m;
+ glm::mat3x3 o = m / x;
+ glm::mat3x3 p = x * m;
+ glm::mat3x3 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+static int test_inverse()
+{
+ int Error(0);
+
+ {
+ glm::mat3 const Matrix(
+ glm::vec3(0.6f, 0.2f, 0.3f),
+ glm::vec3(0.2f, 0.7f, 0.5f),
+ glm::vec3(0.3f, 0.5f, 0.7f));
+ glm::mat3 const Inverse = glm::inverse(Matrix);
+ glm::mat3 const Identity = Matrix * Inverse;
+
+ Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1;
+ }
+
+ {
+ glm::mat3 const Matrix(
+ glm::vec3(0.6f, 0.2f, 0.3f),
+ glm::vec3(0.2f, 0.7f, 0.5f),
+ glm::vec3(0.3f, 0.5f, 0.7f));
+ glm::mat3 const Identity = Matrix / Matrix;
+
+ Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1;
+ Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat3x3 m0(
+ glm::vec3(0, 1, 2),
+ glm::vec3(3, 4, 5),
+ glm::vec3(6, 7, 8));
+
+ glm::mat3x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8};
+
+ glm::mat3x3 m2{
+ {0, 1, 2},
+ {3, 4, 5},
+ {6, 7, 8}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat3x3> v1{
+ {0, 1, 2, 3, 4, 5, 6, 7, 8},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8}
+ };
+
+ std::vector<glm::mat3x3> v2{
+ {
+ { 0, 1, 2},
+ { 3, 4, 5},
+ { 6, 7, 8}
+ },
+ {
+ { 0, 1, 2},
+ { 3, 4, 5},
+ { 6, 7, 8}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat3x3 B(A);
+ glm::mat3x3 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 36 == sizeof(glm::mat3x3) ? 0 : 1;
+ Error += 72 == sizeof(glm::dmat3x3) ? 0 : 1;
+ Error += glm::mat3x3().length() == 3 ? 0 : 1;
+ Error += glm::dmat3x3().length() == 3 ? 0 : 1;
+ Error += glm::mat3x3::length() == 3 ? 0 : 1;
+ Error += glm::dmat3x3::length() == 3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr");
+
+ constexpr glm::mat3x3 const Z(0.0f);
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_mat3x3();
+ Error += test_operators();
+ Error += test_inverse();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat3x4.cpp b/3rdparty/glm/source/test/core/core_type_mat3x4.cpp
new file mode 100644
index 0000000..97d4574
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat3x4.cpp
@@ -0,0 +1,149 @@
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static bool test_operators()
+{
+ glm::mat3x4 l(1.0f);
+ glm::mat3x4 m(1.0f);
+ glm::vec3 u(1.0f);
+ glm::vec4 v(1.0f);
+ float x = 1.0f;
+ glm::vec4 a = m * u;
+ glm::vec3 b = v * m;
+ glm::mat3x4 n = x / m;
+ glm::mat3x4 o = m / x;
+ glm::mat3x4 p = x * m;
+ glm::mat3x4 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat3x4 m0(
+ glm::vec4(0, 1, 2, 3),
+ glm::vec4(4, 5, 6, 7),
+ glm::vec4(8, 9, 10, 11));
+
+ glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
+
+ glm::mat3x4 m2{
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 10, 11}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat3x4> v1{
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
+ };
+
+ std::vector<glm::mat3x4> v2{
+ {
+ { 0, 1, 2, 3},
+ { 4, 5, 6, 7},
+ { 8, 9, 10, 11}
+ },
+ {
+ { 0, 1, 2, 3},
+ { 4, 5, 6, 7},
+ { 8, 9, 10, 11}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat3x4 B(A);
+ glm::mat3x4 Identity(1.0f);
+
+ for(glm::length_t i = 0, length = B.length(); i < length; ++i)
+ Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 48 == sizeof(glm::mat3x4) ? 0 : 1;
+ Error += 96 == sizeof(glm::dmat3x4) ? 0 : 1;
+ Error += glm::mat3x4().length() == 3 ? 0 : 1;
+ Error += glm::dmat3x4().length() == 3 ? 0 : 1;
+ Error += glm::mat3x4::length() == 3 ? 0 : 1;
+ Error += glm::dmat3x4::length() == 3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat4x2.cpp b/3rdparty/glm/source/test/core/core_type_mat4x2.cpp
new file mode 100644
index 0000000..7133edc
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat4x2.cpp
@@ -0,0 +1,151 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static int test_operators()
+{
+ glm::mat4x2 l(1.0f);
+ glm::mat4x2 m(1.0f);
+ glm::vec4 u(1.0f);
+ glm::vec2 v(1.0f);
+ float x = 1.0f;
+ glm::vec2 a = m * u;
+ glm::vec4 b = v * m;
+ glm::mat4x2 n = x / m;
+ glm::mat4x2 o = m / x;
+ glm::mat4x2 p = x * m;
+ glm::mat4x2 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat4x2 m0(
+ glm::vec2(0, 1),
+ glm::vec2(2, 3),
+ glm::vec2(4, 5),
+ glm::vec2(6, 7));
+
+ glm::mat4x2 m1{0, 1, 2, 3, 4, 5, 6, 7};
+
+ glm::mat4x2 m2{
+ {0, 1},
+ {2, 3},
+ {4, 5},
+ {6, 7}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat4x2> v1{
+ {0, 1, 2, 3, 4, 5, 6, 7},
+ {0, 1, 2, 3, 4, 5, 6, 7}
+ };
+
+ std::vector<glm::mat4x2> v2{
+ {
+ { 0, 1},
+ { 4, 5},
+ { 8, 9},
+ { 12, 13}
+ },
+ {
+ { 0, 1},
+ { 4, 5},
+ { 8, 9},
+ { 12, 13}
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat4x2 B(A);
+ glm::mat4x2 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 32 == sizeof(glm::mat4x2) ? 0 : 1;
+ Error += 64 == sizeof(glm::dmat4x2) ? 0 : 1;
+ Error += glm::mat4x2().length() == 4 ? 0 : 1;
+ Error += glm::dmat4x2().length() == 4 ? 0 : 1;
+ Error += glm::mat4x2::length() == 4 ? 0 : 1;
+ Error += glm::dmat4x2::length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat4x3.cpp b/3rdparty/glm/source/test/core/core_type_mat4x3.cpp
new file mode 100644
index 0000000..1c65e7f
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat4x3.cpp
@@ -0,0 +1,152 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+#include <vector>
+
+static int test_operators()
+{
+ glm::mat4x3 l(1.0f);
+ glm::mat4x3 m(1.0f);
+ glm::vec4 u(1.0f);
+ glm::vec3 v(1.0f);
+ float x = 1.0f;
+ glm::vec3 a = m * u;
+ glm::vec4 b = v * m;
+ glm::mat4x3 n = x / m;
+ glm::mat4x3 o = m / x;
+ glm::mat4x3 p = x * m;
+ glm::mat4x3 q = m * x;
+ bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
+ bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
+
+ return (S && !R) ? 0 : 1;
+}
+
+int test_ctr()
+{
+ int Error(0);
+
+#if(GLM_HAS_INITIALIZER_LISTS)
+ glm::mat4x3 m0(
+ glm::vec3(0, 1, 2),
+ glm::vec3(3, 4, 5),
+ glm::vec3(6, 7, 8),
+ glm::vec3(9, 10, 11));
+
+ glm::mat4x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
+
+ glm::mat4x3 m2{
+ {0, 1, 2},
+ {3, 4, 5},
+ {6, 7, 8},
+ {9, 10, 11}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+ std::vector<glm::mat4x3> v1{
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
+ };
+
+ std::vector<glm::mat4x3> v2{
+ {
+ { 0, 1, 2 },
+ { 4, 5, 6 },
+ { 8, 9, 10 },
+ { 12, 13, 14 }
+ },
+ {
+ { 0, 1, 2 },
+ { 4, 5, 6 },
+ { 8, 9, 10 },
+ { 12, 13, 14 }
+ }
+ };
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+namespace cast
+{
+ template<typename genType>
+ int entry()
+ {
+ int Error = 0;
+
+ genType A(1.0f);
+ glm::mat4x3 B(A);
+ glm::mat4x3 Identity(1.0f);
+
+ Error += glm::all(glm::equal(B, Identity, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += entry<glm::mat2x2>();
+ Error += entry<glm::mat2x3>();
+ Error += entry<glm::mat2x4>();
+ Error += entry<glm::mat3x2>();
+ Error += entry<glm::mat3x3>();
+ Error += entry<glm::mat3x4>();
+ Error += entry<glm::mat4x2>();
+ Error += entry<glm::mat4x3>();
+ Error += entry<glm::mat4x4>();
+
+ return Error;
+ }
+}//namespace cast
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 48 == sizeof(glm::mat4x3) ? 0 : 1;
+ Error += 96 == sizeof(glm::dmat4x3) ? 0 : 1;
+ Error += glm::mat4x3().length() == 4 ? 0 : 1;
+ Error += glm::dmat4x3().length() == 4 ? 0 : 1;
+ Error += glm::mat4x3::length() == 4 ? 0 : 1;
+ Error += glm::dmat4x3::length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += cast::test();
+ Error += test_ctr();
+ Error += test_operators();
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/core/core_type_mat4x4.cpp b/3rdparty/glm/source/test/core/core_type_mat4x4.cpp
new file mode 100644
index 0000000..0be87f1
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_mat4x4.cpp
@@ -0,0 +1,218 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/matrix.hpp>
+#include <glm/mat4x4.hpp>
+#include <glm/vec4.hpp>
+#include <vector>
+
+template <typename matType, typename vecType>
+static int test_operators()
+{
+ typedef typename matType::value_type value_type;
+
+ value_type const Epsilon = static_cast<value_type>(0.001);
+
+ int Error = 0;
+
+ matType const M(static_cast<value_type>(2.0f));
+ matType const N(static_cast<value_type>(1.0f));
+ vecType const U(static_cast<value_type>(2.0f));
+
+ {
+ matType const P = N * static_cast<value_type>(2.0f);
+ Error += glm::all(glm::equal(P, M, Epsilon)) ? 0 : 1;
+
+ matType const Q = M / static_cast<value_type>(2.0f);
+ Error += glm::all(glm::equal(Q, N, Epsilon)) ? 0 : 1;
+ }
+
+ {
+ vecType const V = M * U;
+ Error += glm::all(glm::equal(V, vecType(static_cast<value_type>(4.f)), Epsilon)) ? 0 : 1;
+
+ vecType const W = U / M;
+ Error += glm::all(glm::equal(W, vecType(static_cast<value_type>(1.f)), Epsilon)) ? 0 : 1;
+ }
+
+ {
+ matType const O = M * N;
+ Error += glm::all(glm::equal(O, matType(static_cast<value_type>(2.f)), Epsilon)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename matType>
+static int test_inverse()
+{
+ typedef typename matType::value_type value_type;
+
+ value_type const Epsilon = static_cast<value_type>(0.001);
+
+ int Error = 0;
+
+ matType const Identity(static_cast<value_type>(1.0f));
+ matType const Matrix(
+ glm::vec4(0.6f, 0.2f, 0.3f, 0.4f),
+ glm::vec4(0.2f, 0.7f, 0.5f, 0.3f),
+ glm::vec4(0.3f, 0.5f, 0.7f, 0.2f),
+ glm::vec4(0.4f, 0.3f, 0.2f, 0.6f));
+ matType const Inverse = Identity / Matrix;
+ matType const Result = Matrix * Inverse;
+
+ Error += glm::all(glm::equal(Identity, Result, Epsilon)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_ctr()
+{
+ int Error = 0;
+
+#if GLM_HAS_TRIVIAL_QUERIES
+ //Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
+ //Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
+ //Error += std::is_copy_constructible<glm::mat4>::value ? 0 : 1;
+ //Error += std::has_trivial_copy_constructor<glm::mat4>::value ? 0 : 1;
+#endif
+
+#if GLM_HAS_INITIALIZER_LISTS
+ glm::mat4 const m0(
+ glm::vec4(0, 1, 2, 3),
+ glm::vec4(4, 5, 6, 7),
+ glm::vec4(8, 9, 10, 11),
+ glm::vec4(12, 13, 14, 15));
+
+ assert(sizeof(m0) == 4 * 4 * 4);
+
+ glm::vec4 const V{0, 1, 2, 3};
+
+ glm::mat4 const m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+
+ glm::mat4 const m2{
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 10, 11},
+ {12, 13, 14, 15}};
+
+ Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
+
+
+ std::vector<glm::mat4> const m3{
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}};
+
+ glm::mat4 const m4{
+ {1, 0, 0, 0},
+ {0, 1, 0, 0},
+ {0, 0, 1, 0},
+ {0, 0, 0, 1} };
+
+ Error += glm::equal(m4[0][0], 1.0f, 0.0001f) ? 0 : 1;
+ Error += glm::equal(m4[3][3], 1.0f, 0.0001f) ? 0 : 1;
+
+ std::vector<glm::mat4> const v1{
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}};
+
+ std::vector<glm::mat4> const v2{
+ {
+ { 0, 1, 2, 3 },
+ { 4, 5, 6, 7 },
+ { 8, 9, 10, 11 },
+ { 12, 13, 14, 15 }
+ },
+ {
+ { 0, 1, 2, 3 },
+ { 4, 5, 6, 7 },
+ { 8, 9, 10, 11 },
+ { 12, 13, 14, 15 }
+ }};
+
+#endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+static int test_member_alloc_bug()
+{
+ int Error = 0;
+
+ struct repro
+ {
+ repro(){ this->matrix = new glm::mat4(); }
+ ~repro(){delete this->matrix;}
+
+ glm::mat4* matrix;
+ };
+
+ repro Repro;
+
+ return Error;
+}
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += 64 == sizeof(glm::mat4) ? 0 : 1;
+ Error += 128 == sizeof(glm::dmat4) ? 0 : 1;
+ Error += glm::mat4().length() == 4 ? 0 : 1;
+ Error += glm::dmat4().length() == 4 ? 0 : 1;
+ Error += glm::mat4::length() == 4 ? 0 : 1;
+ Error += glm::dmat4::length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr");
+ constexpr glm::mat4 A(1.f);
+ constexpr glm::mat4 B(1.f);
+ constexpr glm::bvec4 C = glm::equal(A, B, 0.01f);
+ static_assert(glm::all(C), "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_member_alloc_bug();
+ Error += test_ctr();
+
+ Error += test_operators<glm::mat4, glm::vec4>();
+ Error += test_operators<glm::lowp_mat4, glm::lowp_vec4>();
+ Error += test_operators<glm::mediump_mat4, glm::mediump_vec4>();
+ Error += test_operators<glm::highp_mat4, glm::highp_vec4>();
+
+ Error += test_operators<glm::dmat4, glm::dvec4>();
+ Error += test_operators<glm::lowp_dmat4, glm::lowp_dvec4>();
+ Error += test_operators<glm::mediump_dmat4, glm::mediump_dvec4>();
+ Error += test_operators<glm::highp_dmat4, glm::highp_dvec4>();
+
+ Error += test_inverse<glm::mat4>();
+ Error += test_inverse<glm::lowp_mat4>();
+ Error += test_inverse<glm::mediump_mat4>();
+ Error += test_inverse<glm::highp_mat4>();
+
+ Error += test_inverse<glm::dmat4>();
+ Error += test_inverse<glm::lowp_dmat4>();
+ Error += test_inverse<glm::mediump_dmat4>();
+ Error += test_inverse<glm::highp_dmat4>();
+
+ Error += test_size();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_vec1.cpp b/3rdparty/glm/source/test/core/core_type_vec1.cpp
new file mode 100644
index 0000000..77f3f84
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_vec1.cpp
@@ -0,0 +1,169 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <vector>
+
+static glm::vec1 g1;
+static glm::vec1 g2(1);
+
+int test_vec1_operators()
+{
+ int Error = 0;
+
+ glm::ivec1 A(1);
+ glm::ivec1 B(1);
+ {
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ A *= 1;
+ B *= 1;
+ A += 1;
+ B += 1;
+
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_vec1_ctor()
+{
+ int Error = 0;
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec1>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec1>::value ? 0 : 1;
+# endif
+
+/*
+#if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::vec1 a{ 0 };
+ std::vector<glm::vec1> v = {
+ {0.f},
+ {4.f},
+ {8.f}};
+ }
+
+ {
+ glm::dvec2 a{ 0 };
+ std::vector<glm::dvec1> v = {
+ {0.0},
+ {4.0},
+ {8.0}};
+ }
+#endif
+*/
+
+ {
+ glm::vec2 A = glm::vec2(2.0f);
+ glm::vec2 B = glm::vec2(2.0f, 3.0f);
+ glm::vec2 C = glm::vec2(2.0f, 3.0);
+ //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says?
+ glm::vec2 E(glm::dvec2(2.0));
+ glm::vec2 F(glm::ivec2(2));
+ }
+
+ return Error;
+}
+
+static int test_vec1_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1;
+ Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1;
+ Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1;
+ Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1;
+ Error += glm::vec1().length() == 1 ? 0 : 1;
+ Error += glm::dvec1().length() == 1 ? 0 : 1;
+ Error += glm::vec1::length() == 1 ? 0 : 1;
+ Error += glm::dvec1::length() == 1 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec1_operator_increment()
+{
+ int Error(0);
+
+ glm::ivec1 v0(1);
+ glm::ivec1 v1(v0);
+ glm::ivec1 v2(v0);
+ glm::ivec1 v3 = ++v1;
+ glm::ivec1 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::vec1 A = glm::vec1(1.0f);
+ //glm::vec1 B = A.x;
+ glm::vec1 C(A.x);
+
+ //Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr");
+ static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec1_size();
+ Error += test_vec1_ctor();
+ Error += test_vec1_operators();
+ Error += test_vec1_operator_increment();
+ Error += test_swizzle();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_vec2.cpp b/3rdparty/glm/source/test/core/core_type_vec2.cpp
new file mode 100644
index 0000000..308c61f
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_vec2.cpp
@@ -0,0 +1,392 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <vector>
+#if GLM_HAS_TRIVIAL_QUERIES
+# include <type_traits>
+#endif
+
+static glm::ivec2 g1;
+static glm::ivec2 g2(1);
+static glm::ivec2 g3(1, 1);
+
+static int test_operators()
+{
+ int Error = 0;
+
+ {
+ glm::ivec2 A(1);
+ glm::ivec2 B(1);
+ Error += A != B ? 1 : 0;
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f);
+ glm::vec2 C = A + 1.0f;
+ A += 1.0f;
+ Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f);
+ glm::vec2 B(2.0f,-1.0f);
+ glm::vec2 C = A + B;
+ A += B;
+ Error += glm::all(glm::equal(A, glm::vec2(3.0f, 0.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f);
+ glm::vec2 C = A - 1.0f;
+ A -= 1.0f;
+ Error += glm::all(glm::equal(A, glm::vec2(0.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f);
+ glm::vec2 B(2.0f,-1.0f);
+ glm::vec2 C = A - B;
+ A -= B;
+ Error += glm::all(glm::equal(A, glm::vec2(-1.0f, 2.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f);
+ glm::vec2 C = A * 2.0f;
+ A *= 2.0f;
+ Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(2.0f);
+ glm::vec2 B(2.0f);
+ glm::vec2 C = A / B;
+ A /= B;
+ Error += glm::all(glm::equal(A, glm::vec2(1.0f), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f, 2.0f);
+ glm::vec2 B(4.0f, 5.0f);
+
+ glm::vec2 C = A + B;
+ Error += glm::all(glm::equal(C, glm::vec2(5, 7), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 D = B - A;
+ Error += glm::all(glm::equal(D, glm::vec2(3, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 E = A * B;
+ Error += glm::all(glm::equal(E, glm::vec2(4, 10), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 F = B / A;
+ Error += glm::all(glm::equal(F, glm::vec2(4, 2.5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 G = A + 1.0f;
+ Error += glm::all(glm::equal(G, glm::vec2(2, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 H = B - 1.0f;
+ Error += glm::all(glm::equal(H, glm::vec2(3, 4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 I = A * 2.0f;
+ Error += glm::all(glm::equal(I, glm::vec2(2, 4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 J = B / 2.0f;
+ Error += glm::all(glm::equal(J, glm::vec2(2, 2.5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 K = 1.0f + A;
+ Error += glm::all(glm::equal(K, glm::vec2(2, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 L = 1.0f - B;
+ Error += glm::all(glm::equal(L, glm::vec2(-3, -4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 M = 2.0f * A;
+ Error += glm::all(glm::equal(M, glm::vec2(2, 4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec2 N = 2.0f / B;
+ Error += glm::all(glm::equal(N, glm::vec2(0.5, 2.0 / 5.0), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A(1.0f, 2.0f);
+ glm::vec2 B(4.0f, 5.0f);
+
+ A += B;
+ Error += glm::all(glm::equal(A, glm::vec2(5, 7), glm::epsilon<float>())) ? 0 : 1;
+
+ A += 1.0f;
+ Error += glm::all(glm::equal(A, glm::vec2(6, 8), glm::epsilon<float>())) ? 0 : 1;
+ }
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B(4.0f, 5.0f);
+
+ B -= A;
+ Error += B == glm::ivec2(3, 3) ? 0 : 1;
+
+ B -= 1.0f;
+ Error += B == glm::ivec2(2, 2) ? 0 : 1;
+ }
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B(4.0f, 5.0f);
+
+ A *= B;
+ Error += A == glm::ivec2(4, 10) ? 0 : 1;
+
+ A *= 2;
+ Error += A == glm::ivec2(8, 20) ? 0 : 1;
+ }
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B(4.0f, 16.0f);
+
+ B /= A;
+ Error += B == glm::ivec2(4, 8) ? 0 : 1;
+
+ B /= 2.0f;
+ Error += B == glm::ivec2(2, 4) ? 0 : 1;
+ }
+ {
+ glm::ivec2 B(2);
+
+ B /= B.y;
+ Error += B == glm::ivec2(1) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B = -A;
+ Error += B == glm::ivec2(-1.0f, -2.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B = --A;
+ Error += B == glm::ivec2(0.0f, 1.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B = A--;
+ Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1;
+ Error += A == glm::ivec2(0.0f, 1.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B = ++A;
+ Error += B == glm::ivec2(2.0f, 3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec2 A(1.0f, 2.0f);
+ glm::ivec2 B = A++;
+ Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1;
+ Error += A == glm::ivec2(2.0f, 3.0f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ctor()
+{
+ int Error = 0;
+
+ {
+ glm::ivec2 A(1);
+ glm::ivec2 B(A);
+ Error += A == B ? 0 : 1;
+ }
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec2>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec2>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec2>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec2>::value ? 0 : 1;
+# endif
+
+#if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::vec2 a{ 0, 1 };
+ std::vector<glm::vec2> v = {
+ {0, 1},
+ {4, 5},
+ {8, 9}};
+ }
+
+ {
+ glm::dvec2 a{ 0, 1 };
+ std::vector<glm::dvec2> v = {
+ {0, 1},
+ {4, 5},
+ {8, 9}};
+ }
+#endif
+
+ {
+ glm::vec2 A = glm::vec2(2.0f);
+ glm::vec2 B = glm::vec2(2.0f, 3.0f);
+ glm::vec2 C = glm::vec2(2.0f, 3.0);
+ //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says?
+ glm::vec2 E(glm::dvec2(2.0));
+ glm::vec2 F(glm::ivec2(2));
+ }
+
+ {
+ glm::vec1 const R(1.0f);
+ glm::vec1 const S(2.0f);
+ glm::vec2 const O(1.0f, 2.0f);
+
+ glm::vec2 const A(R);
+ glm::vec2 const B(1.0f);
+ Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const C(R, S);
+ Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const D(R, 2.0f);
+ Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const E(1.0f, S);
+ Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const R(1.0f);
+ glm::dvec1 const S(2.0);
+ glm::vec2 const O(1.0, 2.0);
+
+ glm::vec2 const A(R);
+ glm::vec2 const B(1.0);
+ Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const C(R, S);
+ Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const D(R, 2.0);
+ Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1;
+
+ glm::vec2 const E(1.0, S);
+ Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1;
+ Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1;
+ Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1;
+ Error += 16 == sizeof(glm::highp_dvec2) ? 0 : 1;
+ Error += glm::vec2().length() == 2 ? 0 : 1;
+ Error += glm::dvec2().length() == 2 ? 0 : 1;
+ Error += glm::vec2::length() == 2 ? 0 : 1;
+ Error += glm::dvec2::length() == 2 ? 0 : 1;
+
+ GLM_CONSTEXPR std::size_t Length = glm::vec2::length();
+ Error += Length == 2 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_operator_increment()
+{
+ int Error = 0;
+
+ glm::ivec2 v0(1);
+ glm::ivec2 v1(v0);
+ glm::ivec2 v2(v0);
+ glm::ivec2 v3 = ++v1;
+ glm::ivec2 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+static int test_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::vec2 A = glm::vec2(1.0f, 2.0f);
+ glm::vec2 B = A.xy;
+ glm::vec2 C(A.xy);
+ glm::vec2 D(A.xy());
+
+ Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D, 0.0001f)) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::vec2 A = glm::vec2(1.0f, 2.0f);
+ glm::vec2 B = A.xy();
+ glm::vec2 C(A.xy());
+
+ Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_ctor();
+ Error += test_operators();
+ Error += test_operator_increment();
+ Error += test_swizzle();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_vec3.cpp b/3rdparty/glm/source/test/core/core_type_vec3.cpp
new file mode 100644
index 0000000..4da8187
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_vec3.cpp
@@ -0,0 +1,628 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/geometric.hpp>
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <vector>
+
+static glm::vec3 g1;
+static glm::vec3 g2(1);
+static glm::vec3 g3(1, 1, 1);
+
+int test_vec3_ctor()
+{
+ int Error = 0;
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec3>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec3>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec3>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec3>::value ? 0 : 1;
+# endif
+
+# if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::vec3 a{ 0, 1, 2 };
+ std::vector<glm::vec3> v = {
+ {0, 1, 2},
+ {4, 5, 6},
+ {8, 9, 0}};
+ }
+
+ {
+ glm::dvec3 a{ 0, 1, 2 };
+ std::vector<glm::dvec3> v = {
+ {0, 1, 2},
+ {4, 5, 6},
+ {8, 9, 0}};
+ }
+# endif
+
+ {
+ glm::ivec3 A(1);
+ glm::ivec3 B(1, 1, 1);
+
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ std::vector<glm::ivec3> Tests;
+ Tests.push_back(glm::ivec3(glm::ivec2(1, 2), 3));
+ Tests.push_back(glm::ivec3(1, glm::ivec2(2, 3)));
+ Tests.push_back(glm::ivec3(1, 2, 3));
+ Tests.push_back(glm::ivec3(glm::ivec4(1, 2, 3, 4)));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ Error += Tests[i] == glm::ivec3(1, 2, 3) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const R(1.0f);
+ glm::vec1 const S(2.0f);
+ glm::vec1 const T(3.0f);
+ glm::vec3 const O(1.0f, 2.0f, 3.0f);
+
+ glm::vec3 const A(R);
+ glm::vec3 const B(1.0f);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const C(R, S, T);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const D(R, 2.0f, 3.0f);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const E(1.0f, S, 3.0f);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const F(1.0f, S, T);
+ Error += glm::all(glm::equal(F, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const G(R, 2.0f, T);
+ Error += glm::all(glm::equal(G, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const H(R, S, 3.0f);
+ Error += glm::all(glm::equal(H, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const R(1.0);
+ glm::dvec1 const S(2.0);
+ glm::vec1 const T(3.0);
+ glm::vec3 const O(1.0f, 2.0f, 3.0f);
+
+ glm::vec3 const A(R);
+ glm::vec3 const B(1.0);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const C(R, S, T);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const D(R, 2.0, 3.0);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const E(1.0f, S, 3.0);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const F(1.0, S, T);
+ Error += glm::all(glm::equal(F, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const G(R, 2.0, T);
+ Error += glm::all(glm::equal(G, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const H(R, S, 3.0);
+ Error += glm::all(glm::equal(H, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+float foo()
+{
+ glm::vec3 bar = glm::vec3(0.0f, 1.0f, 1.0f);
+
+ return glm::length(bar);
+}
+
+static int test_bvec3_ctor()
+{
+ int Error = 0;
+
+ glm::bvec3 const A(true);
+ glm::bvec3 const B(true);
+ glm::bvec3 const C(false);
+ glm::bvec3 const D = A && B;
+ glm::bvec3 const E = A && C;
+ glm::bvec3 const F = A || C;
+
+ Error += D == glm::bvec3(true) ? 0 : 1;
+ Error += E == glm::bvec3(false) ? 0 : 1;
+ Error += F == glm::bvec3(true) ? 0 : 1;
+
+ bool const G = A == C;
+ bool const H = A != C;
+ Error += !G ? 0 : 1;
+ Error += H ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec3_operators()
+{
+ int Error = 0;
+
+ {
+ glm::ivec3 A(1);
+ glm::ivec3 B(1);
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 const A(1.0f, 2.0f, 3.0f);
+ glm::vec3 const B(4.0f, 5.0f, 6.0f);
+
+ glm::vec3 const C = A + B;
+ Error += glm::all(glm::equal(C, glm::vec3(5, 7, 9), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const D = B - A;
+ Error += glm::all(glm::equal(D, glm::vec3(3, 3, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const E = A * B;
+ Error += glm::all(glm::equal(E, glm::vec3(4, 10, 18), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const F = B / A;
+ Error += glm::all(glm::equal(F, glm::vec3(4, 2.5, 2), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const G = A + 1.0f;
+ Error += glm::all(glm::equal(G, glm::vec3(2, 3, 4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const H = B - 1.0f;
+ Error += glm::all(glm::equal(H, glm::vec3(3, 4, 5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const I = A * 2.0f;
+ Error += glm::all(glm::equal(I, glm::vec3(2, 4, 6), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const J = B / 2.0f;
+ Error += glm::all(glm::equal(J, glm::vec3(2, 2.5, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const K = 1.0f + A;
+ Error += glm::all(glm::equal(K, glm::vec3(2, 3, 4), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const L = 1.0f - B;
+ Error += glm::all(glm::equal(L, glm::vec3(-3, -4, -5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const M = 2.0f * A;
+ Error += glm::all(glm::equal(M, glm::vec3(2, 4, 6), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec3 const N = 2.0f / B;
+ Error += glm::all(glm::equal(N, glm::vec3(0.5, 2.0 / 5.0, 2.0 / 6.0), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B(4.0f, 5.0f, 6.0f);
+
+ A += B;
+ Error += A == glm::ivec3(5, 7, 9) ? 0 : 1;
+
+ A += 1;
+ Error += A == glm::ivec3(6, 8, 10) ? 0 : 1;
+ }
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B(4.0f, 5.0f, 6.0f);
+
+ B -= A;
+ Error += B == glm::ivec3(3, 3, 3) ? 0 : 1;
+
+ B -= 1;
+ Error += B == glm::ivec3(2, 2, 2) ? 0 : 1;
+ }
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B(4.0f, 5.0f, 6.0f);
+
+ A *= B;
+ Error += A == glm::ivec3(4, 10, 18) ? 0 : 1;
+
+ A *= 2;
+ Error += A == glm::ivec3(8, 20, 36) ? 0 : 1;
+ }
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B(4.0f, 4.0f, 6.0f);
+
+ B /= A;
+ Error += B == glm::ivec3(4, 2, 2) ? 0 : 1;
+
+ B /= 2;
+ Error += B == glm::ivec3(2, 1, 1) ? 0 : 1;
+ }
+ {
+ glm::ivec3 B(2);
+
+ B /= B.y;
+ Error += B == glm::ivec3(1) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = -A;
+ Error += B == glm::ivec3(-1.0f, -2.0f, -3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = --A;
+ Error += B == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = A--;
+ Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1;
+ Error += A == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = ++A;
+ Error += B == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 A(1.0f, 2.0f, 3.0f);
+ glm::ivec3 B = A++;
+ Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1;
+ Error += A == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_vec3_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec3) == sizeof(glm::lowp_vec3) ? 0 : 1;
+ Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1;
+ Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1;
+ Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1;
+ Error += sizeof(glm::dvec3) == sizeof(glm::lowp_dvec3) ? 0 : 1;
+ Error += sizeof(glm::dvec3) == sizeof(glm::mediump_dvec3) ? 0 : 1;
+ Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1;
+ Error += 24 == sizeof(glm::highp_dvec3) ? 0 : 1;
+ Error += glm::vec3().length() == 3 ? 0 : 1;
+ Error += glm::dvec3().length() == 3 ? 0 : 1;
+ Error += glm::vec3::length() == 3 ? 0 : 1;
+ Error += glm::dvec3::length() == 3 ? 0 : 1;
+
+ GLM_CONSTEXPR std::size_t Length = glm::vec3::length();
+ Error += Length == 3 ? 0 : 1;
+
+ return Error;
+}
+
+int test_vec3_swizzle3_2()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec3 v(1, 2, 3);
+ glm::ivec2 u;
+
+ // Can not assign a vec3 swizzle to a vec2
+ //u = v.xyz; //Illegal
+ //u = v.rgb; //Illegal
+ //u = v.stp; //Illegal
+
+ u = v.xx; Error += (u.x == 1 && u.y == 1) ? 0 : 1;
+ u = v.xy; Error += (u.x == 1 && u.y == 2) ? 0 : 1;
+ u = v.xz; Error += (u.x == 1 && u.y == 3) ? 0 : 1;
+ u = v.yx; Error += (u.x == 2 && u.y == 1) ? 0 : 1;
+ u = v.yy; Error += (u.x == 2 && u.y == 2) ? 0 : 1;
+ u = v.yz; Error += (u.x == 2 && u.y == 3) ? 0 : 1;
+ u = v.zx; Error += (u.x == 3 && u.y == 1) ? 0 : 1;
+ u = v.zy; Error += (u.x == 3 && u.y == 2) ? 0 : 1;
+ u = v.zz; Error += (u.x == 3 && u.y == 3) ? 0 : 1;
+
+ u = v.rr; Error += (u.r == 1 && u.g == 1) ? 0 : 1;
+ u = v.rg; Error += (u.r == 1 && u.g == 2) ? 0 : 1;
+ u = v.rb; Error += (u.r == 1 && u.g == 3) ? 0 : 1;
+ u = v.gr; Error += (u.r == 2 && u.g == 1) ? 0 : 1;
+ u = v.gg; Error += (u.r == 2 && u.g == 2) ? 0 : 1;
+ u = v.gb; Error += (u.r == 2 && u.g == 3) ? 0 : 1;
+ u = v.br; Error += (u.r == 3 && u.g == 1) ? 0 : 1;
+ u = v.bg; Error += (u.r == 3 && u.g == 2) ? 0 : 1;
+ u = v.bb; Error += (u.r == 3 && u.g == 3) ? 0 : 1;
+
+ u = v.ss; Error += (u.s == 1 && u.t == 1) ? 0 : 1;
+ u = v.st; Error += (u.s == 1 && u.t == 2) ? 0 : 1;
+ u = v.sp; Error += (u.s == 1 && u.t == 3) ? 0 : 1;
+ u = v.ts; Error += (u.s == 2 && u.t == 1) ? 0 : 1;
+ u = v.tt; Error += (u.s == 2 && u.t == 2) ? 0 : 1;
+ u = v.tp; Error += (u.s == 2 && u.t == 3) ? 0 : 1;
+ u = v.ps; Error += (u.s == 3 && u.t == 1) ? 0 : 1;
+ u = v.pt; Error += (u.s == 3 && u.t == 2) ? 0 : 1;
+ u = v.pp; Error += (u.s == 3 && u.t == 3) ? 0 : 1;
+ // Mixed member aliases are not valid
+ //u = v.rx; //Illegal
+ //u = v.sy; //Illegal
+
+ u = glm::ivec2(1, 2);
+ v = glm::ivec3(1, 2, 3);
+ //v.xx = u; //Illegal
+ v.xy = u; Error += (v.x == 1 && v.y == 2 && v.z == 3) ? 0 : 1;
+ v.xz = u; Error += (v.x == 1 && v.y == 2 && v.z == 2) ? 0 : 1;
+ v.yx = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1;
+ //v.yy = u; //Illegal
+ v.yz = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1;
+ v.zx = u; Error += (v.x == 2 && v.y == 1 && v.z == 1) ? 0 : 1;
+ v.zy = u; Error += (v.x == 2 && v.y == 2 && v.z == 1) ? 0 : 1;
+ //v.zz = u; //Illegal
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+ return Error;
+}
+
+int test_vec3_swizzle3_3()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec3 v(1, 2, 3);
+ glm::ivec3 u;
+
+ u = v; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1;
+
+ u = v.xyz; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1;
+ u = v.zyx; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+ u.zyx = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+
+ u = v.rgb; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1;
+ u = v.bgr; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+ u.bgr = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+
+ u = v.stp; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1;
+ u = v.pts; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+ u.pts = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1;
+ }
+# endif//GLM_LANG
+
+ return Error;
+}
+
+int test_vec3_swizzle_operators()
+{
+ int Error = 0;
+
+ glm::ivec3 const u = glm::ivec3(1, 2, 3);
+ glm::ivec3 const v = glm::ivec3(10, 20, 30);
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec3 q;
+
+ // Swizzle, swizzle binary operators
+ q = u.xyz + v.xyz; Error += (q == (u + v)) ? 0 : 1;
+ q = (u.zyx + v.zyx).zyx; Error += (q == (u + v)) ? 0 : 1;
+ q = (u.xyz - v.xyz); Error += (q == (u - v)) ? 0 : 1;
+ q = (u.xyz * v.xyz); Error += (q == (u * v)) ? 0 : 1;
+ q = (u.xxx * v.xxx); Error += (q == glm::ivec3(u.x * v.x)) ? 0 : 1;
+ q = (u.xyz / v.xyz); Error += (q == (u / v)) ? 0 : 1;
+
+ // vec, swizzle binary operators
+ q = u + v.xyz; Error += (q == (u + v)) ? 0 : 1;
+ q = (u - v.xyz); Error += (q == (u - v)) ? 0 : 1;
+ q = (u * v.xyz); Error += (q == (u * v)) ? 0 : 1;
+ q = (u * v.xxx); Error += (q == v.x * u) ? 0 : 1;
+ q = (u / v.xyz); Error += (q == (u / v)) ? 0 : 1;
+
+ // swizzle,vec binary operators
+ q = u.xyz + v; Error += (q == (u + v)) ? 0 : 1;
+ q = (u.xyz - v); Error += (q == (u - v)) ? 0 : 1;
+ q = (u.xyz * v); Error += (q == (u * v)) ? 0 : 1;
+ q = (u.xxx * v); Error += (q == u.x * v) ? 0 : 1;
+ q = (u.xyz / v); Error += (q == (u / v)) ? 0 : 1;
+ }
+# endif//GLM_LANG
+
+ // Compile errors
+ //q = (u.yz * v.xyz);
+ //q = (u * v.xy);
+
+ return Error;
+}
+
+int test_vec3_swizzle_functions()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ // NOTE: template functions cannot pick up the implicit conversion from
+ // a swizzle to the unswizzled type, therefore the operator() must be
+ // used. E.g.:
+ //
+ // glm::dot(u.xy, v.xy); <--- Compile error
+ // glm::dot(u.xy(), v.xy()); <--- Compiles correctly
+
+ float r;
+
+ // vec2
+ glm::vec2 a(1, 2);
+ glm::vec2 b(10, 20);
+ r = glm::dot(a, b); Error += (int(r) == 50) ? 0 : 1;
+ r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.xy())); Error += (int(r) == 50) ? 0 : 1;
+ r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.yy())); Error += (int(r) == 60) ? 0 : 1;
+
+ // vec3
+ glm::vec3 u = glm::vec3(1, 2, 3);
+ glm::vec3 v = glm::vec3(10, 20, 30);
+ r = glm::dot(u, v); Error += (int(r) == 140) ? 0 : 1;
+ r = glm::dot(u.xyz(), v.zyz()); Error += (int(r) == 160) ? 0 : 1;
+ r = glm::dot(u, v.zyx()); Error += (int(r) == 100) ? 0 : 1;
+ r = glm::dot(u.xyz(), v); Error += (int(r) == 140) ? 0 : 1;
+ r = glm::dot(u.xy(), v.xy()); Error += (int(r) == 50) ? 0 : 1;
+
+ // vec4
+ glm::vec4 s = glm::vec4(1, 2, 3, 4);
+ glm::vec4 t = glm::vec4(10, 20, 30, 40);
+ r = glm::dot(s, t); Error += (int(r) == 300) ? 0 : 1;
+ r = glm::dot(s.xyzw(), t.xyzw()); Error += (int(r) == 300) ? 0 : 1;
+ r = glm::dot(s.xyz(), t.xyz()); Error += (int(r) == 140) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
+ return Error;
+}
+
+int test_vec3_swizzle_partial()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::vec3 const A(1, 2, 3);
+ glm::vec3 B(A.xy, 3);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec3 const B(1, A.yz);
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 const A(1, 2, 3);
+ glm::ivec3 const B(A.xyz);
+ Error += A == B ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+ return Error;
+}
+
+static int test_operator_increment()
+{
+ int Error = 0;
+
+ glm::ivec3 v0(1);
+ glm::ivec3 v1(v0);
+ glm::ivec3 v2(v0);
+ glm::ivec3 v3 = ++v1;
+ glm::ivec3 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f);
+ glm::vec3 B = A.xyz;
+ glm::vec3 C(A.xyz);
+ glm::vec3 D(A.xyz());
+ glm::vec3 E(A.x, A.yz);
+ glm::vec3 F(A.x, A.yz());
+ glm::vec3 G(A.xy, A.z);
+ glm::vec3 H(A.xy(), A.z);
+
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f);
+ glm::vec3 B = A.xyz();
+ glm::vec3 C(A.xyz());
+ glm::vec3 D(A.xyz());
+ glm::vec3 E(A.x, A.yz());
+ glm::vec3 F(A.x, A.yz());
+ glm::vec3 G(A.xy(), A.z);
+ glm::vec3 H(A.xy(), A.z);
+
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec3_ctor();
+ Error += test_bvec3_ctor();
+ Error += test_vec3_operators();
+ Error += test_vec3_size();
+ Error += test_operator_increment();
+ Error += test_constexpr();
+
+ Error += test_swizzle();
+ Error += test_vec3_swizzle3_2();
+ Error += test_vec3_swizzle3_3();
+ Error += test_vec3_swizzle_partial();
+ Error += test_vec3_swizzle_operators();
+ Error += test_vec3_swizzle_functions();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/core/core_type_vec4.cpp b/3rdparty/glm/source/test/core/core_type_vec4.cpp
new file mode 100644
index 0000000..5d65259
--- /dev/null
+++ b/3rdparty/glm/source/test/core/core_type_vec4.cpp
@@ -0,0 +1,850 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <cstdio>
+#include <ctime>
+#include <vector>
+
+static glm::vec4 g1;
+static glm::vec4 g2(1);
+static glm::vec4 g3(1, 1, 1, 1);
+
+template <int Value>
+struct mask
+{
+ enum{value = Value};
+};
+
+enum comp
+{
+ X,
+ Y,
+ Z,
+ W
+};
+
+//template<comp X, comp Y, comp Z, comp W>
+//__m128 swizzle(glm::vec4 const& v)
+//{
+// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x);
+// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);
+//}
+
+static int test_vec4_ctor()
+{
+ int Error = 0;
+
+ {
+ glm::ivec4 A(1, 2, 3, 4);
+ glm::ivec4 B(A);
+ Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ }
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec4>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec4>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
+# endif
+
+#if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::vec4 a{ 0, 1, 2, 3 };
+ std::vector<glm::vec4> v = {
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 0, 1}};
+ }
+
+ {
+ glm::dvec4 a{ 0, 1, 2, 3 };
+ std::vector<glm::dvec4> v = {
+ {0, 1, 2, 3},
+ {4, 5, 6, 7},
+ {8, 9, 0, 1}};
+ }
+#endif
+
+ {
+ glm::ivec4 const A(1);
+ glm::ivec4 const B(1, 1, 1, 1);
+
+ Error += A == B ? 0 : 1;
+ }
+
+ {
+ std::vector<glm::ivec4> Tests;
+ Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4));
+ Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4));
+ Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4)));
+ Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4));
+ Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4)));
+ Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4)));
+ Tests.push_back(glm::ivec4(1, 2, 3, 4));
+ Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4)));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const R(1.0f);
+ glm::vec1 const S(2.0f);
+ glm::vec1 const T(3.0f);
+ glm::vec1 const U(4.0f);
+ glm::vec4 const O(1.0f, 2.0f, 3.0f, 4.0f);
+
+ glm::vec4 const A(R);
+ glm::vec4 const B(1.0f);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const C(R, S, T, U);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const D(R, 2.0f, 3.0f, 4.0f);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const E(1.0f, S, 3.0f, 4.0f);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const F(R, S, 3.0f, 4.0f);
+ Error += glm::all(glm::equal(F, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const G(1.0f, 2.0f, T, 4.0f);
+ Error += glm::all(glm::equal(G, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const H(R, 2.0f, T, 4.0f);
+ Error += glm::all(glm::equal(H, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const I(1.0f, S, T, 4.0f);
+ Error += glm::all(glm::equal(I, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const J(R, S, T, 4.0f);
+ Error += glm::all(glm::equal(J, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const K(R, 2.0f, 3.0f, U);
+ Error += glm::all(glm::equal(K, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const L(1.0f, S, 3.0f, U);
+ Error += glm::all(glm::equal(L, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const M(R, S, 3.0f, U);
+ Error += glm::all(glm::equal(M, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const N(1.0f, 2.0f, T, U);
+ Error += glm::all(glm::equal(N, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const P(R, 2.0f, T, U);
+ Error += glm::all(glm::equal(P, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const Q(1.0f, S, T, U);
+ Error += glm::all(glm::equal(Q, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const V(R, S, T, U);
+ Error += glm::all(glm::equal(V, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const R(1.0f);
+ glm::dvec1 const S(2.0);
+ glm::vec1 const T(3.0);
+ glm::dvec1 const U(4.0);
+ glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0);
+
+ glm::vec4 const A(R);
+ glm::vec4 const B(1.0);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const C(R, S, T, U);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const D(R, 2.0f, 3.0, 4.0f);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const E(1.0, S, 3.0f, 4.0);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const F(R, S, 3.0, 4.0f);
+ Error += glm::all(glm::equal(F, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const G(1.0f, 2.0, T, 4.0);
+ Error += glm::all(glm::equal(G, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const H(R, 2.0, T, 4.0);
+ Error += glm::all(glm::equal(H, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const I(1.0, S, T, 4.0f);
+ Error += glm::all(glm::equal(I, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const J(R, S, T, 4.0f);
+ Error += glm::all(glm::equal(J, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const K(R, 2.0f, 3.0, U);
+ Error += glm::all(glm::equal(K, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const L(1.0f, S, 3.0, U);
+ Error += glm::all(glm::equal(L, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const M(R, S, 3.0, U);
+ Error += glm::all(glm::equal(M, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const N(1.0f, 2.0, T, U);
+ Error += glm::all(glm::equal(N, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const P(R, 2.0, T, U);
+ Error += glm::all(glm::equal(P, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const Q(1.0f, S, T, U);
+ Error += glm::all(glm::equal(Q, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const V(R, S, T, U);
+ Error += glm::all(glm::equal(V, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const v1_0(1.0f);
+ glm::vec1 const v1_1(2.0f);
+ glm::vec1 const v1_2(3.0f);
+ glm::vec1 const v1_3(4.0f);
+
+ glm::vec2 const v2_0(1.0f, 2.0f);
+ glm::vec2 const v2_1(2.0f, 3.0f);
+ glm::vec2 const v2_2(3.0f, 4.0f);
+
+ glm::vec3 const v3_0(1.0f, 2.0f, 3.0f);
+ glm::vec3 const v3_1(2.0f, 3.0f, 4.0f);
+
+ glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0);
+
+ glm::vec4 const A(v1_0, v1_1, v2_2);
+ Error += glm::all(glm::equal(A, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const B(1.0f, 2.0f, v2_2);
+ Error += glm::all(glm::equal(B, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const C(v1_0, 2.0f, v2_2);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const D(1.0f, v1_1, v2_2);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const E(v2_0, v1_2, v1_3);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const F(v2_0, 3.0, v1_3);
+ Error += glm::all(glm::equal(F, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const G(v2_0, v1_2, 4.0);
+ Error += glm::all(glm::equal(G, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const H(v2_0, 3.0f, 4.0);
+ Error += glm::all(glm::equal(H, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 const v1_0(1.0f);
+ glm::vec1 const v1_1(2.0f);
+ glm::vec1 const v1_2(3.0f);
+ glm::vec1 const v1_3(4.0f);
+
+ glm::vec2 const v2(2.0f, 3.0f);
+
+ glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0);
+
+ glm::vec4 const A(v1_0, v2, v1_3);
+ Error += glm::all(glm::equal(A, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const B(v1_0, v2, 4.0);
+ Error += glm::all(glm::equal(B, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const C(1.0, v2, v1_3);
+ Error += glm::all(glm::equal(C, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const D(1.0f, v2, 4.0);
+ Error += glm::all(glm::equal(D, O, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const E(1.0, v2, 4.0f);
+ Error += glm::all(glm::equal(E, O, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_bvec4_ctor()
+{
+ int Error = 0;
+
+ glm::bvec4 const A(true);
+ glm::bvec4 const B(true);
+ glm::bvec4 const C(false);
+ glm::bvec4 const D = A && B;
+ glm::bvec4 const E = A && C;
+ glm::bvec4 const F = A || C;
+
+ Error += D == glm::bvec4(true) ? 0 : 1;
+ Error += E == glm::bvec4(false) ? 0 : 1;
+ Error += F == glm::bvec4(true) ? 0 : 1;
+
+ bool const G = A == C;
+ bool const H = A != C;
+ Error += !G ? 0 : 1;
+ Error += H ? 0 : 1;
+
+ return Error;
+}
+
+static int test_operators()
+{
+ int Error = 0;
+
+ {
+ glm::ivec4 A(1);
+ glm::ivec4 B(1);
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ glm::vec4 const C = A + B;
+ Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const D = B - A;
+ Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const E = A * B;
+ Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), glm::epsilon<float>()) )? 0 : 1;
+
+ glm::vec4 const F = B / A;
+ Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const G = A + 1.0f;
+ Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const H = B - 1.0f;
+ Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const I = A * 2.0f;
+ Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const J = B / 2.0f;
+ Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const K = 1.0f + A;
+ Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const L = 1.0f - B;
+ Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const M = 2.0f * A;
+ Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), glm::epsilon<float>())) ? 0 : 1;
+
+ glm::vec4 const N = 2.0f / B;
+ Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ A += B;
+ Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1;
+
+ A += 1;
+ Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ B -= A;
+ Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1;
+
+ B -= 1;
+ Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f);
+
+ A *= B;
+ Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1;
+
+ A *= 2;
+ Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1;
+ }
+ {
+ glm::ivec4 A(1.0f, 2.0f, 2.0f, 4.0f);
+ glm::ivec4 B(4.0f, 4.0f, 8.0f, 8.0f);
+
+ B /= A;
+ Error += B == glm::ivec4(4, 2, 4, 2) ? 0 : 1;
+
+ B /= 2;
+ Error += B == glm::ivec4(2, 1, 2, 1) ? 0 : 1;
+ }
+ {
+ glm::ivec4 B(2);
+
+ B /= B.y;
+ Error += B == glm::ivec4(1) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = -A;
+ Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = --A;
+ Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A--;
+ Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1;
+ Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = ++A;
+ Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1;
+ }
+
+ {
+ glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A++;
+ Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1;
+ Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_equal()
+{
+ int Error = 0;
+
+ {
+ glm::uvec4 const A(1, 2, 3, 4);
+ glm::uvec4 const B(1, 2, 3, 4);
+ Error += A == B ? 0 : 1;
+ Error += A != B ? 1 : 0;
+ }
+
+ {
+ glm::ivec4 const A(1, 2, 3, 4);
+ glm::ivec4 const B(1, 2, 3, 4);
+ Error += A == B ? 0 : 1;
+ Error += A != B ? 1 : 0;
+ }
+
+ return Error;
+}
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1;
+ Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1;
+ Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
+ Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1;
+ Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1;
+ Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1;
+ Error += glm::vec4().length() == 4 ? 0 : 1;
+ Error += glm::dvec4().length() == 4 ? 0 : 1;
+ Error += glm::vec4::length() == 4 ? 0 : 1;
+ Error += glm::dvec4::length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_swizzle_partial()
+{
+ int Error = 0;
+
+ glm::vec4 const A(1, 2, 3, 4);
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::vec4 B(A.xy, A.zw);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+ {
+ glm::vec4 B(A.xy, 3.0f, 4.0f);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+ {
+ glm::vec4 B(1.0f, A.yz, 4.0f);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+ {
+ glm::vec4 B(1.0f, 2.0f, A.zw);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 B(A.xyz, 4.0f);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+ {
+ glm::vec4 B(1.0f, A.yzw);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
+ return Error;
+}
+
+static int test_swizzle()
+{
+ int Error = 0;
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+ {
+ glm::ivec4 A = glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::ivec4 B = A.xyzw;
+ glm::ivec4 C(A.xyzw);
+ glm::ivec4 D(A.xyzw());
+ glm::ivec4 E(A.x, A.yzw);
+ glm::ivec4 F(A.x, A.yzw());
+ glm::ivec4 G(A.xyz, A.w);
+ glm::ivec4 H(A.xyz(), A.w);
+ glm::ivec4 I(A.xy, A.zw);
+ glm::ivec4 J(A.xy(), A.zw());
+ glm::ivec4 K(A.x, A.y, A.zw);
+ glm::ivec4 L(A.x, A.yz, A.w);
+ glm::ivec4 M(A.xy, A.z, A.w);
+
+ Error += glm::all(glm::equal(A, B)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, I)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, J)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, K)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, L)) ? 0 : 1;
+ Error += glm::all(glm::equal(A, M)) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
+# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+ {
+ glm::vec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::vec4 B = A.xyzw();
+ glm::vec4 C(A.xyzw());
+ glm::vec4 D(A.xyzw());
+ glm::vec4 E(A.x, A.yzw());
+ glm::vec4 F(A.x, A.yzw());
+ glm::vec4 G(A.xyz(), A.w);
+ glm::vec4 H(A.xyz(), A.w);
+ glm::vec4 I(A.xy(), A.zw());
+ glm::vec4 J(A.xy(), A.zw());
+ glm::vec4 K(A.x, A.y, A.zw());
+ glm::vec4 L(A.x, A.yz(), A.w);
+ glm::vec4 M(A.xy(), A.z, A.w);
+
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, C, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, D, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, E, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, F, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, G, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, H, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, I, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, J, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, K, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, L, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(A, M, glm::epsilon<float>())) ? 0 : 1;
+ }
+# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
+ return Error;
+}
+
+static int test_operator_increment()
+{
+ int Error = 0;
+
+ glm::ivec4 v0(1);
+ glm::ivec4 v1(v0);
+ glm::ivec4 v2(v0);
+ glm::ivec4 v3 = ++v1;
+ glm::ivec4 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+struct AoS
+{
+ glm::vec4 A;
+ glm::vec3 B;
+ glm::vec3 C;
+ glm::vec2 D;
+};
+
+static int test_perf_AoS(std::size_t Size)
+{
+ int Error = 0;
+
+ std::vector<AoS> In;
+ std::vector<AoS> Out;
+ In.resize(Size);
+ Out.resize(Size);
+
+ std::clock_t StartTime = std::clock();
+
+ for(std::size_t i = 0; i < In.size(); ++i)
+ Out[i] = In[i];
+
+ std::clock_t EndTime = std::clock();
+
+ std::printf("AoS: %d\n", static_cast<int>(EndTime - StartTime));
+
+ return Error;
+}
+
+static int test_perf_SoA(std::size_t Size)
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> InA;
+ std::vector<glm::vec3> InB;
+ std::vector<glm::vec3> InC;
+ std::vector<glm::vec2> InD;
+ std::vector<glm::vec4> OutA;
+ std::vector<glm::vec3> OutB;
+ std::vector<glm::vec3> OutC;
+ std::vector<glm::vec2> OutD;
+
+ InA.resize(Size);
+ InB.resize(Size);
+ InC.resize(Size);
+ InD.resize(Size);
+ OutA.resize(Size);
+ OutB.resize(Size);
+ OutC.resize(Size);
+ OutD.resize(Size);
+
+ std::clock_t StartTime = std::clock();
+
+ for(std::size_t i = 0; i < InA.size(); ++i)
+ {
+ OutA[i] = InA[i];
+ OutB[i] = InB[i];
+ OutC[i] = InC[i];
+ OutD[i] = InD[i];
+ }
+
+ std::clock_t EndTime = std::clock();
+
+ std::printf("SoA: %d\n", static_cast<int>(EndTime - StartTime));
+
+ return Error;
+}
+
+namespace heap
+{
+ struct A
+ {
+ float f;
+ };
+
+ struct B : public A
+ {
+ float g;
+ glm::vec4 v;
+ };
+
+ static int test()
+ {
+ int Error = 0;
+
+ A* p = new B;
+ p->f = 0.0f;
+ delete p;
+
+ Error += sizeof(B) == sizeof(glm::vec4) + sizeof(float) * 2 ? 0 : 1;
+
+ return Error;
+ }
+}//namespace heap
+
+static int test_simd()
+{
+ int Error = 0;
+
+ glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock());
+ glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock());
+
+ glm::vec4 const c(b * a);
+ glm::vec4 const d(a + c);
+
+ Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_inheritance()
+{
+ struct my_vec4 : public glm::vec4
+ {
+ my_vec4()
+ : glm::vec4(76.f, 75.f, 74.f, 73.f)
+ , member(82)
+ {}
+
+ int member;
+ };
+
+ int Error = 0;
+
+ my_vec4 v;
+
+ Error += v.member == 82 ? 0 : 1;
+ Error += glm::equal(v.x, 76.f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(v.y, 75.f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(v.z, 74.f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(v.w, 73.f, glm::epsilon<float>()) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr");
+ static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");
+ static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+/*
+static int test_simd_gen()
+{
+ int Error = 0;
+
+ int const C = static_cast<int>(std::clock());
+ int const D = static_cast<int>(std::clock());
+
+ glm::ivec4 const A(C);
+ glm::ivec4 const B(D);
+
+ Error += A != B ? 0 : 1;
+
+ return Error;
+}
+*/
+int main()
+{
+ int Error = 0;
+
+ //Error += test_simd_gen();
+
+/*
+ {
+ glm::ivec4 const a1(2);
+ glm::ivec4 const b1 = a1 >> 1;
+
+ __m128i const e1 = _mm_set1_epi32(2);
+ __m128i const f1 = _mm_srli_epi32(e1, 1);
+
+ glm::ivec4 const g1 = *reinterpret_cast<glm::ivec4 const* const>(&f1);
+
+ glm::ivec4 const a2(-2);
+ glm::ivec4 const b2 = a2 >> 1;
+
+ __m128i const e2 = _mm_set1_epi32(-1);
+ __m128i const f2 = _mm_srli_epi32(e2, 1);
+
+ glm::ivec4 const g2 = *reinterpret_cast<glm::ivec4 const* const>(&f2);
+
+ std::printf("GNI\n");
+ }
+
+ {
+ glm::uvec4 const a1(2);
+ glm::uvec4 const b1 = a1 >> 1u;
+
+ __m128i const e1 = _mm_set1_epi32(2);
+ __m128i const f1 = _mm_srli_epi32(e1, 1);
+
+ glm::uvec4 const g1 = *reinterpret_cast<glm::uvec4 const* const>(&f1);
+
+ glm::uvec4 const a2(-1);
+ glm::uvec4 const b2 = a2 >> 1u;
+
+ __m128i const e2 = _mm_set1_epi32(-1);
+ __m128i const f2 = _mm_srli_epi32(e2, 1);
+
+ glm::uvec4 const g2 = *reinterpret_cast<glm::uvec4 const* const>(&f2);
+
+ std::printf("GNI\n");
+ }
+*/
+
+# ifdef NDEBUG
+ std::size_t const Size(1000000);
+# else
+ std::size_t const Size(1);
+# endif//NDEBUG
+
+ Error += test_perf_AoS(Size);
+ Error += test_perf_SoA(Size);
+
+ Error += test_vec4_ctor();
+ Error += test_bvec4_ctor();
+ Error += test_size();
+ Error += test_operators();
+ Error += test_equal();
+ Error += test_swizzle();
+ Error += test_swizzle_partial();
+ Error += test_simd();
+ Error += test_operator_increment();
+ Error += heap::test();
+ Error += test_inheritance();
+ Error += test_constexpr();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/ext/CMakeLists.txt b/3rdparty/glm/source/test/ext/CMakeLists.txt
new file mode 100644
index 0000000..40c91ba
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/CMakeLists.txt
@@ -0,0 +1,55 @@
+glmCreateTestGTC(ext_matrix_relational)
+glmCreateTestGTC(ext_matrix_transform)
+glmCreateTestGTC(ext_matrix_common)
+glmCreateTestGTC(ext_matrix_integer)
+glmCreateTestGTC(ext_matrix_int2x2_sized)
+glmCreateTestGTC(ext_matrix_int2x3_sized)
+glmCreateTestGTC(ext_matrix_int2x4_sized)
+glmCreateTestGTC(ext_matrix_int3x2_sized)
+glmCreateTestGTC(ext_matrix_int3x3_sized)
+glmCreateTestGTC(ext_matrix_int3x4_sized)
+glmCreateTestGTC(ext_matrix_int4x2_sized)
+glmCreateTestGTC(ext_matrix_int4x3_sized)
+glmCreateTestGTC(ext_matrix_int4x4_sized)
+glmCreateTestGTC(ext_matrix_uint2x2_sized)
+glmCreateTestGTC(ext_matrix_uint2x3_sized)
+glmCreateTestGTC(ext_matrix_uint2x4_sized)
+glmCreateTestGTC(ext_matrix_uint3x2_sized)
+glmCreateTestGTC(ext_matrix_uint3x3_sized)
+glmCreateTestGTC(ext_matrix_uint3x4_sized)
+glmCreateTestGTC(ext_matrix_uint4x2_sized)
+glmCreateTestGTC(ext_matrix_uint4x3_sized)
+glmCreateTestGTC(ext_matrix_uint4x4_sized)
+glmCreateTestGTC(ext_quaternion_common)
+glmCreateTestGTC(ext_quaternion_exponential)
+glmCreateTestGTC(ext_quaternion_geometric)
+glmCreateTestGTC(ext_quaternion_relational)
+glmCreateTestGTC(ext_quaternion_transform)
+glmCreateTestGTC(ext_quaternion_trigonometric)
+glmCreateTestGTC(ext_quaternion_type)
+glmCreateTestGTC(ext_scalar_common)
+glmCreateTestGTC(ext_scalar_constants)
+glmCreateTestGTC(ext_scalar_int_sized)
+glmCreateTestGTC(ext_scalar_uint_sized)
+glmCreateTestGTC(ext_scalar_integer)
+glmCreateTestGTC(ext_scalar_ulp)
+glmCreateTestGTC(ext_scalar_reciprocal)
+glmCreateTestGTC(ext_scalar_relational)
+glmCreateTestGTC(ext_vec1)
+glmCreateTestGTC(ext_vector_bool1)
+glmCreateTestGTC(ext_vector_common)
+glmCreateTestGTC(ext_vector_iec559)
+glmCreateTestGTC(ext_vector_int1_sized)
+glmCreateTestGTC(ext_vector_int2_sized)
+glmCreateTestGTC(ext_vector_int3_sized)
+glmCreateTestGTC(ext_vector_int4_sized)
+glmCreateTestGTC(ext_vector_integer)
+glmCreateTestGTC(ext_vector_integer_sized)
+glmCreateTestGTC(ext_vector_uint1_sized)
+glmCreateTestGTC(ext_vector_uint2_sized)
+glmCreateTestGTC(ext_vector_uint3_sized)
+glmCreateTestGTC(ext_vector_uint4_sized)
+glmCreateTestGTC(ext_vector_reciprocal)
+glmCreateTestGTC(ext_vector_relational)
+glmCreateTestGTC(ext_vector_ulp)
+
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp b/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp
new file mode 100644
index 0000000..ca84c19
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp
@@ -0,0 +1,13 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_clip_space.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_float3.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_common.cpp b/3rdparty/glm/source/test/ext/ext_matrix_common.cpp
new file mode 100644
index 0000000..df0c3fe
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_common.cpp
@@ -0,0 +1,53 @@
+#include <glm/ext/matrix_common.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_bool4.hpp>
+
+static int test_mix()
+{
+ int Error = 0;
+
+ {
+ glm::mat4 A(2);
+ glm::mat4 B(4);
+ glm::mat4 C = glm::mix(A, B, 0.5f);
+ glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1);
+ Error += glm::all(D) ? 0 : 1;
+ }
+
+ {
+ glm::mat4 A(2);
+ glm::mat4 B(4);
+ glm::mat4 C = glm::mix(A, B, 0.5);
+ glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1);
+ Error += glm::all(D) ? 0 : 1;
+ }
+
+ {
+ glm::dmat4 A(2);
+ glm::dmat4 B(4);
+ glm::dmat4 C = glm::mix(A, B, 0.5);
+ glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1);
+ Error += glm::all(D) ? 0 : 1;
+ }
+
+ {
+ glm::dmat4 A(2);
+ glm::dmat4 B(4);
+ glm::dmat4 C = glm::mix(A, B, 0.5f);
+ glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1);
+ Error += glm::all(D) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_mix();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp
new file mode 100644
index 0000000..93b6e86
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int2x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat2x2) < sizeof(glm::i16mat2x2) ? 0 : 1;
+ Error += sizeof(glm::i16mat2x2) < sizeof(glm::i32mat2x2) ? 0 : 1;
+ Error += sizeof(glm::i32mat2x2) < sizeof(glm::i64mat2x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp
new file mode 100644
index 0000000..058f57b
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int2x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat2x3) == 6, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat2x3) == 12, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat2x3) == 24, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat2x3) == 48, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat2x3) < sizeof(glm::i16mat2x3) ? 0 : 1;
+ Error += sizeof(glm::i16mat2x3) < sizeof(glm::i32mat2x3) ? 0 : 1;
+ Error += sizeof(glm::i32mat2x3) < sizeof(glm::i64mat2x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp
new file mode 100644
index 0000000..c20198d
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int2x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat2x4) == 8, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat2x4) == 16, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat2x4) == 32, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat2x4) == 64, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat2x4) < sizeof(glm::i16mat2x4) ? 0 : 1;
+ Error += sizeof(glm::i16mat2x4) < sizeof(glm::i32mat2x4) ? 0 : 1;
+ Error += sizeof(glm::i32mat2x4) < sizeof(glm::i64mat2x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp
new file mode 100644
index 0000000..1d14029
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int3x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat3x2) == 6, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat3x2) == 12, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat3x2) == 24, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat3x2) == 48, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat3x2) < sizeof(glm::i16mat3x2) ? 0 : 1;
+ Error += sizeof(glm::i16mat3x2) < sizeof(glm::i32mat3x2) ? 0 : 1;
+ Error += sizeof(glm::i32mat3x2) < sizeof(glm::i64mat3x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp
new file mode 100644
index 0000000..d82836c
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int3x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat3x3) == 9, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat3x3) == 18, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat3x3) == 36, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat3x3) == 72, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat3x3) < sizeof(glm::i16mat3x3) ? 0 : 1;
+ Error += sizeof(glm::i16mat3x3) < sizeof(glm::i32mat3x3) ? 0 : 1;
+ Error += sizeof(glm::i32mat3x3) < sizeof(glm::i64mat3x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp
new file mode 100644
index 0000000..52b7d52
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int3x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat3x4) == 12, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat3x4) == 24, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat3x4) == 48, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat3x4) == 96, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat3x4) < sizeof(glm::i16mat3x4) ? 0 : 1;
+ Error += sizeof(glm::i16mat3x4) < sizeof(glm::i32mat3x4) ? 0 : 1;
+ Error += sizeof(glm::i32mat3x4) < sizeof(glm::i64mat3x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp
new file mode 100644
index 0000000..3c4566f
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int4x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat4x2) == 8, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat4x2) == 16, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat4x2) == 32, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat4x2) == 64, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat4x2) < sizeof(glm::i16mat4x2) ? 0 : 1;
+ Error += sizeof(glm::i16mat4x2) < sizeof(glm::i32mat4x2) ? 0 : 1;
+ Error += sizeof(glm::i32mat4x2) < sizeof(glm::i64mat4x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp
new file mode 100644
index 0000000..fb882af
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int4x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat4x3) == 12, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat4x3) == 24, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat4x3) == 48, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat4x3) == 96, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat4x3) < sizeof(glm::i16mat4x3) ? 0 : 1;
+ Error += sizeof(glm::i16mat4x3) < sizeof(glm::i32mat4x3) ? 0 : 1;
+ Error += sizeof(glm::i32mat4x3) < sizeof(glm::i64mat4x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp
new file mode 100644
index 0000000..02769ea
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_int4x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8mat4x4) == 16, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16mat4x4) == 32, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32mat4x4) == 64, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64mat4x4) == 128, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8mat4x4) < sizeof(glm::i16mat4x4) ? 0 : 1;
+ Error += sizeof(glm::i16mat4x4) < sizeof(glm::i32mat4x4) ? 0 : 1;
+ Error += sizeof(glm::i32mat4x4) < sizeof(glm::i64mat4x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp b/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp
new file mode 100644
index 0000000..c26d557
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp
@@ -0,0 +1,237 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_integer.hpp>
+#include <glm/ext/matrix_int2x2.hpp>
+#include <glm/ext/matrix_int2x3.hpp>
+#include <glm/ext/matrix_int2x4.hpp>
+#include <glm/ext/matrix_int3x2.hpp>
+#include <glm/ext/matrix_int3x3.hpp>
+#include <glm/ext/matrix_int3x4.hpp>
+#include <glm/ext/matrix_int4x2.hpp>
+#include <glm/ext/matrix_int4x3.hpp>
+#include <glm/ext/matrix_int4x4.hpp>
+
+using namespace glm;
+
+int test_matrixCompMult()
+{
+ int Error = 0;
+
+ {
+ imat2 m(0, 1, 2, 3);
+ imat2 n = matrixCompMult(m, m);
+ imat2 expected = imat2(0, 1, 4, 9);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat2x3 m(0, 1, 2, 3, 4, 5);
+ imat2x3 n = matrixCompMult(m, m);
+ imat2x3 expected = imat2x3(0, 1, 4, 9, 16, 25);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
+ imat2x4 n = matrixCompMult(m, m);
+ imat2x4 expected = imat2x4(0, 1, 4, 9, 16, 25, 36, 49);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
+ imat3 n = matrixCompMult(m, m);
+ imat3 expected = imat3(0, 1, 4, 9, 16, 25, 36, 49, 64);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3x2 m(0, 1, 2, 3, 4, 5);
+ imat3x2 n = matrixCompMult(m, m);
+ imat3x2 expected = imat3x2(0, 1, 4, 9, 16, 25);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ imat3x4 n = matrixCompMult(m, m);
+ imat3x4 expected = imat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ imat4 n = matrixCompMult(m, m);
+ imat4 expected = imat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
+ imat4x2 n = matrixCompMult(m, m);
+ imat4x2 expected = imat4x2(0, 1, 4, 9, 16, 25, 36, 49);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ imat4x3 n = matrixCompMult(m, m);
+ imat4x3 expected = imat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121);
+ Error += all(equal(n, expected)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_outerProduct()
+{
+ int Error = 0;
+
+ {
+ glm::imat2x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec2(1));
+ Error += all(equal(m, glm::imat2x2(1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat2x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec2(1));
+ Error += all(equal(m, glm::imat2x3(1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat2x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec2(1));
+ Error += all(equal(m, glm::imat2x4(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+
+ {
+ glm::imat3x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec3(1));
+ Error += all(equal(m, glm::imat3x2(1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat3x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec3(1));
+ Error += all(equal(m, glm::imat3x3(1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat3x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec3(1));
+ Error += all(equal(m, glm::imat3x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+
+
+ {
+ glm::imat4x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec4(1));
+ Error += all(equal(m, glm::imat4x2(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat4x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec4(1));
+ Error += all(equal(m, glm::imat4x3(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+ {
+ glm::imat4x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec4(1));
+ Error += all(equal(m, glm::imat4x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_transpose()
+{
+ int Error = 0;
+
+ {
+ imat2 const m(0, 1, 2, 3);
+ imat2 const t = transpose(m);
+ imat2 const expected = imat2(0, 2, 1, 3);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat2x3 m(0, 1, 2, 3, 4, 5);
+ imat3x2 t = transpose(m);
+ imat3x2 const expected = imat3x2(0, 3, 1, 4, 2, 5);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
+ imat4x2 t = transpose(m);
+ imat4x2 const expected = imat4x2(0, 4, 1, 5, 2, 6, 3, 7);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
+ imat3 t = transpose(m);
+ imat3 const expected = imat3(0, 3, 6, 1, 4, 7, 2, 5, 8);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3x2 m(0, 1, 2, 3, 4, 5);
+ imat2x3 t = transpose(m);
+ imat2x3 const expected = imat2x3(0, 2, 4, 1, 3, 5);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ imat4x3 t = transpose(m);
+ imat4x3 const expected = imat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ imat4 t = transpose(m);
+ imat4 const expected = imat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
+ imat2x4 t = transpose(m);
+ imat2x4 const expected = imat2x4(0, 2, 4, 6, 1, 3, 5, 7);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ {
+ imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+ imat3x4 t = transpose(m);
+ imat3x4 const expected = imat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11);
+ Error += all(equal(t, expected)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_determinant()
+{
+ int Error = 0;
+
+ {
+ imat2 const m(1, 1, 1, 1);
+ int const t = determinant(m);
+ Error += t == 0 ? 0 : 1;
+ }
+
+ {
+ imat3 m(1, 1, 1, 1, 1, 1, 1, 1, 1);
+ int t = determinant(m);
+ Error += t == 0 ? 0 : 1;
+ }
+
+ {
+ imat4 m(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+ int t = determinant(m);
+ Error += t == 0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_matrixCompMult();
+ Error += test_outerProduct();
+ Error += test_transpose();
+ Error += test_determinant();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp b/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp
new file mode 100644
index 0000000..88f6ae9
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp
@@ -0,0 +1,13 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_projection.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_float3.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp b/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp
new file mode 100644
index 0000000..64c0dae
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp
@@ -0,0 +1,163 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_double2x2.hpp>
+#include <glm/ext/matrix_double2x3.hpp>
+#include <glm/ext/matrix_double2x4.hpp>
+#include <glm/ext/matrix_double3x2.hpp>
+#include <glm/ext/matrix_double3x3.hpp>
+#include <glm/ext/matrix_double3x4.hpp>
+#include <glm/ext/matrix_double4x2.hpp>
+#include <glm/ext/matrix_double4x3.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/vector_double2.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <glm/ext/matrix_float2x2.hpp>
+#include <glm/ext/matrix_float2x3.hpp>
+#include <glm/ext/matrix_float2x4.hpp>
+#include <glm/ext/matrix_float3x2.hpp>
+#include <glm/ext/matrix_float3x3.hpp>
+#include <glm/ext/matrix_float3x4.hpp>
+#include <glm/ext/matrix_float4x2.hpp>
+#include <glm/ext/matrix_float4x3.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/scalar_ulp.hpp>
+
+template <typename matType, typename vecType>
+static int test_equal()
+{
+ typedef typename matType::value_type valType;
+
+ valType const Epsilon = static_cast<valType>(0.001f);
+ valType const One = static_cast<valType>(1);
+ valType const Two = static_cast<valType>(2);
+
+ int Error = 0;
+
+ Error += glm::all(glm::equal(matType(One), matType(One), Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::equal(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0;
+
+ return Error;
+}
+
+template <typename matType, typename vecType>
+static int test_notEqual()
+{
+ typedef typename matType::value_type valType;
+
+ valType const Epsilon = static_cast<valType>(0.001f);
+ valType const One = static_cast<valType>(1);
+ valType const Two = static_cast<valType>(2);
+
+ int Error = 0;
+
+ Error += !glm::any(glm::notEqual(matType(One), matType(One), Epsilon)) ? 0 : 1;
+ Error += !glm::any(glm::notEqual(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0;
+
+ return Error;
+}
+
+
+template <typename T>
+static int test_equal_ulps()
+{
+ typedef glm::mat<4, 4, T, glm::defaultp> mat4;
+
+ T const One(1);
+ mat4 const Ones(1);
+
+ int Error = 0;
+
+ T const ULP1Plus = glm::nextFloat(One);
+ Error += glm::all(glm::equal(Ones, mat4(ULP1Plus), 1)) ? 0 : 1;
+
+ T const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += !glm::all(glm::equal(Ones, mat4(ULP2Plus), 1)) ? 0 : 1;
+
+ T const ULP1Minus = glm::prevFloat(One);
+ Error += glm::all(glm::equal(Ones, mat4(ULP1Minus), 1)) ? 0 : 1;
+
+ T const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += !glm::all(glm::equal(Ones, mat4(ULP2Minus), 1)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_notEqual_ulps()
+{
+ typedef glm::mat<4, 4, T, glm::defaultp> mat4;
+
+ T const One(1);
+ mat4 const Ones(1);
+
+ int Error = 0;
+
+ T const ULP1Plus = glm::nextFloat(One);
+ Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Plus), 1)) ? 0 : 1;
+
+ T const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += glm::all(glm::notEqual(Ones, mat4(ULP2Plus), 1)) ? 0 : 1;
+
+ T const ULP1Minus = glm::prevFloat(One);
+ Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Minus), 1)) ? 0 : 1;
+
+ T const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += glm::all(glm::notEqual(Ones, mat4(ULP2Minus), 1)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_equal_ulps<float>();
+ Error += test_equal_ulps<double>();
+ Error += test_notEqual_ulps<float>();
+ Error += test_notEqual_ulps<double>();
+
+ Error += test_equal<glm::mat2x2, glm::vec2>();
+ Error += test_equal<glm::mat2x3, glm::vec2>();
+ Error += test_equal<glm::mat2x4, glm::vec2>();
+ Error += test_equal<glm::mat3x2, glm::vec3>();
+ Error += test_equal<glm::mat3x3, glm::vec3>();
+ Error += test_equal<glm::mat3x4, glm::vec3>();
+ Error += test_equal<glm::mat4x2, glm::vec4>();
+ Error += test_equal<glm::mat4x3, glm::vec4>();
+ Error += test_equal<glm::mat4x4, glm::vec4>();
+
+ Error += test_equal<glm::dmat2x2, glm::dvec2>();
+ Error += test_equal<glm::dmat2x3, glm::dvec2>();
+ Error += test_equal<glm::dmat2x4, glm::dvec2>();
+ Error += test_equal<glm::dmat3x2, glm::dvec3>();
+ Error += test_equal<glm::dmat3x3, glm::dvec3>();
+ Error += test_equal<glm::dmat3x4, glm::dvec3>();
+ Error += test_equal<glm::dmat4x2, glm::dvec4>();
+ Error += test_equal<glm::dmat4x3, glm::dvec4>();
+ Error += test_equal<glm::dmat4x4, glm::dvec4>();
+
+ Error += test_notEqual<glm::mat2x2, glm::vec2>();
+ Error += test_notEqual<glm::mat2x3, glm::vec2>();
+ Error += test_notEqual<glm::mat2x4, glm::vec2>();
+ Error += test_notEqual<glm::mat3x2, glm::vec3>();
+ Error += test_notEqual<glm::mat3x3, glm::vec3>();
+ Error += test_notEqual<glm::mat3x4, glm::vec3>();
+ Error += test_notEqual<glm::mat4x2, glm::vec4>();
+ Error += test_notEqual<glm::mat4x3, glm::vec4>();
+ Error += test_notEqual<glm::mat4x4, glm::vec4>();
+
+ Error += test_notEqual<glm::dmat2x2, glm::dvec2>();
+ Error += test_notEqual<glm::dmat2x3, glm::dvec2>();
+ Error += test_notEqual<glm::dmat2x4, glm::dvec2>();
+ Error += test_notEqual<glm::dmat3x2, glm::dvec3>();
+ Error += test_notEqual<glm::dmat3x3, glm::dvec3>();
+ Error += test_notEqual<glm::dmat3x4, glm::dvec3>();
+ Error += test_notEqual<glm::dmat4x2, glm::dvec4>();
+ Error += test_notEqual<glm::dmat4x3, glm::dvec4>();
+ Error += test_notEqual<glm::dmat4x4, glm::dvec4>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp b/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp
new file mode 100644
index 0000000..cf653b7
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp
@@ -0,0 +1,61 @@
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_float3.hpp>
+
+static int test_translate()
+{
+ int Error = 0;
+
+ glm::mat4 const M(1.0f);
+ glm::vec3 const V(1.0f);
+
+ glm::mat4 const T = glm::translate(M, V);
+ Error += glm::all(glm::equal(T[3], glm::vec4(1.0f), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_scale()
+{
+ int Error = 0;
+
+ glm::mat4 const M(1.0f);
+ glm::vec3 const V(2.0f);
+
+ glm::mat4 const S = glm::scale(M, V);
+ glm::mat4 const R = glm::mat4(
+ glm::vec4(2, 0, 0, 0),
+ glm::vec4(0, 2, 0, 0),
+ glm::vec4(0, 0, 2, 0),
+ glm::vec4(0, 0, 0, 1));
+ Error += glm::all(glm::equal(S, R, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_rotate()
+{
+ int Error = 0;
+
+ glm::vec4 const A(1.0f, 0.0f, 0.0f, 1.0f);
+
+ glm::mat4 const R = glm::rotate(glm::mat4(1.0f), glm::radians(90.f), glm::vec3(0, 0, 1));
+ glm::vec4 const B = R * A;
+ Error += glm::all(glm::equal(B, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.0001f)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_translate();
+ Error += test_scale();
+ Error += test_rotate();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp
new file mode 100644
index 0000000..a9bd49c
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint2x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat2x2) < sizeof(glm::u16mat2x2) ? 0 : 1;
+ Error += sizeof(glm::u16mat2x2) < sizeof(glm::u32mat2x2) ? 0 : 1;
+ Error += sizeof(glm::u32mat2x2) < sizeof(glm::u64mat2x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp
new file mode 100644
index 0000000..0b75893
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint2x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat2x3) == 6, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat2x3) == 12, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat2x3) == 24, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat2x3) == 48, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat2x3) < sizeof(glm::u16mat2x3) ? 0 : 1;
+ Error += sizeof(glm::u16mat2x3) < sizeof(glm::u32mat2x3) ? 0 : 1;
+ Error += sizeof(glm::u32mat2x3) < sizeof(glm::u64mat2x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp
new file mode 100644
index 0000000..84af4dd
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint2x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat2x4) == 8, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat2x4) == 16, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat2x4) == 32, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat2x4) == 64, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat2x4) < sizeof(glm::u16mat2x4) ? 0 : 1;
+ Error += sizeof(glm::u16mat2x4) < sizeof(glm::u32mat2x4) ? 0 : 1;
+ Error += sizeof(glm::u32mat2x4) < sizeof(glm::u64mat2x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp
new file mode 100644
index 0000000..3c035e2
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint3x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat3x2) == 6, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat3x2) == 12, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat3x2) == 24, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat3x2) == 48, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat3x2) < sizeof(glm::u16mat3x2) ? 0 : 1;
+ Error += sizeof(glm::u16mat3x2) < sizeof(glm::u32mat3x2) ? 0 : 1;
+ Error += sizeof(glm::u32mat3x2) < sizeof(glm::u64mat3x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp
new file mode 100644
index 0000000..64384ed
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint3x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat3x3) == 9, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat3x3) == 18, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat3x3) == 36, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat3x3) == 72, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat3x3) < sizeof(glm::u16mat3x3) ? 0 : 1;
+ Error += sizeof(glm::u16mat3x3) < sizeof(glm::u32mat3x3) ? 0 : 1;
+ Error += sizeof(glm::u32mat3x3) < sizeof(glm::u64mat3x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp
new file mode 100644
index 0000000..7f743df
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint3x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat3x4) == 12, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat3x4) == 24, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat3x4) == 48, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat3x4) == 96, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat3x4) < sizeof(glm::u16mat3x4) ? 0 : 1;
+ Error += sizeof(glm::u16mat3x4) < sizeof(glm::u32mat3x4) ? 0 : 1;
+ Error += sizeof(glm::u32mat3x4) < sizeof(glm::u64mat3x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp
new file mode 100644
index 0000000..2b4453f
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint4x2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat4x2) == 8, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat4x2) == 16, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat4x2) == 32, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat4x2) == 64, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat4x2) < sizeof(glm::u16mat4x2) ? 0 : 1;
+ Error += sizeof(glm::u16mat4x2) < sizeof(glm::u32mat4x2) ? 0 : 1;
+ Error += sizeof(glm::u32mat4x2) < sizeof(glm::u64mat4x2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp
new file mode 100644
index 0000000..2820bde
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint4x3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat4x3) == 12, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat4x3) == 24, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat4x3) == 48, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat4x3) == 96, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat4x3) < sizeof(glm::u16mat4x3) ? 0 : 1;
+ Error += sizeof(glm::u16mat4x3) < sizeof(glm::u32mat4x3) ? 0 : 1;
+ Error += sizeof(glm::u32mat4x3) < sizeof(glm::u64mat4x3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp
new file mode 100644
index 0000000..8f9e239
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/matrix_uint4x4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8mat4x4) == 16, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16mat4x4) == 32, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32mat4x4) == 64, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64mat4x4) == 128, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8mat4x4) < sizeof(glm::u16mat4x4) ? 0 : 1;
+ Error += sizeof(glm::u16mat4x4) < sizeof(glm::u32mat4x4) ? 0 : 1;
+ Error += sizeof(glm::u32mat4x4) < sizeof(glm::u64mat4x4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp
new file mode 100644
index 0000000..861aa65
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp
@@ -0,0 +1,61 @@
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/quaternion_common.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/quaternion_relational.hpp>
+#include <glm/ext/quaternion_trigonometric.hpp>
+#include <glm/ext/scalar_constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+
+static int test_conjugate()
+{
+ int Error = 0;
+
+ glm::quat const A(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0));
+ glm::quat const C = glm::conjugate(A);
+ Error += glm::any(glm::notEqual(A, C, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::quat const B = glm::conjugate(C);
+ Error += glm::all(glm::equal(A, B, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mix()
+{
+ int Error = 0;
+
+ glm::quat const Q1(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0));
+ glm::quat const Q2(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0));
+
+ {
+ glm::quat const Q3 = glm::mix(Q1, Q2, 0.5f);
+ float const F3 = glm::degrees(glm::angle(Q3));
+ Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1;
+
+ glm::quat const Q4 = glm::mix(Q2, Q1, 0.5f);
+ float const F4 = glm::degrees(glm::angle(Q4));
+ Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1;
+ }
+
+ {
+ glm::quat const Q3 = glm::slerp(Q1, Q2, 0.5f);
+ float const F3 = glm::degrees(glm::angle(Q3));
+ Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1;
+
+ glm::quat const Q4 = glm::slerp(Q2, Q1, 0.5f);
+ float const F4 = glm::degrees(glm::angle(Q4));
+ Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_conjugate();
+ Error += test_mix();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp
new file mode 100644
index 0000000..fbcdbef
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp
@@ -0,0 +1,87 @@
+#include <glm/ext/quaternion_exponential.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/quaternion_float_precision.hpp>
+#include <glm/ext/quaternion_double.hpp>
+#include <glm/ext/quaternion_double_precision.hpp>
+#include <glm/ext/quaternion_relational.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float3_precision.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double3_precision.hpp>
+#include <glm/ext/scalar_constants.hpp>
+
+template <typename quaType, typename vecType>
+int test_log()
+{
+ typedef typename quaType::value_type T;
+
+ T const Epsilon = static_cast<T>(0.001f);
+
+ int Error = 0;
+
+ quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0));
+ quaType const P = glm::log(Q);
+ Error += glm::any(glm::notEqual(Q, P, Epsilon)) ? 0 : 1;
+
+ quaType const R = glm::exp(P);
+ Error += glm::all(glm::equal(Q, R, Epsilon)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename quaType, typename vecType>
+int test_pow()
+{
+ typedef typename quaType::value_type T;
+
+ T const Epsilon = static_cast<T>(0.001f);
+
+ int Error = 0;
+
+ quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0));
+
+ {
+ T const One = static_cast<T>(1.0f);
+ quaType const P = glm::pow(Q, One);
+ Error += glm::all(glm::equal(Q, P, Epsilon)) ? 0 : 1;
+ }
+
+ {
+ T const Two = static_cast<T>(2.0f);
+ quaType const P = glm::pow(Q, Two);
+ quaType const R = Q * Q;
+ Error += glm::all(glm::equal(P, R, Epsilon)) ? 0 : 1;
+
+ quaType const U = glm::sqrt(P);
+ Error += glm::all(glm::equal(Q, U, Epsilon)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_log<glm::quat, glm::vec3>();
+ Error += test_log<glm::lowp_quat, glm::lowp_vec3>();
+ Error += test_log<glm::mediump_quat, glm::mediump_vec3>();
+ Error += test_log<glm::highp_quat, glm::highp_vec3>();
+
+ Error += test_log<glm::dquat, glm::dvec3>();
+ Error += test_log<glm::lowp_dquat, glm::lowp_dvec3>();
+ Error += test_log<glm::mediump_dquat, glm::mediump_dvec3>();
+ Error += test_log<glm::highp_dquat, glm::highp_dvec3>();
+
+ Error += test_pow<glm::quat, glm::vec3>();
+ Error += test_pow<glm::lowp_quat, glm::lowp_vec3>();
+ Error += test_pow<glm::mediump_quat, glm::mediump_vec3>();
+ Error += test_pow<glm::highp_quat, glm::highp_vec3>();
+
+ Error += test_pow<glm::dquat, glm::dvec3>();
+ Error += test_pow<glm::lowp_dquat, glm::lowp_dvec3>();
+ Error += test_pow<glm::mediump_dquat, glm::mediump_dvec3>();
+ Error += test_pow<glm::highp_dquat, glm::highp_dvec3>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp
new file mode 100644
index 0000000..73b5dea
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp
@@ -0,0 +1,88 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/quaternion_geometric.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/quaternion_trigonometric.hpp>
+#include <glm/ext/quaternion_float_precision.hpp>
+#include <glm/ext/quaternion_double.hpp>
+#include <glm/ext/quaternion_double_precision.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float3_precision.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double3_precision.hpp>
+#include <glm/ext/scalar_relational.hpp>
+
+float const Epsilon = 0.001f;
+
+static int test_length()
+{
+ int Error = 0;
+
+ {
+ float const A = glm::length(glm::quat(1, 0, 0, 0));
+ Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1;
+ }
+
+ {
+ float const A = glm::length(glm::quat(1, glm::vec3(0)));
+ Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1;
+ }
+
+ {
+ float const A = glm::length(glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)));
+ Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_normalize()
+{
+ int Error = 0;
+
+ {
+ glm::quat const A = glm::quat(1, 0, 0, 0);
+ glm::quat const N = glm::normalize(A);
+ Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1;
+ }
+
+ {
+ glm::quat const A = glm::quat(1, glm::vec3(0));
+ glm::quat const N = glm::normalize(A);
+ Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_dot()
+{
+ int Error = 0;
+
+ {
+ glm::quat const A = glm::quat(1, 0, 0, 0);
+ glm::quat const B = glm::quat(1, 0, 0, 0);
+ float const C = glm::dot(A, B);
+ Error += glm::equal(C, 1.0f, Epsilon) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_cross()
+{
+ int Error = 0;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_length();
+ Error += test_normalize();
+ Error += test_dot();
+ Error += test_cross();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp
new file mode 100644
index 0000000..7f51fdc
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp
@@ -0,0 +1,51 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/quaternion_relational.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/quaternion_float_precision.hpp>
+#include <glm/ext/quaternion_double.hpp>
+#include <glm/ext/quaternion_double_precision.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float3_precision.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double3_precision.hpp>
+
+template <typename quaType>
+static int test_equal()
+{
+ int Error = 0;
+
+ quaType const Q(1, 0, 0, 0);
+ quaType const P(1, 0, 0, 0);
+ Error += glm::all(glm::equal(Q, P, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename quaType>
+static int test_notEqual()
+{
+ int Error = 0;
+
+ quaType const Q(1, 0, 0, 0);
+ quaType const P(1, 0, 0, 0);
+ Error += glm::any(glm::notEqual(Q, P, glm::epsilon<float>())) ? 1 : 0;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_equal<glm::quat>();
+ Error += test_equal<glm::lowp_quat>();
+ Error += test_equal<glm::mediump_quat>();
+ Error += test_equal<glm::highp_quat>();
+
+ Error += test_notEqual<glm::quat>();
+ Error += test_notEqual<glm::lowp_quat>();
+ Error += test_notEqual<glm::mediump_quat>();
+ Error += test_notEqual<glm::highp_quat>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp
new file mode 100644
index 0000000..fefe88e
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp
@@ -0,0 +1,45 @@
+#include <glm/ext/quaternion_transform.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_constants.hpp>
+
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/quaternion.hpp>
+
+static int test_lookAt()
+{
+ int Error(0);
+
+ glm::vec3 eye(0.0f);
+ glm::vec3 center(1.1f, -2.0f, 3.1416f);
+ glm::vec3 up(-0.17f, 7.23f, -1.744f);
+
+ glm::quat test_quat = glm::quatLookAt(glm::normalize(center - eye), up);
+ glm::quat test_mat = glm::conjugate(glm::quat_cast(glm::lookAt(eye, center, up)));
+
+ Error += static_cast<int>(glm::abs(glm::length(test_quat) - 1.0f) > glm::epsilon<float>());
+ Error += static_cast<int>(glm::min(glm::length(test_quat + (-test_mat)), glm::length(test_quat + test_mat)) > glm::epsilon<float>());
+
+ // Test left-handed implementation
+ glm::quat test_quatLH = glm::quatLookAtLH(glm::normalize(center - eye), up);
+ glm::quat test_matLH = glm::conjugate(glm::quat_cast(glm::lookAtLH(eye, center, up)));
+ Error += static_cast<int>(glm::abs(glm::length(test_quatLH) - 1.0f) > glm::epsilon<float>());
+ Error += static_cast<int>(glm::min(glm::length(test_quatLH - test_matLH), glm::length(test_quatLH + test_matLH)) > glm::epsilon<float>());
+
+ // Test right-handed implementation
+ glm::quat test_quatRH = glm::quatLookAtRH(glm::normalize(center - eye), up);
+ glm::quat test_matRH = glm::conjugate(glm::quat_cast(glm::lookAtRH(eye, center, up)));
+ Error += static_cast<int>(glm::abs(glm::length(test_quatRH) - 1.0f) > glm::epsilon<float>());
+ Error += static_cast<int>(glm::min(glm::length(test_quatRH - test_matRH), glm::length(test_quatRH + test_matRH)) > glm::epsilon<float>());
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_lookAt();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp
new file mode 100644
index 0000000..d237125
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp
@@ -0,0 +1,40 @@
+#include <glm/ext/quaternion_trigonometric.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_relational.hpp>
+
+float const Epsilon = 0.001f;
+
+static int test_angle()
+{
+ int Error = 0;
+
+ {
+ glm::quat const Q = glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0));
+ float const A = glm::degrees(glm::angle(Q));
+ Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1;
+ }
+
+ {
+ glm::quat const Q = glm::quat(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0));
+ float const A = glm::degrees(glm::angle(Q));
+ Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1;
+ }
+
+ {
+ glm::quat const Q = glm::angleAxis(glm::two_pi<float>() - 1.0f, glm::vec3(1, 0, 0));
+ float const A = glm::angle(Q);
+ Error += glm::equal(A, 1.0f, Epsilon) ? 1 : 0;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_angle();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp
new file mode 100644
index 0000000..7e61149
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp
@@ -0,0 +1,113 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/quaternion_relational.hpp>
+#include <glm/ext/quaternion_float.hpp>
+#include <glm/ext/quaternion_float_precision.hpp>
+#include <glm/ext/quaternion_double.hpp>
+#include <glm/ext/quaternion_double_precision.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <vector>
+
+static int test_ctr()
+{
+ int Error(0);
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1;
+ // Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::quat>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::dquat>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::quat>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dquat>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::quat>::value ? 0 : 1;
+ Error += std::is_copy_constructible<glm::dquat>::value ? 0 : 1;
+# endif
+
+# if GLM_HAS_INITIALIZER_LISTS
+ {
+ glm::quat A{0, 1, 2, 3};
+
+ std::vector<glm::quat> B{
+ {0, 1, 2, 3},
+ {0, 1, 2, 3}};
+ }
+# endif//GLM_HAS_INITIALIZER_LISTS
+
+ return Error;
+}
+
+static int test_two_axis_ctr()
+{
+ int Error = 0;
+
+ glm::quat const q1(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0));
+ glm::vec3 const v1 = q1 * glm::vec3(1, 0, 0);
+ Error += glm::all(glm::equal(v1, glm::vec3(0, 1, 0), 0.0001f)) ? 0 : 1;
+
+ glm::quat const q2 = q1 * q1;
+ glm::vec3 const v2 = q2 * glm::vec3(1, 0, 0);
+ Error += glm::all(glm::equal(v2, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1;
+
+ glm::quat const q3(glm::vec3(1, 0, 0), glm::vec3(-1, 0, 0));
+ glm::vec3 const v3 = q3 * glm::vec3(1, 0, 0);
+ Error += glm::all(glm::equal(v3, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1;
+
+ glm::quat const q4(glm::vec3(0, 1, 0), glm::vec3(0, -1, 0));
+ glm::vec3 const v4 = q4 * glm::vec3(0, 1, 0);
+ Error += glm::all(glm::equal(v4, glm::vec3(0, -1, 0), 0.0001f)) ? 0 : 1;
+
+ glm::quat const q5(glm::vec3(0, 0, 1), glm::vec3(0, 0, -1));
+ glm::vec3 const v5 = q5 * glm::vec3(0, 0, 1);
+ Error += glm::all(glm::equal(v5, glm::vec3(0, 0, -1), 0.0001f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_size()
+{
+ int Error = 0;
+
+ std::size_t const A = sizeof(glm::quat);
+ Error += 16 == A ? 0 : 1;
+ std::size_t const B = sizeof(glm::dquat);
+ Error += 32 == B ? 0 : 1;
+ Error += glm::quat().length() == 4 ? 0 : 1;
+ Error += glm::dquat().length() == 4 ? 0 : 1;
+ Error += glm::quat::length() == 4 ? 0 : 1;
+ Error += glm::dquat::length() == 4 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_precision()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::lowp_quat) <= sizeof(glm::mediump_quat) ? 0 : 1;
+ Error += sizeof(glm::mediump_quat) <= sizeof(glm::highp_quat) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::quat::length() == 4, "GLM: Failed constexpr");
+ static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ctr();
+ Error += test_two_axis_ctr();
+ Error += test_size();
+ Error += test_precision();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_common.cpp b/3rdparty/glm/source/test/ext/ext_scalar_common.cpp
new file mode 100644
index 0000000..917a242
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_common.cpp
@@ -0,0 +1,360 @@
+#include <glm/ext/scalar_common.hpp>
+#include <glm/ext/scalar_constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/common.hpp>
+
+#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC))
+# define GLM_NAN(T) NAN
+#else
+# define GLM_NAN(T) (static_cast<T>(0.0f) / static_cast<T>(0.0f))
+#endif
+
+template <typename T>
+static int test_min()
+{
+ int Error = 0;
+
+ T const N = static_cast<T>(0);
+ T const B = static_cast<T>(1);
+ Error += glm::equal(glm::min(N, B), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(B, N), N, glm::epsilon<T>()) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::equal(glm::min(N, B, C), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(B, N, C), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(C, N, B), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(C, B, N), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(B, C, N), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(N, C, B), N, glm::epsilon<T>()) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += glm::equal(glm::min(D, N, B, C), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(B, D, N, C), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(C, N, D, B), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(C, B, D, N), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(B, C, N, D), N, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::min(N, C, B, D), N, glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_min_nan()
+{
+ int Error = 0;
+
+ T const B = static_cast<T>(1);
+ T const N = static_cast<T>(GLM_NAN(T));
+ Error += glm::isnan(glm::min(N, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(B, N)) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::isnan(glm::min(N, B, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(B, N, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(C, N, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(C, B, N)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(B, C, N)) ? 0 : 1;
+ Error += glm::isnan(glm::min(N, C, B)) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += !glm::isnan(glm::min(D, N, B, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(B, D, N, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(C, N, D, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(C, B, D, N)) ? 0 : 1;
+ Error += !glm::isnan(glm::min(B, C, N, D)) ? 0 : 1;
+ Error += glm::isnan(glm::min(N, C, B, D)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_max()
+{
+ int Error = 0;
+
+ T const N = static_cast<T>(0);
+ T const B = static_cast<T>(1);
+ Error += glm::equal(glm::max(N, B), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(B, N), B, glm::epsilon<T>()) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::equal(glm::max(N, B, C), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(B, N, C), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(C, N, B), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(C, B, N), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(B, C, N), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(N, C, B), C, glm::epsilon<T>()) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += glm::equal(glm::max(D, N, B, C), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(B, D, N, C), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(C, N, D, B), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(C, B, D, N), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(B, C, N, D), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::max(N, C, B, D), D, glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_max_nan()
+{
+ int Error = 0;
+
+ T const B = static_cast<T>(1);
+ T const N = static_cast<T>(GLM_NAN(T));
+ Error += glm::isnan(glm::max(N, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(B, N)) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::isnan(glm::max(N, B, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(B, N, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(C, N, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(C, B, N)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(B, C, N)) ? 0 : 1;
+ Error += glm::isnan(glm::max(N, C, B)) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += !glm::isnan(glm::max(D, N, B, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(B, D, N, C)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(C, N, D, B)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(C, B, D, N)) ? 0 : 1;
+ Error += !glm::isnan(glm::max(B, C, N, D)) ? 0 : 1;
+ Error += glm::isnan(glm::max(N, C, B, D)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_fmin()
+{
+ int Error = 0;
+
+ T const B = static_cast<T>(1);
+ T const N = static_cast<T>(GLM_NAN(T));
+ Error += glm::equal(glm::fmin(N, B), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(B, N), B, glm::epsilon<T>()) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::equal(glm::fmin(N, B, C), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(B, N, C), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(C, N, B), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(C, B, N), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(B, C, N), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(N, C, B), B, glm::epsilon<T>()) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_fmax()
+{
+ int Error = 0;
+
+ T const B = static_cast<T>(1);
+ T const N = static_cast<T>(GLM_NAN(T));
+ Error += glm::equal(glm::fmax(N, B), B, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(B, N), B, glm::epsilon<T>()) ? 0 : 1;
+
+ T const C = static_cast<T>(2);
+ Error += glm::equal(glm::fmax(N, B, C), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(B, N, C), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(C, N, B), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(C, B, N), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(B, C, N), C, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(N, C, B), C, glm::epsilon<T>()) ? 0 : 1;
+
+ T const D = static_cast<T>(3);
+ Error += glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon<T>()) ? 0 : 1;
+ Error += glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_clamp()
+{
+ int Error = 0;
+
+ float A = glm::clamp(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::clamp(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::clamp(1.0f);
+ Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::clamp(-0.5f);
+ Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1;
+
+ float E = glm::clamp(1.5f);
+ Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_repeat()
+{
+ int Error = 0;
+
+ float A = glm::repeat(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::repeat(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::repeat(1.0f);
+ Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::repeat(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::repeat(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::repeat(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mirrorClamp()
+{
+ int Error = 0;
+
+ float A = glm::mirrorClamp(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::mirrorClamp(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::mirrorClamp(1.1f);
+ Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1;
+
+ float D = glm::mirrorClamp(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::mirrorClamp(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::mirrorClamp(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ float G = glm::mirrorClamp(3.1f);
+ Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1;
+
+ float H = glm::mirrorClamp(-3.1f);
+ Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1;
+
+ float I = glm::mirrorClamp(-0.9f);
+ Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mirrorRepeat()
+{
+ int Error = 0;
+
+ float A = glm::mirrorRepeat(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::mirrorRepeat(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::mirrorRepeat(1.0f);
+ Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::mirrorRepeat(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::mirrorRepeat(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::mirrorRepeat(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ float G = glm::mirrorRepeat(3.0f);
+ Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1;
+
+ float H = glm::mirrorRepeat(-3.0f);
+ Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1;
+
+ float I = glm::mirrorRepeat(-1.0f);
+ Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_iround()
+{
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::iround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+static int test_uround()
+{
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::uround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_min<float>();
+ Error += test_min<double>();
+ Error += test_min_nan<float>();
+ Error += test_min_nan<double>();
+
+ Error += test_max<float>();
+ Error += test_max<double>();
+ Error += test_max_nan<float>();
+ Error += test_max_nan<double>();
+
+ Error += test_fmin<float>();
+ Error += test_fmin<double>();
+
+ Error += test_fmax<float>();
+ Error += test_fmax<double>();
+
+ Error += test_clamp();
+ Error += test_repeat();
+ Error += test_mirrorClamp();
+ Error += test_mirrorRepeat();
+
+ Error += test_iround();
+ Error += test_uround();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp b/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp
new file mode 100644
index 0000000..3af7099
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp
@@ -0,0 +1,36 @@
+#include <glm/ext/scalar_constants.hpp>
+
+template <typename valType>
+static int test_epsilon()
+{
+ int Error = 0;
+
+ valType const Test = glm::epsilon<valType>();
+ Error += Test > static_cast<valType>(0) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename valType>
+static int test_pi()
+{
+ int Error = 0;
+
+ valType const Test = glm::pi<valType>();
+ Error += Test > static_cast<valType>(3.14) ? 0 : 1;
+ Error += Test < static_cast<valType>(3.15) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_epsilon<float>();
+ Error += test_epsilon<double>();
+ Error += test_pi<float>();
+ Error += test_pi<double>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp b/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp
new file mode 100644
index 0000000..b55c6ca
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp
@@ -0,0 +1,43 @@
+#include <glm/ext/scalar_int_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
+ static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::int8) == 1 ? 0 : 1;
+ Error += sizeof(glm::int16) == 2 ? 0 : 1;
+ Error += sizeof(glm::int32) == 4 ? 0 : 1;
+ Error += sizeof(glm::int64) == 8 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::int8) < sizeof(glm::int16) ? 0 : 1;
+ Error += sizeof(glm::int16) < sizeof(glm::int32) ? 0 : 1;
+ Error += sizeof(glm::int32) < sizeof(glm::int64) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp b/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp
new file mode 100644
index 0000000..f169e8a
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp
@@ -0,0 +1,686 @@
+#include <glm/ext/scalar_integer.hpp>
+#include <glm/ext/scalar_int_sized.hpp>
+#include <glm/ext/scalar_uint_sized.hpp>
+#include <vector>
+#include <ctime>
+#include <cstdio>
+
+#if GLM_LANG & GLM_LANG_CXX11_FLAG
+#include <chrono>
+
+namespace isPowerOfTwo
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ bool Return;
+ };
+
+ int test_int16()
+ {
+ type<glm::int16> const Data[] =
+ {
+ {0x0001, true},
+ {0x0002, true},
+ {0x0004, true},
+ {0x0080, true},
+ {0x0000, true},
+ {0x0003, false}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::int16>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint16()
+ {
+ type<glm::uint16> const Data[] =
+ {
+ {0x0001, true},
+ {0x0002, true},
+ {0x0004, true},
+ {0x0000, true},
+ {0x0000, true},
+ {0x0003, false}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint16>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_int32()
+ {
+ type<int> const Data[] =
+ {
+ {0x00000001, true},
+ {0x00000002, true},
+ {0x00000004, true},
+ {0x0000000f, false},
+ {0x00000000, true},
+ {0x00000003, false}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint32()
+ {
+ type<glm::uint> const Data[] =
+ {
+ {0x00000001, true},
+ {0x00000002, true},
+ {0x00000004, true},
+ {0x80000000, true},
+ {0x00000000, true},
+ {0x00000003, false}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += test_int16();
+ Error += test_uint16();
+ Error += test_int32();
+ Error += test_uint32();
+
+ return Error;
+ }
+}//isPowerOfTwo
+
+namespace nextPowerOfTwo_advanced
+{
+ template<typename genIUType>
+ GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
+ {
+ genIUType tmp = Value;
+ genIUType result = genIUType(0);
+ while(tmp)
+ {
+ result = (tmp & (~tmp + 1)); // grab lowest bit
+ tmp &= ~result; // clear lowest bit
+ }
+ return result;
+ }
+
+ template<typename genType>
+ GLM_FUNC_QUALIFIER genType nextPowerOfTwo_loop(genType value)
+ {
+ return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1;
+ }
+
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ };
+
+ int test_int32()
+ {
+ type<glm::int32> const Data[] =
+ {
+ {0x0000ffff, 0x00010000},
+ {-3, -4},
+ {-8, -8},
+ {0x00000001, 0x00000001},
+ {0x00000002, 0x00000002},
+ {0x00000004, 0x00000004},
+ {0x00000007, 0x00000008},
+ {0x0000fff0, 0x00010000},
+ {0x0000f000, 0x00010000},
+ {0x08000000, 0x08000000},
+ {0x00000000, 0x00000000},
+ {0x00000003, 0x00000004}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::int32>); i < n; ++i)
+ {
+ glm::int32 Result = glm::nextPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint32()
+ {
+ type<glm::uint32> const Data[] =
+ {
+ {0x00000001, 0x00000001},
+ {0x00000002, 0x00000002},
+ {0x00000004, 0x00000004},
+ {0x00000007, 0x00000008},
+ {0x0000ffff, 0x00010000},
+ {0x0000fff0, 0x00010000},
+ {0x0000f000, 0x00010000},
+ {0x80000000, 0x80000000},
+ {0x00000000, 0x00000000},
+ {0x00000003, 0x00000004}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint32>); i < n; ++i)
+ {
+ glm::uint32 Result = glm::nextPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int perf()
+ {
+ int Error(0);
+
+ std::vector<glm::uint> v;
+ v.resize(100000000);
+
+ std::clock_t Timestramp0 = std::clock();
+
+ for(glm::uint32 i = 0, n = static_cast<glm::uint>(v.size()); i < n; ++i)
+ v[i] = nextPowerOfTwo_loop(i);
+
+ std::clock_t Timestramp1 = std::clock();
+
+ for(glm::uint32 i = 0, n = static_cast<glm::uint>(v.size()); i < n; ++i)
+ v[i] = glm::nextPowerOfTwo(i);
+
+ std::clock_t Timestramp2 = std::clock();
+
+ std::printf("nextPowerOfTwo_loop: %d clocks\n", static_cast<int>(Timestramp1 - Timestramp0));
+ std::printf("glm::nextPowerOfTwo: %d clocks\n", static_cast<int>(Timestramp2 - Timestramp1));
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_int32();
+ Error += test_uint32();
+
+ return Error;
+ }
+}//namespace nextPowerOfTwo_advanced
+
+namespace prevPowerOfTwo
+{
+ template <typename T>
+ int run()
+ {
+ int Error = 0;
+
+ T const A = glm::prevPowerOfTwo(static_cast<T>(7));
+ Error += A == static_cast<T>(4) ? 0 : 1;
+
+ T const B = glm::prevPowerOfTwo(static_cast<T>(15));
+ Error += B == static_cast<T>(8) ? 0 : 1;
+
+ T const C = glm::prevPowerOfTwo(static_cast<T>(31));
+ Error += C == static_cast<T>(16) ? 0 : 1;
+
+ T const D = glm::prevPowerOfTwo(static_cast<T>(32));
+ Error += D == static_cast<T>(32) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<glm::int8>();
+ Error += run<glm::int16>();
+ Error += run<glm::int32>();
+ Error += run<glm::int64>();
+
+ Error += run<glm::uint8>();
+ Error += run<glm::uint16>();
+ Error += run<glm::uint32>();
+ Error += run<glm::uint64>();
+
+ return Error;
+ }
+}//namespace prevPowerOfTwo
+
+namespace nextPowerOfTwo
+{
+ template <typename T>
+ int run()
+ {
+ int Error = 0;
+
+ T const A = glm::nextPowerOfTwo(static_cast<T>(7));
+ Error += A == static_cast<T>(8) ? 0 : 1;
+
+ T const B = glm::nextPowerOfTwo(static_cast<T>(15));
+ Error += B == static_cast<T>(16) ? 0 : 1;
+
+ T const C = glm::nextPowerOfTwo(static_cast<T>(31));
+ Error += C == static_cast<T>(32) ? 0 : 1;
+
+ T const D = glm::nextPowerOfTwo(static_cast<T>(32));
+ Error += D == static_cast<T>(32) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<glm::int8>();
+ Error += run<glm::int16>();
+ Error += run<glm::int32>();
+ Error += run<glm::int64>();
+
+ Error += run<glm::uint8>();
+ Error += run<glm::uint16>();
+ Error += run<glm::uint32>();
+ Error += run<glm::uint64>();
+
+ return Error;
+ }
+}//namespace nextPowerOfTwo
+
+namespace prevMultiple
+{
+ template<typename genIUType>
+ struct type
+ {
+ genIUType Source;
+ genIUType Multiple;
+ genIUType Return;
+ };
+
+ template <typename T>
+ int run()
+ {
+ type<T> const Data[] =
+ {
+ {8, 3, 6},
+ {7, 7, 7}
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ T const Result = glm::prevMultiple(Data[i].Source, Data[i].Multiple);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<glm::int8>();
+ Error += run<glm::int16>();
+ Error += run<glm::int32>();
+ Error += run<glm::int64>();
+
+ Error += run<glm::uint8>();
+ Error += run<glm::uint16>();
+ Error += run<glm::uint32>();
+ Error += run<glm::uint64>();
+
+ return Error;
+ }
+}//namespace prevMultiple
+
+namespace nextMultiple
+{
+ static glm::uint const Multiples = 128;
+
+ int perf_nextMultiple(glm::uint Samples)
+ {
+ std::vector<glm::uint> Results(Samples * Multiples);
+
+ std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now();
+
+ for(glm::uint Source = 0; Source < Samples; ++Source)
+ for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple)
+ {
+ Results[Source * Multiples + Multiple] = glm::nextMultiple(Source, Multiples);
+ }
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+
+ std::printf("- glm::nextMultiple Time %d microseconds\n", static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()));
+
+ glm::uint Result = 0;
+ for(std::size_t i = 0, n = Results.size(); i < n; ++i)
+ Result += Results[i];
+
+ return Result > 0 ? 0 : 1;
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER T nextMultipleMod(T Source, T Multiple)
+ {
+ T const Tmp = Source - static_cast<T>(1);
+ return Tmp + (Multiple - (Tmp % Multiple));
+ }
+
+ int perf_nextMultipleMod(glm::uint Samples)
+ {
+ std::vector<glm::uint> Results(Samples * Multiples);
+
+ std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now();
+
+ for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple)
+ for (glm::uint Source = 0; Source < Samples; ++Source)
+ {
+ Results[Source * Multiples + Multiple] = nextMultipleMod(Source, Multiples);
+ }
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+
+ std::printf("- nextMultipleMod Time %d microseconds\n", static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()));
+
+ glm::uint Result = 0;
+ for(std::size_t i = 0, n = Results.size(); i < n; ++i)
+ Result += Results[i];
+
+ return Result > 0 ? 0 : 1;
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER T nextMultipleNeg(T Source, T Multiple)
+ {
+ if(Source > static_cast<T>(0))
+ {
+ T const Tmp = Source - static_cast<T>(1);
+ return Tmp + (Multiple - (Tmp % Multiple));
+ }
+ else
+ return Source + (-Source % Multiple);
+ }
+
+ int perf_nextMultipleNeg(glm::uint Samples)
+ {
+ std::vector<glm::uint> Results(Samples * Multiples);
+
+ std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now();
+
+ for(glm::uint Source = 0; Source < Samples; ++Source)
+ for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple)
+ {
+ Results[Source * Multiples + Multiple] = nextMultipleNeg(Source, Multiples);
+ }
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+
+ std::printf("- nextMultipleNeg Time %d microseconds\n", static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()));
+
+ glm::uint Result = 0;
+ for (std::size_t i = 0, n = Results.size(); i < n; ++i)
+ Result += Results[i];
+
+ return Result > 0 ? 0 : 1;
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER T nextMultipleUFloat(T Source, T Multiple)
+ {
+ return Source + (Multiple - std::fmod(Source, Multiple));
+ }
+
+ int perf_nextMultipleUFloat(glm::uint Samples)
+ {
+ std::vector<float> Results(Samples * Multiples);
+
+ std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now();
+
+ for(glm::uint Source = 0; Source < Samples; ++Source)
+ for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple)
+ {
+ Results[Source * Multiples + Multiple] = nextMultipleUFloat(static_cast<float>(Source), static_cast<float>(Multiples));
+ }
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+
+ std::printf("- nextMultipleUFloat Time %d microseconds\n", static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()));
+
+ float Result = 0;
+ for (std::size_t i = 0, n = Results.size(); i < n; ++i)
+ Result += Results[i];
+
+ return Result > 0.0f ? 0 : 1;
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER T nextMultipleFloat(T Source, T Multiple)
+ {
+ if(Source > static_cast<float>(0))
+ return Source + (Multiple - std::fmod(Source, Multiple));
+ else
+ return Source + std::fmod(-Source, Multiple);
+ }
+
+ int perf_nextMultipleFloat(glm::uint Samples)
+ {
+ std::vector<float> Results(Samples * Multiples);
+
+ std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now();
+
+ for(glm::uint Source = 0; Source < Samples; ++Source)
+ for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple)
+ {
+ Results[Source * Multiples + Multiple] = nextMultipleFloat(static_cast<float>(Source), static_cast<float>(Multiples));
+ }
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+
+ std::printf("- nextMultipleFloat Time %d microseconds\n", static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()));
+
+ float Result = 0;
+ for (std::size_t i = 0, n = Results.size(); i < n; ++i)
+ Result += Results[i];
+
+ return Result > 0.0f ? 0 : 1;
+ }
+
+ template<typename genIUType>
+ struct type
+ {
+ genIUType Source;
+ genIUType Multiple;
+ genIUType Return;
+ };
+
+ template <typename T>
+ int test_uint()
+ {
+ type<T> const Data[] =
+ {
+ { 3, 4, 4 },
+ { 6, 3, 6 },
+ { 5, 3, 6 },
+ { 7, 7, 7 },
+ { 0, 1, 0 },
+ { 8, 3, 9 }
+ };
+
+ int Error = 0;
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ T const Result0 = glm::nextMultiple(Data[i].Source, Data[i].Multiple);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ assert(!Error);
+
+ T const Result1 = nextMultipleMod(Data[i].Source, Data[i].Multiple);
+ Error += Data[i].Return == Result1 ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+ }
+
+ int perf()
+ {
+ int Error = 0;
+
+ glm::uint const Samples = 10000;
+
+ for(int i = 0; i < 4; ++i)
+ {
+ std::printf("Run %d :\n", i);
+ Error += perf_nextMultiple(Samples);
+ Error += perf_nextMultipleMod(Samples);
+ Error += perf_nextMultipleNeg(Samples);
+ Error += perf_nextMultipleUFloat(Samples);
+ Error += perf_nextMultipleFloat(Samples);
+ std::printf("\n");
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += test_uint<glm::int8>();
+ Error += test_uint<glm::int16>();
+ Error += test_uint<glm::int32>();
+ Error += test_uint<glm::int64>();
+
+ Error += test_uint<glm::uint8>();
+ Error += test_uint<glm::uint16>();
+ Error += test_uint<glm::uint32>();
+ Error += test_uint<glm::uint64>();
+
+ return Error;
+ }
+}//namespace nextMultiple
+
+namespace findNSB
+{
+ template<typename T>
+ struct type
+ {
+ T Source;
+ int SignificantBitCount;
+ int Return;
+ };
+
+ template <typename T>
+ int run()
+ {
+ type<T> const Data[] =
+ {
+ { 0x00, 1,-1 },
+ { 0x01, 2,-1 },
+ { 0x02, 2,-1 },
+ { 0x06, 3,-1 },
+ { 0x01, 1, 0 },
+ { 0x03, 1, 0 },
+ { 0x03, 2, 1 },
+ { 0x07, 2, 1 },
+ { 0x05, 2, 2 },
+ { 0x0D, 2, 2 }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ int const Result0 = glm::findNSB(Data[i].Source, Data[i].SignificantBitCount);
+ Error += Data[i].Return == Result0 ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<glm::uint8>();
+ Error += run<glm::uint16>();
+ Error += run<glm::uint32>();
+ Error += run<glm::uint64>();
+
+ Error += run<glm::int8>();
+ Error += run<glm::int16>();
+ Error += run<glm::int32>();
+ Error += run<glm::int64>();
+
+ return Error;
+ }
+}//namespace findNSB
+
+int main()
+{
+ int Error = 0;
+
+ Error += findNSB::test();
+
+ Error += isPowerOfTwo::test();
+ Error += prevPowerOfTwo::test();
+ Error += nextPowerOfTwo::test();
+ Error += nextPowerOfTwo_advanced::test();
+ Error += prevMultiple::test();
+ Error += nextMultiple::test();
+
+# ifdef NDEBUG
+ Error += nextPowerOfTwo_advanced::perf();
+ Error += nextMultiple::perf();
+# endif//NDEBUG
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp b/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp
new file mode 100644
index 0000000..77616e3
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp
@@ -0,0 +1,28 @@
+#include <glm/ext/scalar_packing.hpp>
+#include <glm/ext/scalar_relational.hpp>
+
+int test_packUnorm()
+{
+ int Error = 0;
+
+
+ return Error;
+}
+
+int test_packSnorm()
+{
+ int Error = 0;
+
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_packUnorm();
+ Error += test_packSnorm();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp b/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp
new file mode 100644
index 0000000..ebba10d
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp
@@ -0,0 +1,171 @@
+#include <glm/ext/scalar_reciprocal.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/scalar_constants.hpp>
+
+static int test_sec()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::sec(0.0), 1.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sec(glm::pi<double>() * 2.0), 1.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sec(glm::pi<double>() * -2.0), 1.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sec(glm::pi<double>() * 1.0), -1.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sec(glm::pi<double>() * -1.0), -1.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_csc()
+{
+ int Error = 0;
+
+ double const a = glm::csc(glm::pi<double>() * 0.5);
+ Error += glm::equal(a, 1.0, 0.01) ? 0 : 1;
+ double const b = glm::csc(glm::pi<double>() * -0.5);
+ Error += glm::equal(b, -1.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_cot()
+{
+ int Error = 0;
+
+ double const a = glm::cot(glm::pi<double>() * 0.5);
+ Error += glm::equal(a, 0.0, 0.01) ? 0 : 1;
+ double const b = glm::cot(glm::pi<double>() * -0.5);
+ Error += glm::equal(b, 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_asec()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::asec(100000.0), glm::pi<double>() * 0.5, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::asec(-100000.0), glm::pi<double>() * 0.5, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acsc()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::acsc(100000.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::acsc(-100000.0), 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acot()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::acot(100000.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::acot(-100000.0), glm::pi<double>(), 0.01) ? 0 : 1;
+ Error += glm::equal(glm::acot(0.0), glm::pi<double>() * 0.5, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_sech()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::sech(100000.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sech(-100000.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::sech(0.0), 1.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_csch()
+{
+ int Error = 0;
+
+ Error += glm::equal(glm::csch(100000.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::csch(-100000.0), 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_coth()
+{
+ int Error = 0;
+
+ double const a = glm::coth(100.0);
+ Error += glm::equal(a, 1.0, 0.01) ? 0 : 1;
+
+ double const b = glm::coth(-100.0);
+ Error += glm::equal(b, -1.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_asech()
+{
+ int Error = 0;
+
+ double const a = glm::asech(1.0);
+ Error += glm::equal(a, 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acsch()
+{
+ int Error = 0;
+
+ Error += glm::acsch(0.01) > 1.0 ? 0 : 1;
+ Error += glm::acsch(-0.01) < -1.0 ? 0 : 1;
+
+ Error += glm::equal(glm::acsch(100.0), 0.0, 0.01) ? 0 : 1;
+ Error += glm::equal(glm::acsch(-100.0), 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acoth()
+{
+ int Error = 0;
+
+ double const a = glm::acoth(1.00001);
+ Error += a > 6.0 ? 0 : 1;
+
+ double const b = glm::acoth(-1.00001);
+ Error += b < -6.0 ? 0 : 1;
+
+ double const c = glm::acoth(10000.0);
+ Error += glm::equal(c, 0.0, 0.01) ? 0 : 1;
+
+ double const d = glm::acoth(-10000.0);
+ Error += glm::equal(d, 0.0, 0.01) ? 0 : 1;
+
+ return Error;
+}
+
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_sec();
+ Error += test_csc();
+ Error += test_cot();
+
+ Error += test_asec();
+ Error += test_acsc();
+ Error += test_acot();
+
+ Error += test_sech();
+ Error += test_csch();
+ Error += test_coth();
+
+ Error += test_asech();
+ Error += test_acsch();
+ Error += test_acoth();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp b/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp
new file mode 100644
index 0000000..61f1999
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp
@@ -0,0 +1,106 @@
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/scalar_integer.hpp>
+#include <glm/ext/scalar_ulp.hpp>
+#include <cmath>
+
+static int test_equal_epsilon()
+{
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr");
+ static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr");
+# endif
+
+ int Error = 0;
+
+ Error += glm::equal(1.01f, 1.02f, 0.1f) ? 0 : 1;
+ Error += !glm::equal(1.01f, 1.02f, 0.001f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_notEqual_epsilon()
+{
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr");
+ static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr");
+# endif
+
+ int Error = 0;
+
+ Error += glm::notEqual(1.01f, 1.02f, 0.001f) ? 0 : 1;
+ Error += !glm::notEqual(1.01f, 1.02f, 0.1f) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_equal_ulps()
+{
+ int Error = 0;
+
+ float const ULP1Plus = glm::nextFloat(1.0f);
+ Error += glm::equal(1.0f, ULP1Plus, 1) ? 0 : 1;
+
+ float const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += !glm::equal(1.0f, ULP2Plus, 1) ? 0 : 1;
+
+ float const ULP1Minus = glm::prevFloat(1.0f);
+ Error += glm::equal(1.0f, ULP1Minus, 1) ? 0 : 1;
+
+ float const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += !glm::equal(1.0f, ULP2Minus, 1) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_notEqual_ulps()
+{
+ int Error = 0;
+
+ float const ULP1Plus = glm::nextFloat(1.0f);
+ Error += !glm::notEqual(1.0f, ULP1Plus, 1) ? 0 : 1;
+
+ float const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += glm::notEqual(1.0f, ULP2Plus, 1) ? 0 : 1;
+
+ float const ULP1Minus = glm::prevFloat(1.0f);
+ Error += !glm::notEqual(1.0f, ULP1Minus, 1) ? 0 : 1;
+
+ float const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += glm::notEqual(1.0f, ULP2Minus, 1) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_equal_sign()
+{
+ int Error = 0;
+
+ Error += !glm::equal(-0.0f, 0.0f, 2) ? 0 : 1;
+ Error += !glm::equal(-0.0, 0.0, 2) ? 0 : 1;
+
+ Error += !glm::equal(-1.0f, 2.0f, 2) ? 0 : 1;
+ Error += !glm::equal(-1.0, 2.0, 2) ? 0 : 1;
+
+ Error += !glm::equal(-0.00001f, 1.00000f, 2) ? 0 : 1;
+ Error += !glm::equal(-0.00001, 1.00000, 2) ? 0 : 1;
+
+ Error += !glm::equal(-1.0f, 1.0f, 2) ? 0 : 1;
+ Error += !glm::equal(-1.0, 1.0, 2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_equal_epsilon();
+ Error += test_notEqual_epsilon();
+
+ Error += test_equal_ulps();
+ Error += test_notEqual_ulps();
+
+ Error += test_equal_sign();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp b/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp
new file mode 100644
index 0000000..1122947
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp
@@ -0,0 +1,43 @@
+#include <glm/ext/scalar_uint_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
+ static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::uint8) == 1 ? 0 : 1;
+ Error += sizeof(glm::uint16) == 2 ? 0 : 1;
+ Error += sizeof(glm::uint32) == 4 ? 0 : 1;
+ Error += sizeof(glm::uint64) == 8 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::uint8) < sizeof(glm::uint16) ? 0 : 1;
+ Error += sizeof(glm::uint16) < sizeof(glm::uint32) ? 0 : 1;
+ Error += sizeof(glm::uint32) < sizeof(glm::uint64) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp b/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp
new file mode 100644
index 0000000..a19b774
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp
@@ -0,0 +1,96 @@
+#include <glm/ext/scalar_ulp.hpp>
+#include <glm/ext/scalar_relational.hpp>
+
+static int test_ulp_float_dist()
+{
+ int Error = 0;
+
+ float A = 1.0f;
+
+ float B = glm::nextFloat(A);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ float C = glm::prevFloat(B);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ int D = glm::floatDistance(A, B);
+ Error += D == 1 ? 0 : 1;
+ int E = glm::floatDistance(A, C);
+ Error += E == 0 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_ulp_float_step()
+{
+ int Error = 0;
+
+ float A = 1.0f;
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ float B = glm::nextFloat(A, i);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ float C = glm::prevFloat(B, i);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ int D = glm::floatDistance(A, B);
+ Error += D == i ? 0 : 1;
+ int E = glm::floatDistance(A, C);
+ Error += E == 0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ulp_double_dist()
+{
+ int Error = 0;
+
+ double A = 1.0;
+
+ double B = glm::nextFloat(A);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ double C = glm::prevFloat(B);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ glm::int64 const D = glm::floatDistance(A, B);
+ Error += D == 1 ? 0 : 1;
+ glm::int64 const E = glm::floatDistance(A, C);
+ Error += E == 0 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_ulp_double_step()
+{
+ int Error = 0;
+
+ double A = 1.0;
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ double B = glm::nextFloat(A, i);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ double C = glm::prevFloat(B, i);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ glm::int64 const D = glm::floatDistance(A, B);
+ Error += D == i ? 0 : 1;
+ glm::int64 const E = glm::floatDistance(A, C);
+ Error += E == 0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ulp_float_dist();
+ Error += test_ulp_float_step();
+ Error += test_ulp_double_dist();
+ Error += test_ulp_double_step();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vec1.cpp b/3rdparty/glm/source/test/ext/ext_vec1.cpp
new file mode 100644
index 0000000..fc0b931
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vec1.cpp
@@ -0,0 +1,157 @@
+#define GLM_FORCE_SWIZZLE
+#include <glm/vector_relational.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <vector>
+
+static glm::vec1 g1;
+static glm::vec1 g2(1);
+
+static int test_vec1_operators()
+{
+ int Error(0);
+
+ glm::ivec1 A(1);
+ glm::ivec1 B(1);
+ {
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ A *= 1;
+ B *= 1;
+ A += 1;
+ B += 1;
+
+ bool R = A != B;
+ bool S = A == B;
+
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_vec1_ctor()
+{
+ int Error = 0;
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dvec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ivec1>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::uvec1>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::vec1>::value ? 0 : 1;
+# endif
+
+
+ {
+ glm::ivec1 A = glm::vec1(2.0f);
+
+ glm::ivec1 E(glm::dvec1(2.0));
+ Error += A == E ? 0 : 1;
+
+ glm::ivec1 F(glm::ivec1(2));
+ Error += A == F ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_vec1_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1;
+ Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1;
+ Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1;
+ Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1;
+ Error += glm::vec1().length() == 1 ? 0 : 1;
+ Error += glm::dvec1().length() == 1 ? 0 : 1;
+ Error += glm::vec1::length() == 1 ? 0 : 1;
+ Error += glm::dvec1::length() == 1 ? 0 : 1;
+
+ GLM_CONSTEXPR std::size_t Length = glm::vec1::length();
+ Error += Length == 1 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_vec1_operator_increment()
+{
+ int Error(0);
+
+ glm::ivec1 v0(1);
+ glm::ivec1 v1(v0);
+ glm::ivec1 v2(v0);
+ glm::ivec1 v3 = ++v1;
+ glm::ivec1 v4 = v2++;
+
+ Error += glm::all(glm::equal(v0, v4)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v2)) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, v3)) ? 0 : 1;
+
+ int i0(1);
+ int i1(i0);
+ int i2(i0);
+ int i3 = ++i1;
+ int i4 = i2++;
+
+ Error += i0 == i4 ? 0 : 1;
+ Error += i1 == i2 ? 0 : 1;
+ Error += i1 == i3 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_bvec1_ctor()
+{
+ int Error = 0;
+
+ glm::bvec1 const A(true);
+ glm::bvec1 const B(true);
+ glm::bvec1 const C(false);
+ glm::bvec1 const D = A && B;
+ glm::bvec1 const E = A && C;
+ glm::bvec1 const F = A || C;
+
+ Error += D == glm::bvec1(true) ? 0 : 1;
+ Error += E == glm::bvec1(false) ? 0 : 1;
+ Error += F == glm::bvec1(true) ? 0 : 1;
+
+ bool const G = A == C;
+ bool const H = A != C;
+ Error += !G ? 0 : 1;
+ Error += H ? 0 : 1;
+
+ return Error;
+}
+
+static int test_constexpr()
+{
+#if GLM_HAS_CONSTEXPR
+ static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr");
+ static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr");
+#endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_vec1_size();
+ Error += test_vec1_ctor();
+ Error += test_bvec1_ctor();
+ Error += test_vec1_operators();
+ Error += test_vec1_operator_increment();
+ Error += test_constexpr();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp b/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp
new file mode 100644
index 0000000..43eed57
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp
@@ -0,0 +1,104 @@
+#include <glm/ext/vector_bool1.hpp>
+#include <glm/ext/vector_bool1_precision.hpp>
+
+template <typename genType>
+static int test_operators()
+{
+ int Error = 0;
+
+ genType const A(true);
+ genType const B(true);
+ {
+ bool const R = A != B;
+ bool const S = A == B;
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename genType>
+static int test_ctor()
+{
+ int Error = 0;
+
+ glm::bvec1 const A = genType(true);
+
+ glm::bvec1 const E(genType(true));
+ Error += A == E ? 0 : 1;
+
+ glm::bvec1 const F(E);
+ Error += A == F ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::bvec1) == sizeof(genType) ? 0 : 1;
+ Error += genType().length() == 1 ? 0 : 1;
+ Error += genType::length() == 1 ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_relational()
+{
+ int Error = 0;
+
+ genType const A(true);
+ genType const B(true);
+ genType const C(false);
+
+ Error += A == B ? 0 : 1;
+ Error += (A && B) == A ? 0 : 1;
+ Error += (A || C) == A ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_constexpr()
+{
+# if GLM_HAS_CONSTEXPR
+ static_assert(genType::length() == 1, "GLM: Failed constexpr");
+# endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_operators<glm::bvec1>();
+ Error += test_operators<glm::lowp_bvec1>();
+ Error += test_operators<glm::mediump_bvec1>();
+ Error += test_operators<glm::highp_bvec1>();
+
+ Error += test_ctor<glm::bvec1>();
+ Error += test_ctor<glm::lowp_bvec1>();
+ Error += test_ctor<glm::mediump_bvec1>();
+ Error += test_ctor<glm::highp_bvec1>();
+
+ Error += test_size<glm::bvec1>();
+ Error += test_size<glm::lowp_bvec1>();
+ Error += test_size<glm::mediump_bvec1>();
+ Error += test_size<glm::highp_bvec1>();
+
+ Error += test_relational<glm::bvec1>();
+ Error += test_relational<glm::lowp_bvec1>();
+ Error += test_relational<glm::mediump_bvec1>();
+ Error += test_relational<glm::highp_bvec1>();
+
+ Error += test_constexpr<glm::bvec1>();
+ Error += test_constexpr<glm::lowp_bvec1>();
+ Error += test_constexpr<glm::mediump_bvec1>();
+ Error += test_constexpr<glm::highp_bvec1>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_common.cpp b/3rdparty/glm/source/test/ext/ext_vector_common.cpp
new file mode 100644
index 0000000..211003f
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_common.cpp
@@ -0,0 +1,365 @@
+#include <glm/ext/vector_common.hpp>
+
+#include <glm/ext/vector_bool1.hpp>
+#include <glm/ext/vector_bool1_precision.hpp>
+#include <glm/ext/vector_bool2.hpp>
+#include <glm/ext/vector_bool2_precision.hpp>
+#include <glm/ext/vector_bool3.hpp>
+#include <glm/ext/vector_bool3_precision.hpp>
+#include <glm/ext/vector_bool4.hpp>
+#include <glm/ext/vector_bool4_precision.hpp>
+
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_float1_precision.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float2_precision.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float3_precision.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_float4_precision.hpp>
+#include <glm/ext/vector_double1.hpp>
+#include <glm/ext/vector_double1_precision.hpp>
+#include <glm/ext/vector_double2.hpp>
+#include <glm/ext/vector_double2_precision.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double3_precision.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <glm/ext/vector_double4_precision.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_constants.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/common.hpp>
+
+#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC))
+# define GLM_NAN(T) NAN
+#else
+# define GLM_NAN(T) (static_cast<T>(0.0f) / static_cast<T>(0.0f))
+#endif
+
+template <typename vecType>
+static int test_min()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const N(static_cast<T>(0));
+ vecType const B(static_cast<T>(1));
+
+ Error += glm::all(glm::equal(glm::min(N, B), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(B, N), N, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::equal(glm::min(N, B, C), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(B, N, C), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(C, N, B), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(C, B, N), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(B, C, N), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(N, C, B), N, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += glm::all(glm::equal(glm::min(D, N, B, C), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(B, D, N, C), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(C, N, D, B), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(C, B, D, N), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(B, C, N, D), N, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::min(N, C, B, D), N, glm::epsilon<T>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_min_nan()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const B(static_cast<T>(1));
+ vecType const N(GLM_NAN(T));
+
+ Error += glm::all(glm::isnan(glm::min(N, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(B, N))) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::isnan(glm::min(N, B, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(B, N, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(C, N, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(C, B, N))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(B, C, N))) ? 0 : 1;
+ Error += glm::all(glm::isnan(glm::min(N, C, B))) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += !glm::all(glm::isnan(glm::min(D, N, B, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(B, D, N, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(C, N, D, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(C, B, D, N))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::min(B, C, N, D))) ? 0 : 1;
+ Error += glm::all(glm::isnan(glm::min(N, C, B, D))) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_max()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const N(static_cast<T>(0));
+ vecType const B(static_cast<T>(1));
+ Error += glm::all(glm::equal(glm::max(N, B), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(B, N), B, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::equal(glm::max(N, B, C), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(B, N, C), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(C, N, B), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(C, B, N), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(B, C, N), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(N, C, B), C, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += glm::all(glm::equal(glm::max(D, N, B, C), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(B, D, N, C), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(C, N, D, B), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(C, B, D, N), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(B, C, N, D), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::max(N, C, B, D), D, glm::epsilon<T>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_max_nan()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const B(static_cast<T>(1));
+ vecType const N(GLM_NAN(T));
+
+ Error += glm::all(glm::isnan(glm::max(N, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(B, N))) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::isnan(glm::max(N, B, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(B, N, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(C, N, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(C, B, N))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(B, C, N))) ? 0 : 1;
+ Error += glm::all(glm::isnan(glm::max(N, C, B))) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += !glm::all(glm::isnan(glm::max(D, N, B, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(B, D, N, C))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(C, N, D, B))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(C, B, D, N))) ? 0 : 1;
+ Error += !glm::all(glm::isnan(glm::max(B, C, N, D))) ? 0 : 1;
+ Error += glm::all(glm::isnan(glm::max(N, C, B, D))) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_fmin()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const B(static_cast<T>(1));
+ vecType const N(GLM_NAN(T));
+
+ Error += glm::all(glm::equal(glm::fmin(N, B), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(B, N), B, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::equal(glm::fmin(N, B, C), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(B, N, C), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(C, N, B), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(C, B, N), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(B, C, N), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(N, C, B), B, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += glm::all(glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon<T>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_fmax()
+{
+ typedef typename vecType::value_type T;
+
+ int Error = 0;
+
+ vecType const B(static_cast<T>(1));
+ vecType const N(GLM_NAN(T));
+
+ Error += glm::all(glm::equal(glm::fmax(N, B), B, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(B, N), B, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const C(static_cast<T>(2));
+ Error += glm::all(glm::equal(glm::fmax(N, B, C), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(B, N, C), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(C, N, B), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(C, B, N), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(B, C, N), C, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(N, C, B), C, glm::epsilon<T>())) ? 0 : 1;
+
+ vecType const D(static_cast<T>(3));
+ Error += glm::all(glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon<T>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon<T>())) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_clamp()
+{
+ int Error = 0;
+
+ glm::vec2 K = glm::clamp(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::clamp(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::clamp(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::clamp(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_repeat()
+{
+ int Error = 0;
+
+ glm::vec2 K = glm::repeat(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::repeat(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::repeat(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::repeat(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mirrorClamp()
+{
+ int Error = 0;
+
+ glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mirrorRepeat()
+{
+ int Error = 0;
+
+ glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_iround()
+{
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::iround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+static int test_uround()
+{
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::uround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_min<glm::vec3>();
+ Error += test_min<glm::vec2>();
+ Error += test_min_nan<glm::vec3>();
+ Error += test_min_nan<glm::vec2>();
+
+ Error += test_max<glm::vec3>();
+ Error += test_max<glm::vec2>();
+ Error += test_max_nan<glm::vec3>();
+ Error += test_max_nan<glm::vec2>();
+
+ Error += test_fmin<glm::vec3>();
+ Error += test_fmin<glm::vec2>();
+
+ Error += test_fmax<glm::vec3>();
+ Error += test_fmax<glm::vec2>();
+
+ Error += test_clamp();
+ Error += test_repeat();
+ Error += test_mirrorClamp();
+ Error += test_mirrorRepeat();
+
+ Error += test_iround();
+ Error += test_uround();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp b/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp
new file mode 100644
index 0000000..5a9da50
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp
@@ -0,0 +1,166 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_double1.hpp>
+#include <glm/ext/vector_double1_precision.hpp>
+#include <glm/ext/vector_double2.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_float1_precision.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float4.hpp>
+
+template <typename genType>
+static int test_operators()
+{
+ typedef typename genType::value_type valType;
+
+ int Error = 0;
+
+ {
+ genType const A(1);
+ genType const B(1);
+
+ genType const C = A + B;
+ Error += glm::all(glm::equal(C, genType(2), glm::epsilon<valType>())) ? 0 : 1;
+
+ genType const D = A - B;
+ Error += glm::all(glm::equal(D, genType(0), glm::epsilon<valType>())) ? 0 : 1;
+
+ genType const E = A * B;
+ Error += glm::all(glm::equal(E, genType(1), glm::epsilon<valType>())) ? 0 : 1;
+
+ genType const F = A / B;
+ Error += glm::all(glm::equal(F, genType(1), glm::epsilon<valType>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename genType>
+static int test_ctor()
+{
+ typedef typename genType::value_type T;
+
+ int Error = 0;
+
+ glm::vec<1, T> const A = genType(1);
+
+ glm::vec<1, T> const E(genType(1));
+ Error += glm::all(glm::equal(A, E, glm::epsilon<T>())) ? 0 : 1;
+
+ glm::vec<1, T> const F(E);
+ Error += glm::all(glm::equal(A, F, glm::epsilon<T>())) ? 0 : 1;
+
+ genType const B = genType(1);
+ genType const G(glm::vec<2, T>(1));
+ Error += glm::all(glm::equal(B, G, glm::epsilon<T>())) ? 0 : 1;
+
+ genType const H(glm::vec<3, T>(1));
+ Error += glm::all(glm::equal(B, H, glm::epsilon<T>())) ? 0 : 1;
+
+ genType const I(glm::vec<4, T>(1));
+ Error += glm::all(glm::equal(B, I, glm::epsilon<T>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_size()
+{
+ typedef typename genType::value_type T;
+
+ int Error = 0;
+
+ Error += sizeof(glm::vec<1, T>) == sizeof(genType) ? 0 : 1;
+ Error += genType().length() == 1 ? 0 : 1;
+ Error += genType::length() == 1 ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_relational()
+{
+ typedef typename genType::value_type valType;
+
+ int Error = 0;
+
+ genType const A(1);
+ genType const B(1);
+ genType const C(0);
+
+ Error += all(equal(A, B, glm::epsilon<valType>())) ? 0 : 1;
+ Error += any(notEqual(A, C, glm::epsilon<valType>())) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_constexpr()
+{
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ static_assert(genType::length() == 1, "GLM: Failed constexpr");
+# endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_operators<glm::dvec1>();
+ Error += test_operators<glm::lowp_dvec1>();
+ Error += test_operators<glm::mediump_dvec1>();
+ Error += test_operators<glm::highp_dvec1>();
+
+ Error += test_ctor<glm::dvec1>();
+ Error += test_ctor<glm::lowp_dvec1>();
+ Error += test_ctor<glm::mediump_dvec1>();
+ Error += test_ctor<glm::highp_dvec1>();
+
+ Error += test_size<glm::dvec1>();
+ Error += test_size<glm::lowp_dvec1>();
+ Error += test_size<glm::mediump_dvec1>();
+ Error += test_size<glm::highp_dvec1>();
+
+ Error += test_relational<glm::dvec1>();
+ Error += test_relational<glm::lowp_dvec1>();
+ Error += test_relational<glm::mediump_dvec1>();
+ Error += test_relational<glm::highp_dvec1>();
+
+ Error += test_constexpr<glm::dvec1>();
+ Error += test_constexpr<glm::lowp_dvec1>();
+ Error += test_constexpr<glm::mediump_dvec1>();
+ Error += test_constexpr<glm::highp_dvec1>();
+
+ Error += test_operators<glm::vec1>();
+ Error += test_operators<glm::lowp_vec1>();
+ Error += test_operators<glm::mediump_vec1>();
+ Error += test_operators<glm::highp_vec1>();
+
+ Error += test_ctor<glm::vec1>();
+ Error += test_ctor<glm::lowp_vec1>();
+ Error += test_ctor<glm::mediump_vec1>();
+ Error += test_ctor<glm::highp_vec1>();
+
+ Error += test_size<glm::vec1>();
+ Error += test_size<glm::lowp_vec1>();
+ Error += test_size<glm::mediump_vec1>();
+ Error += test_size<glm::highp_vec1>();
+
+ Error += test_relational<glm::vec1>();
+ Error += test_relational<glm::lowp_vec1>();
+ Error += test_relational<glm::mediump_vec1>();
+ Error += test_relational<glm::highp_vec1>();
+
+ Error += test_constexpr<glm::vec1>();
+ Error += test_constexpr<glm::lowp_vec1>();
+ Error += test_constexpr<glm::mediump_vec1>();
+ Error += test_constexpr<glm::highp_vec1>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp
new file mode 100644
index 0000000..c262f49
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_int1_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec1) == 1 ? 0 : 1;
+ Error += sizeof(glm::i16vec1) == 2 ? 0 : 1;
+ Error += sizeof(glm::i32vec1) == 4 ? 0 : 1;
+ Error += sizeof(glm::i64vec1) == 8 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec1) < sizeof(glm::i16vec1) ? 0 : 1;
+ Error += sizeof(glm::i16vec1) < sizeof(glm::i32vec1) ? 0 : 1;
+ Error += sizeof(glm::i32vec1) < sizeof(glm::i64vec1) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp
new file mode 100644
index 0000000..f4ad8b6
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_int2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec2) == 2 ? 0 : 1;
+ Error += sizeof(glm::i16vec2) == 4 ? 0 : 1;
+ Error += sizeof(glm::i32vec2) == 8 ? 0 : 1;
+ Error += sizeof(glm::i64vec2) == 16 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec2) < sizeof(glm::i16vec2) ? 0 : 1;
+ Error += sizeof(glm::i16vec2) < sizeof(glm::i32vec2) ? 0 : 1;
+ Error += sizeof(glm::i32vec2) < sizeof(glm::i64vec2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp
new file mode 100644
index 0000000..c51bfe7
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_int3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec3) == 3 ? 0 : 1;
+ Error += sizeof(glm::i16vec3) == 6 ? 0 : 1;
+ Error += sizeof(glm::i32vec3) == 12 ? 0 : 1;
+ Error += sizeof(glm::i64vec3) == 24 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec3) < sizeof(glm::i16vec3) ? 0 : 1;
+ Error += sizeof(glm::i16vec3) < sizeof(glm::i32vec3) ? 0 : 1;
+ Error += sizeof(glm::i32vec3) < sizeof(glm::i64vec3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp
new file mode 100644
index 0000000..93fd9ed
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_int4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec4) == 4 ? 0 : 1;
+ Error += sizeof(glm::i16vec4) == 8 ? 0 : 1;
+ Error += sizeof(glm::i32vec4) == 16 ? 0 : 1;
+ Error += sizeof(glm::i64vec4) == 32 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec4) < sizeof(glm::i16vec4) ? 0 : 1;
+ Error += sizeof(glm::i16vec4) < sizeof(glm::i32vec4) ? 0 : 1;
+ Error += sizeof(glm::i32vec4) < sizeof(glm::i64vec4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_integer.cpp b/3rdparty/glm/source/test/ext/ext_vector_integer.cpp
new file mode 100644
index 0000000..d7278d3
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_integer.cpp
@@ -0,0 +1,547 @@
+#include <glm/ext/vector_integer.hpp>
+#include <glm/ext/scalar_int_sized.hpp>
+#include <glm/ext/scalar_uint_sized.hpp>
+#include <vector>
+#include <ctime>
+#include <cstdio>
+
+namespace isPowerOfTwo
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ bool Return;
+ };
+
+ template <glm::length_t L>
+ int test_int16()
+ {
+ type<glm::int16> const Data[] =
+ {
+ { 0x0001, true },
+ { 0x0002, true },
+ { 0x0004, true },
+ { 0x0080, true },
+ { 0x0000, true },
+ { 0x0003, false }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::int16>); i < n; ++i)
+ {
+ glm::vec<L, bool> const Result = glm::isPowerOfTwo(glm::vec<L, glm::int16>(Data[i].Value));
+ Error += glm::vec<L, bool>(Data[i].Return) == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ template <glm::length_t L>
+ int test_uint16()
+ {
+ type<glm::uint16> const Data[] =
+ {
+ { 0x0001, true },
+ { 0x0002, true },
+ { 0x0004, true },
+ { 0x0000, true },
+ { 0x0000, true },
+ { 0x0003, false }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint16>); i < n; ++i)
+ {
+ glm::vec<L, bool> const Result = glm::isPowerOfTwo(glm::vec<L, glm::uint16>(Data[i].Value));
+ Error += glm::vec<L, bool>(Data[i].Return) == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ template <glm::length_t L>
+ int test_int32()
+ {
+ type<int> const Data[] =
+ {
+ { 0x00000001, true },
+ { 0x00000002, true },
+ { 0x00000004, true },
+ { 0x0000000f, false },
+ { 0x00000000, true },
+ { 0x00000003, false }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ glm::vec<L, bool> const Result = glm::isPowerOfTwo(glm::vec<L, glm::int32>(Data[i].Value));
+ Error += glm::vec<L, bool>(Data[i].Return) == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ template <glm::length_t L>
+ int test_uint32()
+ {
+ type<glm::uint> const Data[] =
+ {
+ { 0x00000001, true },
+ { 0x00000002, true },
+ { 0x00000004, true },
+ { 0x80000000, true },
+ { 0x00000000, true },
+ { 0x00000003, false }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint>); i < n; ++i)
+ {
+ glm::vec<L, bool> const Result = glm::isPowerOfTwo(glm::vec<L, glm::uint32>(Data[i].Value));
+ Error += glm::vec<L, bool>(Data[i].Return) == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += test_int16<1>();
+ Error += test_int16<2>();
+ Error += test_int16<3>();
+ Error += test_int16<4>();
+
+ Error += test_uint16<1>();
+ Error += test_uint16<2>();
+ Error += test_uint16<3>();
+ Error += test_uint16<4>();
+
+ Error += test_int32<1>();
+ Error += test_int32<2>();
+ Error += test_int32<3>();
+ Error += test_int32<4>();
+
+ Error += test_uint32<1>();
+ Error += test_uint32<2>();
+ Error += test_uint32<3>();
+ Error += test_uint32<4>();
+
+ return Error;
+ }
+}//isPowerOfTwo
+
+namespace prevPowerOfTwo
+{
+ template <glm::length_t L, typename T>
+ int run()
+ {
+ int Error = 0;
+
+ glm::vec<L, T> const A = glm::prevPowerOfTwo(glm::vec<L, T>(7));
+ Error += A == glm::vec<L, T>(4) ? 0 : 1;
+
+ glm::vec<L, T> const B = glm::prevPowerOfTwo(glm::vec<L, T>(15));
+ Error += B == glm::vec<L, T>(8) ? 0 : 1;
+
+ glm::vec<L, T> const C = glm::prevPowerOfTwo(glm::vec<L, T>(31));
+ Error += C == glm::vec<L, T>(16) ? 0 : 1;
+
+ glm::vec<L, T> const D = glm::prevPowerOfTwo(glm::vec<L, T>(32));
+ Error += D == glm::vec<L, T>(32) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<1, glm::int8>();
+ Error += run<2, glm::int8>();
+ Error += run<3, glm::int8>();
+ Error += run<4, glm::int8>();
+
+ Error += run<1, glm::int16>();
+ Error += run<2, glm::int16>();
+ Error += run<3, glm::int16>();
+ Error += run<4, glm::int16>();
+
+ Error += run<1, glm::int32>();
+ Error += run<2, glm::int32>();
+ Error += run<3, glm::int32>();
+ Error += run<4, glm::int32>();
+
+ Error += run<1, glm::int64>();
+ Error += run<2, glm::int64>();
+ Error += run<3, glm::int64>();
+ Error += run<4, glm::int64>();
+
+ Error += run<1, glm::uint8>();
+ Error += run<2, glm::uint8>();
+ Error += run<3, glm::uint8>();
+ Error += run<4, glm::uint8>();
+
+ Error += run<1, glm::uint16>();
+ Error += run<2, glm::uint16>();
+ Error += run<3, glm::uint16>();
+ Error += run<4, glm::uint16>();
+
+ Error += run<1, glm::uint32>();
+ Error += run<2, glm::uint32>();
+ Error += run<3, glm::uint32>();
+ Error += run<4, glm::uint32>();
+
+ Error += run<1, glm::uint64>();
+ Error += run<2, glm::uint64>();
+ Error += run<3, glm::uint64>();
+ Error += run<4, glm::uint64>();
+
+ return Error;
+ }
+}//namespace prevPowerOfTwo
+
+namespace nextPowerOfTwo
+{
+ template <glm::length_t L, typename T>
+ int run()
+ {
+ int Error = 0;
+
+ glm::vec<L, T> const A = glm::nextPowerOfTwo(glm::vec<L, T>(7));
+ Error += A == glm::vec<L, T>(8) ? 0 : 1;
+
+ glm::vec<L, T> const B = glm::nextPowerOfTwo(glm::vec<L, T>(15));
+ Error += B == glm::vec<L, T>(16) ? 0 : 1;
+
+ glm::vec<L, T> const C = glm::nextPowerOfTwo(glm::vec<L, T>(31));
+ Error += C == glm::vec<L, T>(32) ? 0 : 1;
+
+ glm::vec<L, T> const D = glm::nextPowerOfTwo(glm::vec<L, T>(32));
+ Error += D == glm::vec<L, T>(32) ? 0 : 1;
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<1, glm::int8>();
+ Error += run<2, glm::int8>();
+ Error += run<3, glm::int8>();
+ Error += run<4, glm::int8>();
+
+ Error += run<1, glm::int16>();
+ Error += run<2, glm::int16>();
+ Error += run<3, glm::int16>();
+ Error += run<4, glm::int16>();
+
+ Error += run<1, glm::int32>();
+ Error += run<2, glm::int32>();
+ Error += run<3, glm::int32>();
+ Error += run<4, glm::int32>();
+
+ Error += run<1, glm::int64>();
+ Error += run<2, glm::int64>();
+ Error += run<3, glm::int64>();
+ Error += run<4, glm::int64>();
+
+ Error += run<1, glm::uint8>();
+ Error += run<2, glm::uint8>();
+ Error += run<3, glm::uint8>();
+ Error += run<4, glm::uint8>();
+
+ Error += run<1, glm::uint16>();
+ Error += run<2, glm::uint16>();
+ Error += run<3, glm::uint16>();
+ Error += run<4, glm::uint16>();
+
+ Error += run<1, glm::uint32>();
+ Error += run<2, glm::uint32>();
+ Error += run<3, glm::uint32>();
+ Error += run<4, glm::uint32>();
+
+ Error += run<1, glm::uint64>();
+ Error += run<2, glm::uint64>();
+ Error += run<3, glm::uint64>();
+ Error += run<4, glm::uint64>();
+
+ return Error;
+ }
+}//namespace nextPowerOfTwo
+
+namespace prevMultiple
+{
+ template<typename genIUType>
+ struct type
+ {
+ genIUType Source;
+ genIUType Multiple;
+ genIUType Return;
+ };
+
+ template <glm::length_t L, typename T>
+ int run()
+ {
+ type<T> const Data[] =
+ {
+ { 8, 3, 6 },
+ { 7, 7, 7 }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ glm::vec<L, T> const Result0 = glm::prevMultiple(glm::vec<L, T>(Data[i].Source), Data[i].Multiple);
+ Error += glm::vec<L, T>(Data[i].Return) == Result0 ? 0 : 1;
+
+ glm::vec<L, T> const Result1 = glm::prevMultiple(glm::vec<L, T>(Data[i].Source), glm::vec<L, T>(Data[i].Multiple));
+ Error += glm::vec<L, T>(Data[i].Return) == Result1 ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<1, glm::int8>();
+ Error += run<2, glm::int8>();
+ Error += run<3, glm::int8>();
+ Error += run<4, glm::int8>();
+
+ Error += run<1, glm::int16>();
+ Error += run<2, glm::int16>();
+ Error += run<3, glm::int16>();
+ Error += run<4, glm::int16>();
+
+ Error += run<1, glm::int32>();
+ Error += run<2, glm::int32>();
+ Error += run<3, glm::int32>();
+ Error += run<4, glm::int32>();
+
+ Error += run<1, glm::int64>();
+ Error += run<2, glm::int64>();
+ Error += run<3, glm::int64>();
+ Error += run<4, glm::int64>();
+
+ Error += run<1, glm::uint8>();
+ Error += run<2, glm::uint8>();
+ Error += run<3, glm::uint8>();
+ Error += run<4, glm::uint8>();
+
+ Error += run<1, glm::uint16>();
+ Error += run<2, glm::uint16>();
+ Error += run<3, glm::uint16>();
+ Error += run<4, glm::uint16>();
+
+ Error += run<1, glm::uint32>();
+ Error += run<2, glm::uint32>();
+ Error += run<3, glm::uint32>();
+ Error += run<4, glm::uint32>();
+
+ Error += run<1, glm::uint64>();
+ Error += run<2, glm::uint64>();
+ Error += run<3, glm::uint64>();
+ Error += run<4, glm::uint64>();
+
+ return Error;
+ }
+}//namespace prevMultiple
+
+namespace nextMultiple
+{
+ template<typename genIUType>
+ struct type
+ {
+ genIUType Source;
+ genIUType Multiple;
+ genIUType Return;
+ };
+
+ template <glm::length_t L, typename T>
+ int run()
+ {
+ type<T> const Data[] =
+ {
+ { 3, 4, 4 },
+ { 6, 3, 6 },
+ { 5, 3, 6 },
+ { 7, 7, 7 },
+ { 0, 1, 0 },
+ { 8, 3, 9 }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ glm::vec<L, T> const Result0 = glm::nextMultiple(glm::vec<L, T>(Data[i].Source), glm::vec<L, T>(Data[i].Multiple));
+ Error += glm::vec<L, T>(Data[i].Return) == Result0 ? 0 : 1;
+
+ glm::vec<L, T> const Result1 = glm::nextMultiple(glm::vec<L, T>(Data[i].Source), Data[i].Multiple);
+ Error += glm::vec<L, T>(Data[i].Return) == Result1 ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<1, glm::int8>();
+ Error += run<2, glm::int8>();
+ Error += run<3, glm::int8>();
+ Error += run<4, glm::int8>();
+
+ Error += run<1, glm::int16>();
+ Error += run<2, glm::int16>();
+ Error += run<3, glm::int16>();
+ Error += run<4, glm::int16>();
+
+ Error += run<1, glm::int32>();
+ Error += run<2, glm::int32>();
+ Error += run<3, glm::int32>();
+ Error += run<4, glm::int32>();
+
+ Error += run<1, glm::int64>();
+ Error += run<2, glm::int64>();
+ Error += run<3, glm::int64>();
+ Error += run<4, glm::int64>();
+
+ Error += run<1, glm::uint8>();
+ Error += run<2, glm::uint8>();
+ Error += run<3, glm::uint8>();
+ Error += run<4, glm::uint8>();
+
+ Error += run<1, glm::uint16>();
+ Error += run<2, glm::uint16>();
+ Error += run<3, glm::uint16>();
+ Error += run<4, glm::uint16>();
+
+ Error += run<1, glm::uint32>();
+ Error += run<2, glm::uint32>();
+ Error += run<3, glm::uint32>();
+ Error += run<4, glm::uint32>();
+
+ Error += run<1, glm::uint64>();
+ Error += run<2, glm::uint64>();
+ Error += run<3, glm::uint64>();
+ Error += run<4, glm::uint64>();
+
+ return Error;
+ }
+}//namespace nextMultiple
+
+namespace findNSB
+{
+ template<typename T>
+ struct type
+ {
+ T Source;
+ int SignificantBitCount;
+ int Return;
+ };
+
+ template <glm::length_t L, typename T>
+ int run()
+ {
+ type<T> const Data[] =
+ {
+ { 0x00, 1,-1 },
+ { 0x01, 2,-1 },
+ { 0x02, 2,-1 },
+ { 0x06, 3,-1 },
+ { 0x01, 1, 0 },
+ { 0x03, 1, 0 },
+ { 0x03, 2, 1 },
+ { 0x07, 2, 1 },
+ { 0x05, 2, 2 },
+ { 0x0D, 2, 2 }
+ };
+
+ int Error = 0;
+
+ for (std::size_t i = 0, n = sizeof(Data) / sizeof(type<T>); i < n; ++i)
+ {
+ glm::vec<L, int> const Result0 = glm::findNSB<L, T, glm::defaultp>(glm::vec<L, T>(Data[i].Source), glm::vec<L, int>(Data[i].SignificantBitCount));
+ Error += glm::vec<L, int>(Data[i].Return) == Result0 ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ Error += run<1, glm::uint8>();
+ Error += run<2, glm::uint8>();
+ Error += run<3, glm::uint8>();
+ Error += run<4, glm::uint8>();
+
+ Error += run<1, glm::uint16>();
+ Error += run<2, glm::uint16>();
+ Error += run<3, glm::uint16>();
+ Error += run<4, glm::uint16>();
+
+ Error += run<1, glm::uint32>();
+ Error += run<2, glm::uint32>();
+ Error += run<3, glm::uint32>();
+ Error += run<4, glm::uint32>();
+
+ Error += run<1, glm::uint64>();
+ Error += run<2, glm::uint64>();
+ Error += run<3, glm::uint64>();
+ Error += run<4, glm::uint64>();
+
+ Error += run<1, glm::int8>();
+ Error += run<2, glm::int8>();
+ Error += run<3, glm::int8>();
+ Error += run<4, glm::int8>();
+
+ Error += run<1, glm::int16>();
+ Error += run<2, glm::int16>();
+ Error += run<3, glm::int16>();
+ Error += run<4, glm::int16>();
+
+ Error += run<1, glm::int32>();
+ Error += run<2, glm::int32>();
+ Error += run<3, glm::int32>();
+ Error += run<4, glm::int32>();
+
+ Error += run<1, glm::int64>();
+ Error += run<2, glm::int64>();
+ Error += run<3, glm::int64>();
+ Error += run<4, glm::int64>();
+
+
+ return Error;
+ }
+}//namespace findNSB
+
+int main()
+{
+ int Error = 0;
+
+ Error += isPowerOfTwo::test();
+ Error += prevPowerOfTwo::test();
+ Error += nextPowerOfTwo::test();
+ Error += prevMultiple::test();
+ Error += nextMultiple::test();
+ Error += findNSB::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp
new file mode 100644
index 0000000..52b3f4e
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp
@@ -0,0 +1,216 @@
+#include <glm/ext/vector_integer.hpp>
+#include <glm/ext/vector_int1.hpp>
+#include <glm/ext/vector_int1_sized.hpp>
+#include <glm/ext/vector_uint1.hpp>
+#include <glm/ext/vector_uint1_sized.hpp>
+
+template <typename genType>
+static int test_operators()
+{
+ int Error = 0;
+
+ {
+ genType const A(1);
+ genType const B(1);
+
+ bool const R = A != B;
+ bool const S = A == B;
+ Error += (S && !R) ? 0 : 1;
+ }
+
+ {
+ genType const A(1);
+ genType const B(1);
+
+ genType const C = A + B;
+ Error += C == genType(2) ? 0 : 1;
+
+ genType const D = A - B;
+ Error += D == genType(0) ? 0 : 1;
+
+ genType const E = A * B;
+ Error += E == genType(1) ? 0 : 1;
+
+ genType const F = A / B;
+ Error += F == genType(1) ? 0 : 1;
+ }
+
+ {
+ genType const A(3);
+ genType const B(2);
+
+ genType const C = A % B;
+ Error += C == genType(1) ? 0 : 1;
+ }
+
+ {
+ genType const A(1);
+ genType const B(1);
+ genType const C(0);
+
+ genType const I = A & B;
+ Error += I == genType(1) ? 0 : 1;
+ genType const D = A & C;
+ Error += D == genType(0) ? 0 : 1;
+
+ genType const E = A | B;
+ Error += E == genType(1) ? 0 : 1;
+ genType const F = A | C;
+ Error += F == genType(1) ? 0 : 1;
+
+ genType const G = A ^ B;
+ Error += G == genType(0) ? 0 : 1;
+ genType const H = A ^ C;
+ Error += H == genType(1) ? 0 : 1;
+ }
+
+ {
+ genType const A(0);
+ genType const B(1);
+ genType const C(2);
+
+ genType const D = B << B;
+ Error += D == genType(2) ? 0 : 1;
+ genType const E = C >> B;
+ Error += E == genType(1) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename genType>
+static int test_ctor()
+{
+ typedef typename genType::value_type T;
+
+ int Error = 0;
+
+ genType const A = genType(1);
+
+ genType const E(genType(1));
+ Error += A == E ? 0 : 1;
+
+ genType const F(E);
+ Error += A == F ? 0 : 1;
+
+ genType const B = genType(1);
+ genType const G(glm::vec<2, T>(1));
+ Error += B == G ? 0 : 1;
+
+ genType const H(glm::vec<3, T>(1));
+ Error += B == H ? 0 : 1;
+
+ genType const I(glm::vec<4, T>(1));
+ Error += B == I ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(typename genType::value_type) == sizeof(genType) ? 0 : 1;
+ Error += genType().length() == 1 ? 0 : 1;
+ Error += genType::length() == 1 ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_relational()
+{
+ int Error = 0;
+
+ genType const A(1);
+ genType const B(1);
+ genType const C(0);
+
+ Error += A == B ? 0 : 1;
+ Error += A != C ? 0 : 1;
+ Error += all(equal(A, B)) ? 0 : 1;
+ Error += any(notEqual(A, C)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType>
+static int test_constexpr()
+{
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ static_assert(genType::length() == 1, "GLM: Failed constexpr");
+ static_assert(genType(1)[0] == 1, "GLM: Failed constexpr");
+ static_assert(genType(1) == genType(1), "GLM: Failed constexpr");
+ static_assert(genType(1) != genType(0), "GLM: Failed constexpr");
+# endif
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_operators<glm::ivec1>();
+ Error += test_operators<glm::i8vec1>();
+ Error += test_operators<glm::i16vec1>();
+ Error += test_operators<glm::i32vec1>();
+ Error += test_operators<glm::i64vec1>();
+
+ Error += test_ctor<glm::ivec1>();
+ Error += test_ctor<glm::i8vec1>();
+ Error += test_ctor<glm::i16vec1>();
+ Error += test_ctor<glm::i32vec1>();
+ Error += test_ctor<glm::i64vec1>();
+
+ Error += test_size<glm::ivec1>();
+ Error += test_size<glm::i8vec1>();
+ Error += test_size<glm::i16vec1>();
+ Error += test_size<glm::i32vec1>();
+ Error += test_size<glm::i64vec1>();
+
+ Error += test_relational<glm::ivec1>();
+ Error += test_relational<glm::i8vec1>();
+ Error += test_relational<glm::i16vec1>();
+ Error += test_relational<glm::i32vec1>();
+ Error += test_relational<glm::i64vec1>();
+
+ Error += test_constexpr<glm::ivec1>();
+ Error += test_constexpr<glm::i8vec1>();
+ Error += test_constexpr<glm::i16vec1>();
+ Error += test_constexpr<glm::i32vec1>();
+ Error += test_constexpr<glm::i64vec1>();
+
+ Error += test_operators<glm::uvec1>();
+ Error += test_operators<glm::u8vec1>();
+ Error += test_operators<glm::u16vec1>();
+ Error += test_operators<glm::u32vec1>();
+ Error += test_operators<glm::u64vec1>();
+
+ Error += test_ctor<glm::uvec1>();
+ Error += test_ctor<glm::u8vec1>();
+ Error += test_ctor<glm::u16vec1>();
+ Error += test_ctor<glm::u32vec1>();
+ Error += test_ctor<glm::u64vec1>();
+
+ Error += test_size<glm::uvec1>();
+ Error += test_size<glm::u8vec1>();
+ Error += test_size<glm::u16vec1>();
+ Error += test_size<glm::u32vec1>();
+ Error += test_size<glm::u64vec1>();
+
+ Error += test_relational<glm::uvec1>();
+ Error += test_relational<glm::u8vec1>();
+ Error += test_relational<glm::u16vec1>();
+ Error += test_relational<glm::u32vec1>();
+ Error += test_relational<glm::u64vec1>();
+
+ Error += test_constexpr<glm::uvec1>();
+ Error += test_constexpr<glm::u8vec1>();
+ Error += test_constexpr<glm::u16vec1>();
+ Error += test_constexpr<glm::u32vec1>();
+ Error += test_constexpr<glm::u64vec1>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_packing.cpp b/3rdparty/glm/source/test/ext/ext_vector_packing.cpp
new file mode 100644
index 0000000..d7cbce2
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_packing.cpp
@@ -0,0 +1,58 @@
+#include <glm/ext/vector_packing.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_uint2_sized.hpp>
+#include <glm/ext/vector_int2_sized.hpp>
+#include <glm/gtc/packing.hpp>
+#include <glm/vec2.hpp>
+#include <vector>
+
+int test_packUnorm()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.7f));
+ A.push_back(glm::vec2(0.5f, 0.1f));
+
+ for (std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::u16vec2 C = glm::packUnorm<glm::uint16>(B);
+ glm::vec2 D = glm::unpackUnorm<float>(C);
+ Error += glm::all(glm::equal(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.0f));
+ A.push_back(glm::vec2(-0.5f, -0.7f));
+ A.push_back(glm::vec2(-0.1f, 0.1f));
+
+ for (std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::i16vec2 C = glm::packSnorm<glm::int16>(B);
+ glm::vec2 D = glm::unpackSnorm<float>(C);
+ Error += glm::all(glm::equal(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_packUnorm();
+ Error += test_packSnorm();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp b/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp
new file mode 100644
index 0000000..f4b9f18
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp
@@ -0,0 +1,186 @@
+#include <glm/ext/vector_reciprocal.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_constants.hpp>
+#include <glm/ext/vector_double1.hpp>
+
+static int test_sec()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::sec(glm::dvec1(0.0));
+ Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const b = glm::sec(glm::dvec1(glm::pi<double>() * 2.0));
+ Error += glm::all(glm::equal(b, glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const c = glm::sec(glm::dvec1(glm::pi<double>() * -2.0));
+ Error += glm::all(glm::equal(c, glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const d = glm::sec(glm::dvec1(glm::pi<double>() * 1.0));
+ Error += glm::all(glm::equal(d, -glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const e = glm::sec(glm::dvec1(glm::pi<double>() * -1.0));
+ Error += glm::all(glm::equal(e, -glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_csc()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::csc(glm::dvec1(glm::pi<double>() * 0.5));
+ Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const b = glm::csc(glm::dvec1(glm::pi<double>() * -0.5));
+ Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_cot()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::cot(glm::dvec1(glm::pi<double>() * 0.5));
+ Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const b = glm::cot(glm::dvec1(glm::pi<double>() * -0.5));
+ Error += glm::all(glm::equal(b, glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_asec()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::equal(glm::asec(glm::dvec1(100000.0)), glm::dvec1(glm::pi<double>() * 0.5), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::asec(glm::dvec1(-100000.0)), glm::dvec1(glm::pi<double>() * 0.5), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acsc()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::equal(glm::acsc(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::acsc(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acot()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::equal(glm::acot(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::acot(glm::dvec1(-100000.0)), glm::dvec1(glm::pi<double>()), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::acot(glm::dvec1(0.0)), glm::dvec1(glm::pi<double>() * 0.5), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_sech()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::equal(glm::sech(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::sech(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::sech(glm::dvec1(0.0)), glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_csch()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::equal(glm::csch(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::csch(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_coth()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::coth(glm::dvec1(100.0));
+ Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const b = glm::coth(glm::dvec1(-100.0));
+ Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_asech()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::asech(glm::dvec1(1.0));
+ Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acsch()
+{
+ int Error = 0;
+
+ glm::dvec1 const a(glm::acsch(glm::dvec1(0.01)));
+ Error += a.x > 1.0 ? 0 : 1;
+
+ glm::dvec1 const b(glm::acsch(glm::dvec1(-0.01)));
+ Error += b.x < -1.0 ? 0 : 1;
+
+ Error += glm::all(glm::equal(glm::acsch(glm::dvec1(100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::acsch(glm::dvec1(-100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_acoth()
+{
+ int Error = 0;
+
+ glm::dvec1 const a = glm::acoth(glm::dvec1(1.00001));
+ Error += a.x > 6.0 ? 0 : 1;
+
+ glm::dvec1 const b = glm::acoth(glm::dvec1(-1.00001));
+ Error += b.x < -6.0 ? 0 : 1;
+
+ glm::dvec1 const c = glm::acoth(glm::dvec1(10000.0));
+ Error += glm::all(glm::equal(c, glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ glm::dvec1 const d = glm::acoth(glm::dvec1(-10000.0));
+ Error += glm::all(glm::equal(d, glm::dvec1(0.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_sec();
+ Error += test_csc();
+ Error += test_cot();
+
+ Error += test_asec();
+ Error += test_acsc();
+ Error += test_acot();
+
+ Error += test_sech();
+ Error += test_csch();
+ Error += test_coth();
+
+ Error += test_asech();
+ Error += test_acsch();
+ Error += test_acoth();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_relational.cpp b/3rdparty/glm/source/test/ext/ext_vector_relational.cpp
new file mode 100644
index 0000000..f6cd307
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_relational.cpp
@@ -0,0 +1,205 @@
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float1.hpp>
+#include <glm/ext/vector_float1_precision.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <glm/ext/vector_float2_precision.hpp>
+#include <glm/ext/vector_float3.hpp>
+#include <glm/ext/vector_float3_precision.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_float4_precision.hpp>
+#include <glm/ext/vector_double1.hpp>
+#include <glm/ext/vector_double1_precision.hpp>
+#include <glm/ext/vector_double2.hpp>
+#include <glm/ext/vector_double2_precision.hpp>
+#include <glm/ext/vector_double3.hpp>
+#include <glm/ext/vector_double3_precision.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <glm/ext/vector_double4_precision.hpp>
+#include <glm/ext/vector_ulp.hpp>
+
+template <typename vecType>
+static int test_equal()
+{
+ typedef typename vecType::value_type valType;
+
+ valType const A = static_cast<valType>(1.01f);
+ valType const B = static_cast<valType>(1.02f);
+ valType const Epsilon1 = static_cast<valType>(0.1f);
+ valType const Epsilon2 = static_cast<valType>(0.001f);
+
+ int Error = 0;
+
+ Error += glm::all(glm::equal(vecType(A), vecType(B), Epsilon1)) ? 0 : 1;
+ Error += glm::all(glm::equal(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1;
+
+ Error += !glm::any(glm::equal(vecType(A), vecType(B), Epsilon2)) ? 0 : 1;
+ Error += !glm::any(glm::equal(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename vecType>
+static int test_notEqual()
+{
+ typedef typename vecType::value_type valType;
+
+ valType const A = static_cast<valType>(1.01f);
+ valType const B = static_cast<valType>(1.02f);
+ valType const Epsilon1 = static_cast<valType>(0.1f);
+ valType const Epsilon2 = static_cast<valType>(0.001f);
+
+ int Error = 0;
+
+ Error += glm::all(glm::notEqual(vecType(A), vecType(B), Epsilon2)) ? 0 : 1;
+ Error += glm::all(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1;
+
+ Error += !glm::any(glm::notEqual(vecType(A), vecType(B), Epsilon1)) ? 0 : 1;
+ Error += !glm::any(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename genType, typename valType>
+static int test_constexpr()
+{
+# if GLM_CONFIG_CONSTEXP == GLM_ENABLE
+ static_assert(glm::all(glm::equal(genType(static_cast<valType>(1.01f)), genType(static_cast<valType>(1.02f)), static_cast<valType>(0.1f))), "GLM: Failed constexpr");
+# endif
+
+ return 0;
+}
+
+template <typename T>
+static int test_equal_ulps()
+{
+ typedef glm::vec<4, T, glm::defaultp> vec4;
+
+ T const One(1);
+ vec4 const Ones(1);
+
+ int Error = 0;
+
+ T const ULP1Plus = glm::nextFloat(One);
+ Error += glm::all(glm::equal(Ones, vec4(ULP1Plus), 1)) ? 0 : 1;
+
+ T const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += !glm::all(glm::equal(Ones, vec4(ULP2Plus), 1)) ? 0 : 1;
+
+ T const ULP1Minus = glm::prevFloat(One);
+ Error += glm::all(glm::equal(Ones, vec4(ULP1Minus), 1)) ? 0 : 1;
+
+ T const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += !glm::all(glm::equal(Ones, vec4(ULP2Minus), 1)) ? 0 : 1;
+
+ return Error;
+}
+
+template <typename T>
+static int test_notEqual_ulps()
+{
+ typedef glm::vec<4, T, glm::defaultp> vec4;
+
+ T const One(1);
+ vec4 const Ones(1);
+
+ int Error = 0;
+
+ T const ULP1Plus = glm::nextFloat(One);
+ Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Plus), 1)) ? 0 : 1;
+
+ T const ULP2Plus = glm::nextFloat(ULP1Plus);
+ Error += glm::all(glm::notEqual(Ones, vec4(ULP2Plus), 1)) ? 0 : 1;
+
+ T const ULP1Minus = glm::prevFloat(One);
+ Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Minus), 1)) ? 0 : 1;
+
+ T const ULP2Minus = glm::prevFloat(ULP1Minus);
+ Error += glm::all(glm::notEqual(Ones, vec4(ULP2Minus), 1)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_equal_ulps<float>();
+ Error += test_equal_ulps<double>();
+ Error += test_notEqual_ulps<float>();
+ Error += test_notEqual_ulps<double>();
+
+ Error += test_equal<glm::vec1>();
+ Error += test_equal<glm::lowp_vec1>();
+ Error += test_equal<glm::mediump_vec1>();
+ Error += test_equal<glm::highp_vec1>();
+ Error += test_equal<glm::vec2>();
+ Error += test_equal<glm::lowp_vec2>();
+ Error += test_equal<glm::mediump_vec2>();
+ Error += test_equal<glm::highp_vec2>();
+ Error += test_equal<glm::vec3>();
+ Error += test_equal<glm::lowp_vec3>();
+ Error += test_equal<glm::mediump_vec3>();
+ Error += test_equal<glm::highp_vec3>();
+ Error += test_equal<glm::vec4>();
+ Error += test_equal<glm::lowp_vec4>();
+ Error += test_equal<glm::mediump_vec4>();
+ Error += test_equal<glm::highp_vec4>();
+
+ Error += test_equal<glm::dvec1>();
+ Error += test_equal<glm::lowp_dvec1>();
+ Error += test_equal<glm::mediump_dvec1>();
+ Error += test_equal<glm::highp_dvec1>();
+ Error += test_equal<glm::dvec2>();
+ Error += test_equal<glm::lowp_dvec2>();
+ Error += test_equal<glm::mediump_dvec2>();
+ Error += test_equal<glm::highp_dvec2>();
+ Error += test_equal<glm::dvec3>();
+ Error += test_equal<glm::lowp_dvec3>();
+ Error += test_equal<glm::mediump_dvec3>();
+ Error += test_equal<glm::highp_dvec3>();
+ Error += test_equal<glm::dvec4>();
+ Error += test_equal<glm::lowp_dvec4>();
+ Error += test_equal<glm::mediump_dvec4>();
+ Error += test_equal<glm::highp_dvec4>();
+
+ Error += test_notEqual<glm::vec1>();
+ Error += test_notEqual<glm::lowp_vec1>();
+ Error += test_notEqual<glm::mediump_vec1>();
+ Error += test_notEqual<glm::highp_vec1>();
+ Error += test_notEqual<glm::vec2>();
+ Error += test_notEqual<glm::lowp_vec2>();
+ Error += test_notEqual<glm::mediump_vec2>();
+ Error += test_notEqual<glm::highp_vec2>();
+ Error += test_notEqual<glm::vec3>();
+ Error += test_notEqual<glm::lowp_vec3>();
+ Error += test_notEqual<glm::mediump_vec3>();
+ Error += test_notEqual<glm::highp_vec3>();
+ Error += test_notEqual<glm::vec4>();
+ Error += test_notEqual<glm::lowp_vec4>();
+ Error += test_notEqual<glm::mediump_vec4>();
+ Error += test_notEqual<glm::highp_vec4>();
+
+ Error += test_notEqual<glm::dvec1>();
+ Error += test_notEqual<glm::lowp_dvec1>();
+ Error += test_notEqual<glm::mediump_dvec1>();
+ Error += test_notEqual<glm::highp_dvec1>();
+ Error += test_notEqual<glm::dvec2>();
+ Error += test_notEqual<glm::lowp_dvec2>();
+ Error += test_notEqual<glm::mediump_dvec2>();
+ Error += test_notEqual<glm::highp_dvec2>();
+ Error += test_notEqual<glm::dvec3>();
+ Error += test_notEqual<glm::lowp_dvec3>();
+ Error += test_notEqual<glm::mediump_dvec3>();
+ Error += test_notEqual<glm::highp_dvec3>();
+ Error += test_notEqual<glm::dvec4>();
+ Error += test_notEqual<glm::lowp_dvec4>();
+ Error += test_notEqual<glm::mediump_dvec4>();
+ Error += test_notEqual<glm::highp_dvec4>();
+
+ Error += test_constexpr<glm::vec1, float>();
+ Error += test_constexpr<glm::vec2, float>();
+ Error += test_constexpr<glm::vec3, float>();
+ Error += test_constexpr<glm::vec4, float>();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp
new file mode 100644
index 0000000..f2e4624
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_uint1_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+ static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+ static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+ static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+ static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec1) == 1 ? 0 : 1;
+ Error += sizeof(glm::u16vec1) == 2 ? 0 : 1;
+ Error += sizeof(glm::u32vec1) == 4 ? 0 : 1;
+ Error += sizeof(glm::u64vec1) == 8 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec1) < sizeof(glm::u16vec1) ? 0 : 1;
+ Error += sizeof(glm::u16vec1) < sizeof(glm::u32vec1) ? 0 : 1;
+ Error += sizeof(glm::u32vec1) < sizeof(glm::u64vec1) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp
new file mode 100644
index 0000000..9c0977e
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_uint2_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec2) == 2 ? 0 : 1;
+ Error += sizeof(glm::u16vec2) == 4 ? 0 : 1;
+ Error += sizeof(glm::u32vec2) == 8 ? 0 : 1;
+ Error += sizeof(glm::u64vec2) == 16 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec2) < sizeof(glm::u16vec2) ? 0 : 1;
+ Error += sizeof(glm::u16vec2) < sizeof(glm::u32vec2) ? 0 : 1;
+ Error += sizeof(glm::u32vec2) < sizeof(glm::u64vec2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp
new file mode 100644
index 0000000..4cc2e44
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_uint3_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec3) == 3 ? 0 : 1;
+ Error += sizeof(glm::u16vec3) == 6 ? 0 : 1;
+ Error += sizeof(glm::u32vec3) == 12 ? 0 : 1;
+ Error += sizeof(glm::u64vec3) == 24 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec3) < sizeof(glm::u16vec3) ? 0 : 1;
+ Error += sizeof(glm::u16vec3) < sizeof(glm::u32vec3) ? 0 : 1;
+ Error += sizeof(glm::u32vec3) < sizeof(glm::u64vec3) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp
new file mode 100644
index 0000000..9e7ffe7
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp
@@ -0,0 +1,41 @@
+#include <glm/ext/vector_uint4_sized.hpp>
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
+#endif
+
+static int test_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec4) == 4 ? 0 : 1;
+ Error += sizeof(glm::u16vec4) == 8 ? 0 : 1;
+ Error += sizeof(glm::u32vec4) == 16 ? 0 : 1;
+ Error += sizeof(glm::u64vec4) == 32 ? 0 : 1;
+
+ return Error;
+}
+
+static int test_comp()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec4) < sizeof(glm::u16vec4) ? 0 : 1;
+ Error += sizeof(glm::u16vec4) < sizeof(glm::u32vec4) ? 0 : 1;
+ Error += sizeof(glm::u32vec4) < sizeof(glm::u64vec4) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_size();
+ Error += test_comp();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp b/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp
new file mode 100644
index 0000000..6ebd1a1
--- /dev/null
+++ b/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp
@@ -0,0 +1,99 @@
+#include <glm/ext/vector_ulp.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#include <glm/ext/vector_double4.hpp>
+#include <glm/ext/vector_int4.hpp>
+
+static int test_ulp_float_dist()
+{
+ int Error = 0;
+
+ glm::vec4 const A(1.0f);
+
+ glm::vec4 const B = glm::nextFloat(A);
+ Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1;
+ glm::vec4 const C = glm::prevFloat(B);
+ Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1;
+
+ glm::ivec4 const D = glm::floatDistance(A, B);
+ Error += D == glm::ivec4(1) ? 0 : 1;
+ glm::ivec4 const E = glm::floatDistance(A, C);
+ Error += E == glm::ivec4(0) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_ulp_float_step()
+{
+ int Error = 0;
+
+ glm::vec4 const A(1.0f);
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ glm::vec4 const B = glm::nextFloat(A, i);
+ Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1;
+ glm::vec4 const C = glm::prevFloat(B, i);
+ Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1;
+
+ glm::ivec4 const D = glm::floatDistance(A, B);
+ Error += D == glm::ivec4(i) ? 0 : 1;
+ glm::ivec4 const E = glm::floatDistance(A, C);
+ Error += E == glm::ivec4(0) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ulp_double_dist()
+{
+ int Error = 0;
+
+ glm::dvec4 const A(1.0);
+
+ glm::dvec4 const B = glm::nextFloat(A);
+ Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1;
+ glm::dvec4 const C = glm::prevFloat(B);
+ Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1;
+
+ glm::ivec4 const D(glm::floatDistance(A, B));
+ Error += D == glm::ivec4(1) ? 0 : 1;
+ glm::ivec4 const E = glm::floatDistance(A, C);
+ Error += E == glm::ivec4(0) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_ulp_double_step()
+{
+ int Error = 0;
+
+ glm::dvec4 const A(1.0);
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ glm::dvec4 const B = glm::nextFloat(A, i);
+ Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1;
+ glm::dvec4 const C = glm::prevFloat(B, i);
+ Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1;
+
+ glm::ivec4 const D(glm::floatDistance(A, B));
+ Error += D == glm::ivec4(i) ? 0 : 1;
+ glm::ivec4 const E(glm::floatDistance(A, C));
+ Error += E == glm::ivec4(0) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ulp_float_dist();
+ Error += test_ulp_float_step();
+ Error += test_ulp_double_dist();
+ Error += test_ulp_double_step();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/glm.cppcheck b/3rdparty/glm/source/test/glm.cppcheck
new file mode 100644
index 0000000..12081fe
--- /dev/null
+++ b/3rdparty/glm/source/test/glm.cppcheck
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="1">
+ <includedir>
+ <dir name="../glm"/>
+ </includedir>
+</project>
diff --git a/3rdparty/glm/source/test/gtc/CMakeLists.txt b/3rdparty/glm/source/test/gtc/CMakeLists.txt
new file mode 100644
index 0000000..4aef24a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/CMakeLists.txt
@@ -0,0 +1,20 @@
+glmCreateTestGTC(gtc_bitfield)
+glmCreateTestGTC(gtc_color_space)
+glmCreateTestGTC(gtc_constants)
+glmCreateTestGTC(gtc_epsilon)
+glmCreateTestGTC(gtc_integer)
+glmCreateTestGTC(gtc_matrix_access)
+glmCreateTestGTC(gtc_matrix_integer)
+glmCreateTestGTC(gtc_matrix_inverse)
+glmCreateTestGTC(gtc_matrix_transform)
+glmCreateTestGTC(gtc_noise)
+glmCreateTestGTC(gtc_packing)
+glmCreateTestGTC(gtc_quaternion)
+glmCreateTestGTC(gtc_random)
+glmCreateTestGTC(gtc_round)
+glmCreateTestGTC(gtc_reciprocal)
+glmCreateTestGTC(gtc_type_aligned)
+glmCreateTestGTC(gtc_type_precision)
+glmCreateTestGTC(gtc_type_ptr)
+glmCreateTestGTC(gtc_ulp)
+glmCreateTestGTC(gtc_vec1)
diff --git a/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp b/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp
new file mode 100644
index 0000000..95c41f1
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp
@@ -0,0 +1,936 @@
+#include <glm/gtc/bitfield.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/integer.hpp>
+#include <ctime>
+#include <cstdio>
+#include <vector>
+
+namespace mask
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ };
+
+ inline int mask_zero(int Bits)
+ {
+ return ~((~0) << Bits);
+ }
+
+ inline int mask_mix(int Bits)
+ {
+ return Bits >= sizeof(int) * 8 ? 0xffffffff : (static_cast<int>(1) << Bits) - static_cast<int>(1);
+ }
+
+ inline int mask_half(int Bits)
+ {
+ // We do the shift in two steps because 1 << 32 on an int is undefined.
+
+ int const Half = Bits >> 1;
+ int const Fill = ~0;
+ int const ShiftHaft = (Fill << Half);
+ int const Rest = Bits - Half;
+ int const Reversed = ShiftHaft << Rest;
+
+ return ~Reversed;
+ }
+
+ inline int mask_loop(int Bits)
+ {
+ int Mask = 0;
+ for(int Bit = 0; Bit < Bits; ++Bit)
+ Mask |= (static_cast<int>(1) << Bit);
+ return Mask;
+ }
+
+ int perf()
+ {
+ int const Count = 100000000;
+
+ std::clock_t Timestamp1 = std::clock();
+
+ {
+ std::vector<int> Mask;
+ Mask.resize(Count);
+ for(int i = 0; i < Count; ++i)
+ Mask[i] = mask_mix(i % 32);
+ }
+
+ std::clock_t Timestamp2 = std::clock();
+
+ {
+ std::vector<int> Mask;
+ Mask.resize(Count);
+ for(int i = 0; i < Count; ++i)
+ Mask[i] = mask_loop(i % 32);
+ }
+
+ std::clock_t Timestamp3 = std::clock();
+
+ {
+ std::vector<int> Mask;
+ Mask.resize(Count);
+ for(int i = 0; i < Count; ++i)
+ Mask[i] = glm::mask(i % 32);
+ }
+
+ std::clock_t Timestamp4 = std::clock();
+
+ {
+ std::vector<int> Mask;
+ Mask.resize(Count);
+ for(int i = 0; i < Count; ++i)
+ Mask[i] = mask_zero(i % 32);
+ }
+
+ std::clock_t Timestamp5 = std::clock();
+
+ {
+ std::vector<int> Mask;
+ Mask.resize(Count);
+ for(int i = 0; i < Count; ++i)
+ Mask[i] = mask_half(i % 32);
+ }
+
+ std::clock_t Timestamp6 = std::clock();
+
+ std::clock_t TimeMix = Timestamp2 - Timestamp1;
+ std::clock_t TimeLoop = Timestamp3 - Timestamp2;
+ std::clock_t TimeDefault = Timestamp4 - Timestamp3;
+ std::clock_t TimeZero = Timestamp5 - Timestamp4;
+ std::clock_t TimeHalf = Timestamp6 - Timestamp5;
+
+ std::printf("mask[mix]: %d\n", static_cast<unsigned int>(TimeMix));
+ std::printf("mask[loop]: %d\n", static_cast<unsigned int>(TimeLoop));
+ std::printf("mask[default]: %d\n", static_cast<unsigned int>(TimeDefault));
+ std::printf("mask[zero]: %d\n", static_cast<unsigned int>(TimeZero));
+ std::printf("mask[half]: %d\n", static_cast<unsigned int>(TimeHalf));
+
+ return TimeDefault < TimeLoop ? 0 : 1;
+ }
+
+ int test_uint()
+ {
+ type<glm::uint> const Data[] =
+ {
+ { 0, 0x00000000},
+ { 1, 0x00000001},
+ { 2, 0x00000003},
+ { 3, 0x00000007},
+ {31, 0x7fffffff},
+ {32, 0xffffffff}
+ };
+
+ int Error = 0;
+/* mask_zero is sadly not a correct code
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
+ {
+ int Result = mask_zero(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+*/
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
+ {
+ int Result = mask_mix(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
+ {
+ int Result = mask_half(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
+ {
+ int Result = mask_loop(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
+ {
+ int Result = glm::mask(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uvec4()
+ {
+ type<glm::ivec4> const Data[] =
+ {
+ {glm::ivec4( 0), glm::ivec4(0x00000000)},
+ {glm::ivec4( 1), glm::ivec4(0x00000001)},
+ {glm::ivec4( 2), glm::ivec4(0x00000003)},
+ {glm::ivec4( 3), glm::ivec4(0x00000007)},
+ {glm::ivec4(31), glm::ivec4(0x7fffffff)},
+ {glm::ivec4(32), glm::ivec4(0xffffffff)}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::ivec4>); i < n; ++i)
+ {
+ glm::ivec4 Result = glm::mask(Data[i].Value);
+ Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_uint();
+ Error += test_uvec4();
+
+ return Error;
+ }
+}//namespace mask
+
+namespace bitfieldInterleave3
+{
+ template<typename PARAM, typename RET>
+ inline RET refBitfieldInterleave(PARAM x, PARAM y, PARAM z)
+ {
+ RET Result = 0;
+ for(RET i = 0; i < sizeof(PARAM) * 8; ++i)
+ {
+ Result |= ((RET(x) & (RET(1U) << i)) << ((i << 1) + 0));
+ Result |= ((RET(y) & (RET(1U) << i)) << ((i << 1) + 1));
+ Result |= ((RET(z) & (RET(1U) << i)) << ((i << 1) + 2));
+ }
+ return Result;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ glm::uint16 x_max = 1 << 11;
+ glm::uint16 y_max = 1 << 11;
+ glm::uint16 z_max = 1 << 11;
+
+ for(glm::uint16 z = 0; z < z_max; z += 27)
+ for(glm::uint16 y = 0; y < y_max; y += 27)
+ for(glm::uint16 x = 0; x < x_max; x += 27)
+ {
+ glm::uint64 ResultA = refBitfieldInterleave<glm::uint16, glm::uint64>(x, y, z);
+ glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z);
+ Error += ResultA == ResultB ? 0 : 1;
+ }
+
+ return Error;
+ }
+}
+
+namespace bitfieldInterleave4
+{
+ template<typename PARAM, typename RET>
+ inline RET loopBitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w)
+ {
+ RET const v[4] = {x, y, z, w};
+ RET Result = 0;
+ for(RET i = 0; i < sizeof(PARAM) * 8; i++)
+ {
+ Result |= ((((v[0] >> i) & 1U)) << ((i << 2) + 0));
+ Result |= ((((v[1] >> i) & 1U)) << ((i << 2) + 1));
+ Result |= ((((v[2] >> i) & 1U)) << ((i << 2) + 2));
+ Result |= ((((v[3] >> i) & 1U)) << ((i << 2) + 3));
+ }
+ return Result;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ glm::uint16 x_max = 1 << 11;
+ glm::uint16 y_max = 1 << 11;
+ glm::uint16 z_max = 1 << 11;
+ glm::uint16 w_max = 1 << 11;
+
+ for(glm::uint16 w = 0; w < w_max; w += 27)
+ for(glm::uint16 z = 0; z < z_max; z += 27)
+ for(glm::uint16 y = 0; y < y_max; y += 27)
+ for(glm::uint16 x = 0; x < x_max; x += 27)
+ {
+ glm::uint64 ResultA = loopBitfieldInterleave<glm::uint16, glm::uint64>(x, y, z, w);
+ glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z, w);
+ Error += ResultA == ResultB ? 0 : 1;
+ }
+
+ return Error;
+ }
+}
+
+namespace bitfieldInterleave
+{
+ inline glm::uint64 fastBitfieldInterleave(glm::uint32 x, glm::uint32 y)
+ {
+ glm::uint64 REG1;
+ glm::uint64 REG2;
+
+ REG1 = x;
+ REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
+ REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
+ REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
+ REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
+
+ REG2 = y;
+ REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
+ REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
+ REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
+ REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
+
+ return REG1 | (REG2 << 1);
+ }
+
+ inline glm::uint64 interleaveBitfieldInterleave(glm::uint32 x, glm::uint32 y)
+ {
+ glm::uint64 REG1;
+ glm::uint64 REG2;
+
+ REG1 = x;
+ REG2 = y;
+
+ REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
+ REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
+
+ REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
+ REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
+
+ REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+
+ REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
+ REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
+
+ REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
+ REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
+
+ return REG1 | (REG2 << 1);
+ }
+/*
+ inline glm::uint64 loopBitfieldInterleave(glm::uint32 x, glm::uint32 y)
+ {
+ static glm::uint64 const Mask[5] =
+ {
+ 0x5555555555555555,
+ 0x3333333333333333,
+ 0x0F0F0F0F0F0F0F0F,
+ 0x00FF00FF00FF00FF,
+ 0x0000FFFF0000FFFF
+ };
+
+ glm::uint64 REG1 = x;
+ glm::uint64 REG2 = y;
+ for(int i = 4; i >= 0; --i)
+ {
+ REG1 = ((REG1 << (1 << i)) | REG1) & Mask[i];
+ REG2 = ((REG2 << (1 << i)) | REG2) & Mask[i];
+ }
+
+ return REG1 | (REG2 << 1);
+ }
+*/
+#if GLM_ARCH & GLM_ARCH_SSE2_BIT
+ inline glm::uint64 sseBitfieldInterleave(glm::uint32 x, glm::uint32 y)
+ {
+ __m128i const Array = _mm_set_epi32(0, y, 0, x);
+
+ __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
+ __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);
+ __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
+ __m128i const Mask1 = _mm_set1_epi32(0x33333333);
+ __m128i const Mask0 = _mm_set1_epi32(0x55555555);
+
+ __m128i Reg1;
+ __m128i Reg2;
+
+ // REG1 = x;
+ // REG2 = y;
+ Reg1 = _mm_load_si128(&Array);
+
+ //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
+ //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
+ Reg2 = _mm_slli_si128(Reg1, 2);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask4);
+
+ //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
+ //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
+ Reg2 = _mm_slli_si128(Reg1, 1);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask3);
+
+ //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ Reg2 = _mm_slli_epi32(Reg1, 4);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask2);
+
+ //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
+ //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
+ Reg2 = _mm_slli_epi32(Reg1, 2);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask1);
+
+ //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
+ //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
+ Reg2 = _mm_slli_epi32(Reg1, 1);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask0);
+
+ //return REG1 | (REG2 << 1);
+ Reg2 = _mm_slli_epi32(Reg1, 1);
+ Reg2 = _mm_srli_si128(Reg2, 8);
+ Reg1 = _mm_or_si128(Reg1, Reg2);
+
+ __m128i Result;
+ _mm_store_si128(&Result, Reg1);
+ return *reinterpret_cast<glm::uint64*>(&Result);
+ }
+
+ inline glm::uint64 sseUnalignedBitfieldInterleave(glm::uint32 x, glm::uint32 y)
+ {
+ __m128i const Array = _mm_set_epi32(0, y, 0, x);
+
+ __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
+ __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);
+ __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
+ __m128i const Mask1 = _mm_set1_epi32(0x33333333);
+ __m128i const Mask0 = _mm_set1_epi32(0x55555555);
+
+ __m128i Reg1;
+ __m128i Reg2;
+
+ // REG1 = x;
+ // REG2 = y;
+ Reg1 = _mm_loadu_si128(&Array);
+
+ //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
+ //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
+ Reg2 = _mm_slli_si128(Reg1, 2);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask4);
+
+ //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
+ //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
+ Reg2 = _mm_slli_si128(Reg1, 1);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask3);
+
+ //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
+ Reg2 = _mm_slli_epi32(Reg1, 4);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask2);
+
+ //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
+ //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
+ Reg2 = _mm_slli_epi32(Reg1, 2);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask1);
+
+ //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
+ //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
+ Reg2 = _mm_slli_epi32(Reg1, 1);
+ Reg1 = _mm_or_si128(Reg2, Reg1);
+ Reg1 = _mm_and_si128(Reg1, Mask0);
+
+ //return REG1 | (REG2 << 1);
+ Reg2 = _mm_slli_epi32(Reg1, 1);
+ Reg2 = _mm_srli_si128(Reg2, 8);
+ Reg1 = _mm_or_si128(Reg1, Reg2);
+
+ __m128i Result;
+ _mm_store_si128(&Result, Reg1);
+ return *reinterpret_cast<glm::uint64*>(&Result);
+ }
+#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
+
+ int test()
+ {
+ int Error = 0;
+
+/*
+ {
+ for(glm::uint32 y = 0; y < (1 << 10); ++y)
+ for(glm::uint32 x = 0; x < (1 << 10); ++x)
+ {
+ glm::uint64 A = glm::bitfieldInterleave(x, y);
+ glm::uint64 B = fastBitfieldInterleave(x, y);
+ //glm::uint64 C = loopBitfieldInterleave(x, y);
+ glm::uint64 D = interleaveBitfieldInterleave(x, y);
+
+ assert(A == B);
+ //assert(A == C);
+ assert(A == D);
+
+# if GLM_ARCH & GLM_ARCH_SSE2_BIT
+ glm::uint64 E = sseBitfieldInterleave(x, y);
+ glm::uint64 F = sseUnalignedBitfieldInterleave(x, y);
+ assert(A == E);
+ assert(A == F);
+
+ __m128i G = glm_i128_interleave(_mm_set_epi32(0, y, 0, x));
+ glm::uint64 Result[2];
+ _mm_storeu_si128((__m128i*)Result, G);
+ assert(A == Result[0]);
+# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
+ }
+ }
+*/
+ {
+ for(glm::uint8 y = 0; y < 127; ++y)
+ for(glm::uint8 x = 0; x < 127; ++x)
+ {
+ glm::uint64 A(glm::bitfieldInterleave(glm::u8vec2(x, y)));
+ glm::uint64 B(glm::bitfieldInterleave(glm::u16vec2(x, y)));
+ glm::uint64 C(glm::bitfieldInterleave(glm::u32vec2(x, y)));
+
+ Error += A == B ? 0 : 1;
+ Error += A == C ? 0 : 1;
+
+ glm::u32vec2 const& D = glm::bitfieldDeinterleave(C);
+ Error += D.x == x ? 0 : 1;
+ Error += D.y == y ? 0 : 1;
+ }
+ }
+
+ {
+ for(glm::uint8 y = 0; y < 127; ++y)
+ for(glm::uint8 x = 0; x < 127; ++x)
+ {
+ glm::int64 A(glm::bitfieldInterleave(glm::int8(x), glm::int8(y)));
+ glm::int64 B(glm::bitfieldInterleave(glm::int16(x), glm::int16(y)));
+ glm::int64 C(glm::bitfieldInterleave(glm::int32(x), glm::int32(y)));
+
+ Error += A == B ? 0 : 1;
+ Error += A == C ? 0 : 1;
+ }
+ }
+
+ return Error;
+ }
+
+ int perf()
+ {
+ glm::uint32 x_max = 1 << 11;
+ glm::uint32 y_max = 1 << 10;
+
+ // ALU
+ std::vector<glm::uint64> Data(x_max * y_max);
+ std::vector<glm::u32vec2> Param(x_max * y_max);
+ for(glm::uint32 i = 0; i < Param.size(); ++i)
+ Param[i] = glm::u32vec2(i % x_max, i / y_max);
+
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = fastBitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+/*
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = loopBitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+*/
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = interleaveBitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("interleaveBitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+
+# if GLM_ARCH & GLM_ARCH_SSE2_BIT
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = sseBitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("sseBitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = sseUnalignedBitfieldInterleave(Param[i].x, Param[i].y);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("sseUnalignedBitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
+
+ {
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y, Param[i].x);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("glm::detail::bitfieldInterleave Time %d clocks\n", static_cast<int>(Time));
+ }
+
+# if(GLM_ARCH & GLM_ARCH_SSE2_BIT && !(GLM_COMPILER & GLM_COMPILER_GCC))
+ {
+ // SIMD
+ std::vector<__m128i> SimdData;
+ SimdData.resize(static_cast<std::size_t>(x_max * y_max));
+ std::vector<__m128i> SimdParam;
+ SimdParam.resize(static_cast<std::size_t>(x_max * y_max));
+ for(std::size_t i = 0; i < SimdParam.size(); ++i)
+ SimdParam[i] = _mm_set_epi32(static_cast<int>(i % static_cast<std::size_t>(x_max)), 0, static_cast<int>(i / static_cast<std::size_t>(y_max)), 0);
+
+ std::clock_t LastTime = std::clock();
+
+ for(std::size_t i = 0; i < SimdData.size(); ++i)
+ SimdData[i] = glm_i128_interleave(SimdParam[i]);
+
+ std::clock_t Time = std::clock() - LastTime;
+
+ std::printf("_mm_bit_interleave_si128 Time %d clocks\n", static_cast<int>(Time));
+ }
+# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
+
+ return 0;
+ }
+}//namespace bitfieldInterleave
+
+namespace bitfieldInterleave5
+{
+ GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave_u8vec2(glm::uint8 x, glm::uint8 y)
+ {
+ glm::uint32 Result = (glm::uint32(y) << 16) | glm::uint32(x);
+ Result = ((Result << 4) | Result) & 0x0F0F0F0F;
+ Result = ((Result << 2) | Result) & 0x33333333;
+ Result = ((Result << 1) | Result) & 0x55555555;
+ return static_cast<glm::uint16>((Result & 0x0000FFFF) | (Result >> 15));
+ }
+
+ GLM_FUNC_QUALIFIER glm::u8vec2 bitfieldDeinterleave_u8vec2(glm::uint16 InterleavedBitfield)
+ {
+ glm::uint32 Result(InterleavedBitfield);
+ Result = ((Result << 15) | Result) & 0x55555555;
+ Result = ((Result >> 1) | Result) & 0x33333333;
+ Result = ((Result >> 2) | Result) & 0x0F0F0F0F;
+ Result = ((Result >> 4) | Result) & 0x00FF00FF;
+ return glm::u8vec2(Result & 0x0000FFFF, Result >> 16);
+ }
+
+ GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u8vec4(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w)
+ {
+ glm::uint64 Result = (glm::uint64(w) << 48) | (glm::uint64(z) << 32) | (glm::uint64(y) << 16) | glm::uint64(x);
+ Result = ((Result << 12) | Result) & 0x000F000F000F000Full;
+ Result = ((Result << 6) | Result) & 0x0303030303030303ull;
+ Result = ((Result << 3) | Result) & 0x1111111111111111ull;
+
+ const glm::uint32 a = static_cast<glm::uint32>((Result & 0x000000000000FFFF) >> ( 0 - 0));
+ const glm::uint32 b = static_cast<glm::uint32>((Result & 0x00000000FFFF0000) >> (16 - 3));
+ const glm::uint32 c = static_cast<glm::uint32>((Result & 0x0000FFFF00000000) >> (32 - 6));
+ const glm::uint32 d = static_cast<glm::uint32>((Result & 0xFFFF000000000000) >> (48 - 12));
+
+ return a | b | c | d;
+ }
+
+ GLM_FUNC_QUALIFIER glm::u8vec4 bitfieldDeinterleave_u8vec4(glm::uint32 InterleavedBitfield)
+ {
+ glm::uint64 Result(InterleavedBitfield);
+ Result = ((Result << 15) | Result) & 0x9249249249249249ull;
+ Result = ((Result >> 1) | Result) & 0x30C30C30C30C30C3ull;
+ Result = ((Result >> 2) | Result) & 0xF00F00F00F00F00Full;
+ Result = ((Result >> 4) | Result) & 0x00FF0000FF0000FFull;
+ return glm::u8vec4(
+ (Result >> 0) & 0x000000000000FFFFull,
+ (Result >> 16) & 0x00000000FFFF0000ull,
+ (Result >> 32) & 0x0000FFFF00000000ull,
+ (Result >> 48) & 0xFFFF000000000000ull);
+ }
+
+ GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u16vec2(glm::uint16 x, glm::uint16 y)
+ {
+ glm::uint64 Result = (glm::uint64(y) << 32) | glm::uint64(x);
+ Result = ((Result << 8) | Result) & static_cast<glm::uint32>(0x00FF00FF00FF00FFull);
+ Result = ((Result << 4) | Result) & static_cast<glm::uint32>(0x0F0F0F0F0F0F0F0Full);
+ Result = ((Result << 2) | Result) & static_cast<glm::uint32>(0x3333333333333333ull);
+ Result = ((Result << 1) | Result) & static_cast<glm::uint32>(0x5555555555555555ull);
+ return static_cast<glm::uint32>((Result & 0x00000000FFFFFFFFull) | (Result >> 31));
+ }
+
+ GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave_u16vec2(glm::uint32 InterleavedBitfield)
+ {
+ glm::uint64 Result(InterleavedBitfield);
+ Result = ((Result << 31) | Result) & 0x5555555555555555ull;
+ Result = ((Result >> 1) | Result) & 0x3333333333333333ull;
+ Result = ((Result >> 2) | Result) & 0x0F0F0F0F0F0F0F0Full;
+ Result = ((Result >> 4) | Result) & 0x00FF00FF00FF00FFull;
+ Result = ((Result >> 8) | Result) & 0x0000FFFF0000FFFFull;
+ return glm::u16vec2(Result & 0x00000000FFFFFFFFull, Result >> 32);
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ {
+ glm::uint16 A = bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j));
+ glm::uint16 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j));
+ Error += A == B ? 0 : 1;
+
+ glm::u8vec2 C = bitfieldDeinterleave_u8vec2(A);
+ Error += C.x == glm::uint8(i) ? 0 : 1;
+ Error += C.y == glm::uint8(j) ? 0 : 1;
+ }
+
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ {
+ glm::uint32 A = bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j));
+ glm::uint32 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j));
+ Error += A == B ? 0 : 1;
+/*
+ glm::u8vec4 C = bitfieldDeinterleave_u8vec4(A);
+ Error += C.x == glm::uint8(i) ? 0 : 1;
+ Error += C.y == glm::uint8(j) ? 0 : 1;
+ Error += C.z == glm::uint8(i) ? 0 : 1;
+ Error += C.w == glm::uint8(j) ? 0 : 1;
+*/
+ }
+
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ {
+ glm::uint32 A = bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j));
+ glm::uint32 B = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j));
+ Error += A == B ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int perf_old_u8vec2(std::vector<glm::uint16>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("glm::bitfieldInterleave<u8vec2> Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf_new_u8vec2(std::vector<glm::uint16>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("bitfieldInterleave_u8vec2 Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf_old_u8vec4(std::vector<glm::uint32>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("glm::bitfieldInterleave<u8vec4> Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf_new_u8vec4(std::vector<glm::uint32>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("bitfieldInterleave_u8vec4 Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf_old_u16vec2(std::vector<glm::uint32>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("glm::bitfieldInterleave<u16vec2> Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf_new_u16vec2(std::vector<glm::uint32>& Result)
+ {
+ int Error = 0;
+
+ const std::clock_t BeginTime = std::clock();
+
+ for(glm::size_t k = 0; k < 10000; ++k)
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Error += Result[j * 256 + i] == bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j)) ? 0 : 1;
+
+ const std::clock_t EndTime = std::clock();
+
+ std::printf("bitfieldInterleave_u16vec2 Time %d clocks\n", static_cast<int>(EndTime - BeginTime));
+
+ return Error;
+ }
+
+ int perf()
+ {
+ int Error = 0;
+
+ std::printf("bitfieldInterleave perf: init\r");
+
+ std::vector<glm::uint16> Result_u8vec2(256 * 256, 0);
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Result_u8vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j));
+
+ Error += perf_old_u8vec2(Result_u8vec2);
+ Error += perf_new_u8vec2(Result_u8vec2);
+
+ std::vector<glm::uint32> Result_u8vec4(256 * 256, 0);
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Result_u8vec4[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j));
+
+ Error += perf_old_u8vec4(Result_u8vec4);
+ Error += perf_new_u8vec4(Result_u8vec4);
+
+ std::vector<glm::uint32> Result_u16vec2(256 * 256, 0);
+ for(glm::size_t j = 0; j < 256; ++j)
+ for(glm::size_t i = 0; i < 256; ++i)
+ Result_u16vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j));
+
+ Error += perf_old_u16vec2(Result_u16vec2);
+ Error += perf_new_u16vec2(Result_u16vec2);
+
+ std::printf("bitfieldInterleave perf: %d Errors\n", Error);
+
+ return Error;
+ }
+
+}//namespace bitfieldInterleave5
+
+static int test_bitfieldRotateRight()
+{
+ glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1);
+ glm::ivec4 const B = glm::ivec4(2) >> 1;
+
+ return A == B;
+}
+
+static int test_bitfieldRotateLeft()
+{
+ glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1);
+ glm::ivec4 const B = glm::ivec4(2) << 1;
+
+ return A == B;
+}
+
+int main()
+{
+ int Error = 0;
+
+/* Tests for a faster and to reserve bitfieldInterleave
+ Error += ::bitfieldInterleave5::test();
+ Error += ::bitfieldInterleave5::perf();
+*/
+ Error += ::mask::test();
+ Error += ::bitfieldInterleave3::test();
+ Error += ::bitfieldInterleave4::test();
+ Error += ::bitfieldInterleave::test();
+
+ Error += test_bitfieldRotateRight();
+ Error += test_bitfieldRotateLeft();
+
+# ifdef NDEBUG
+ Error += ::mask::perf();
+ Error += ::bitfieldInterleave::perf();
+# endif//NDEBUG
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_color_space.cpp b/3rdparty/glm/source/test/gtc/gtc_color_space.cpp
new file mode 100644
index 0000000..67650c5
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_color_space.cpp
@@ -0,0 +1,78 @@
+#include <glm/gtc/color_space.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+
+namespace srgb
+{
+ int test()
+ {
+ int Error(0);
+
+ glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0);
+
+ {
+ glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB);
+ glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f);
+ glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0);
+
+ {
+ glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA);
+ glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f);
+ glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ glm::vec4 const ColorSourceGNI = glm::vec4(107, 107, 104, 131) / glm::vec4(255);
+
+ {
+ glm::vec4 const ColorGNA = glm::convertSRGBToLinear(ColorSourceGNI) * glm::vec4(255);
+ glm::vec4 const ColorGNE = glm::convertLinearToSRGB(ColorSourceGNI) * glm::vec4(255);
+ glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceGNI);
+ glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB);
+ Error += glm::all(glm::epsilonEqual(ColorSourceGNI, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace srgb
+
+namespace srgb_lowp
+{
+ int test()
+ {
+ int Error(0);
+
+ for(float Color = 0.0f; Color < 1.0f; Color += 0.01f)
+ {
+ glm::highp_vec3 const HighpSRGB = glm::convertLinearToSRGB(glm::highp_vec3(Color));
+ glm::lowp_vec3 const LowpSRGB = glm::convertLinearToSRGB(glm::lowp_vec3(Color));
+ Error += glm::all(glm::epsilonEqual(glm::abs(HighpSRGB - glm::highp_vec3(LowpSRGB)), glm::highp_vec3(0), 0.1f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace srgb_lowp
+
+int main()
+{
+ int Error(0);
+
+ Error += srgb::test();
+ Error += srgb_lowp::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_constants.cpp b/3rdparty/glm/source/test/gtc/gtc_constants.cpp
new file mode 100644
index 0000000..3897cd0
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_constants.cpp
@@ -0,0 +1,30 @@
+#include <glm/gtc/constants.hpp>
+
+int test_epsilon()
+{
+ int Error = 0;
+
+ {
+ float Test = glm::epsilon<float>();
+ Error += Test > 0.0f ? 0 : 1;
+ }
+
+ {
+ double Test = glm::epsilon<double>();
+ Error += Test > 0.0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ //float MinHalf = 0.0f;
+ //while (glm::half(MinHalf) == glm::half(0.0f))
+ // MinHalf += std::numeric_limits<float>::epsilon();
+ Error += test_epsilon();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp b/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp
new file mode 100644
index 0000000..f0e6c8a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp
@@ -0,0 +1,78 @@
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/vector_relational.hpp>
+
+int test_defined()
+{
+ glm::epsilonEqual(glm::vec2(), glm::vec2(), glm::vec2());
+ glm::epsilonEqual(glm::vec3(), glm::vec3(), glm::vec3());
+ glm::epsilonEqual(glm::vec4(), glm::vec4(), glm::vec4());
+
+ glm::epsilonNotEqual(glm::vec2(), glm::vec2(), glm::vec2());
+ glm::epsilonNotEqual(glm::vec3(), glm::vec3(), glm::vec3());
+ glm::epsilonNotEqual(glm::vec4(), glm::vec4(), glm::vec4());
+
+ glm::epsilonEqual(glm::vec2(), glm::vec2(), 0.0f);
+ glm::epsilonEqual(glm::vec3(), glm::vec3(), 0.0f);
+ glm::epsilonEqual(glm::vec4(), glm::vec4(), 0.0f);
+ glm::epsilonEqual(glm::quat(), glm::quat(), 0.0f);
+
+ glm::epsilonNotEqual(glm::vec2(), glm::vec2(), 0.0f);
+ glm::epsilonNotEqual(glm::vec3(), glm::vec3(), 0.0f);
+ glm::epsilonNotEqual(glm::vec4(), glm::vec4(), 0.0f);
+ glm::epsilonNotEqual(glm::quat(), glm::quat(), 0.0f);
+
+ return 0;
+}
+
+template<typename T>
+int test_equal()
+{
+ int Error(0);
+
+ {
+ T A = glm::epsilon<T>();
+ T B = glm::epsilon<T>();
+ Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
+ }
+
+ {
+ T A(0);
+ T B = static_cast<T>(0) + glm::epsilon<T>();
+ Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
+ }
+
+ {
+ T A(0);
+ T B = static_cast<T>(0) - glm::epsilon<T>();
+ Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
+ }
+
+ {
+ T A = static_cast<T>(0) + glm::epsilon<T>();
+ T B = static_cast<T>(0);
+ Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
+ }
+
+ {
+ T A = static_cast<T>(0) - glm::epsilon<T>();
+ T B = static_cast<T>(0);
+ Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_defined();
+ Error += test_equal<float>();
+ Error += test_equal<double>();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtc/gtc_integer.cpp b/3rdparty/glm/source/test/gtc/gtc_integer.cpp
new file mode 100644
index 0000000..769d969
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_integer.cpp
@@ -0,0 +1,233 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#define GLM_FORCE_INLINE
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/integer.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtx/type_aligned.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <ctime>
+#include <cstdio>
+#include <vector>
+#include <cmath>
+
+namespace log2_
+{
+ int test()
+ {
+ int Error = 0;
+
+ int A0 = static_cast<int>(glm::log2(16.f));
+ glm::ivec1 B0(glm::log2(glm::vec1(16.f)));
+ glm::ivec2 C0(glm::log2(glm::vec2(16.f)));
+ glm::ivec3 D0(glm::log2(glm::vec3(16.f)));
+ glm::ivec4 E0(glm::log2(glm::vec4(16.f)));
+
+ int A1 = glm::log2(int(16));
+ glm::ivec1 B1 = glm::log2(glm::ivec1(16));
+ glm::ivec2 C1 = glm::log2(glm::ivec2(16));
+ glm::ivec3 D1 = glm::log2(glm::ivec3(16));
+ glm::ivec4 E1 = glm::log2(glm::ivec4(16));
+
+ Error += A0 == A1 ? 0 : 1;
+ Error += glm::all(glm::equal(B0, B1)) ? 0 : 1;
+ Error += glm::all(glm::equal(C0, C1)) ? 0 : 1;
+ Error += glm::all(glm::equal(D0, D1)) ? 0 : 1;
+ Error += glm::all(glm::equal(E0, E1)) ? 0 : 1;
+
+ glm::uint64 A2 = glm::log2(glm::uint64(16));
+ glm::u64vec1 B2 = glm::log2(glm::u64vec1(16));
+ glm::u64vec2 C2 = glm::log2(glm::u64vec2(16));
+ glm::u64vec3 D2 = glm::log2(glm::u64vec3(16));
+ glm::u64vec4 E2 = glm::log2(glm::u64vec4(16));
+
+ Error += A2 == glm::uint64(4) ? 0 : 1;
+ Error += glm::all(glm::equal(B2, glm::u64vec1(4))) ? 0 : 1;
+ Error += glm::all(glm::equal(C2, glm::u64vec2(4))) ? 0 : 1;
+ Error += glm::all(glm::equal(D2, glm::u64vec3(4))) ? 0 : 1;
+ Error += glm::all(glm::equal(E2, glm::u64vec4(4))) ? 0 : 1;
+
+ return Error;
+ }
+
+ int perf(std::size_t Count)
+ {
+ int Error = 0;
+
+ {
+ std::vector<int> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(int i = 0; i < static_cast<int>(Count); ++i)
+ Result[i] = glm::log2(static_cast<int>(i));
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<int>: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+ {
+ std::vector<glm::ivec4> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(int i = 0; i < static_cast<int>(Count); ++i)
+ Result[i] = glm::log2(glm::ivec4(i));
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<ivec4>: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+# if GLM_HAS_BITSCAN_WINDOWS
+ {
+ std::vector<glm::ivec4> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ glm::vec<4, unsigned long, glm::defaultp> Tmp;
+ _BitScanReverse(&Tmp.x, i);
+ _BitScanReverse(&Tmp.y, i);
+ _BitScanReverse(&Tmp.z, i);
+ _BitScanReverse(&Tmp.w, i);
+ Result[i] = glm::ivec4(Tmp);
+ }
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<ivec4> inlined: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+
+ {
+ std::vector<glm::vec<4, unsigned long, glm::defaultp> > Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ _BitScanReverse(&Result[i].x, i);
+ _BitScanReverse(&Result[i].y, i);
+ _BitScanReverse(&Result[i].z, i);
+ _BitScanReverse(&Result[i].w, i);
+ }
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<ivec4> inlined no cast: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+
+ {
+ std::vector<glm::ivec4> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ {
+ _BitScanReverse(reinterpret_cast<unsigned long*>(&Result[i].x), i);
+ _BitScanReverse(reinterpret_cast<unsigned long*>(&Result[i].y), i);
+ _BitScanReverse(reinterpret_cast<unsigned long*>(&Result[i].z), i);
+ _BitScanReverse(reinterpret_cast<unsigned long*>(&Result[i].w), i);
+ }
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<ivec4> reinterpret: %d clocks\n", static_cast<int>(End - Begin));
+ }
+# endif//GLM_HAS_BITSCAN_WINDOWS
+
+ {
+ std::vector<float> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(std::size_t i = 0; i < Count; ++i)
+ Result[i] = glm::log2(static_cast<float>(i));
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<float>: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+ {
+ std::vector<glm::vec4> Result;
+ Result.resize(Count);
+
+ std::clock_t Begin = clock();
+
+ for(int i = 0; i < static_cast<int>(Count); ++i)
+ Result[i] = glm::log2(glm::vec4(static_cast<float>(i)));
+
+ std::clock_t End = clock();
+
+ std::printf("glm::log2<vec4>: %d clocks\n", static_cast<int>(End - Begin));
+ }
+
+ return Error;
+ }
+}//namespace log2_
+
+namespace iround
+{
+ int test()
+ {
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::iround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+ }
+}//namespace iround
+
+namespace uround
+{
+ int test()
+ {
+ int Error = 0;
+
+ for(float f = 0.0f; f < 3.1f; f += 0.05f)
+ {
+ int RoundFast = static_cast<int>(glm::uround(f));
+ int RoundSTD = static_cast<int>(glm::round(f));
+ Error += RoundFast == RoundSTD ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+ }
+}//namespace uround
+
+int main()
+{
+ int Error(0);
+
+ Error += ::log2_::test();
+ Error += ::iround::test();
+ Error += ::uround::test();
+
+# ifdef NDEBUG
+ std::size_t const Samples(1000);
+ Error += ::log2_::perf(Samples);
+# endif//NDEBUG
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp
new file mode 100644
index 0000000..1b966e2
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp
@@ -0,0 +1,383 @@
+#include <glm/ext/vector_relational.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/matrix_access.hpp>
+#include <glm/mat2x2.hpp>
+#include <glm/mat2x3.hpp>
+#include <glm/mat2x4.hpp>
+#include <glm/mat3x2.hpp>
+#include <glm/mat3x3.hpp>
+#include <glm/mat3x4.hpp>
+#include <glm/mat4x2.hpp>
+#include <glm/mat4x3.hpp>
+#include <glm/mat4x4.hpp>
+
+int test_mat2x2_row_set()
+{
+ int Error = 0;
+
+ glm::mat2x2 m(1);
+
+ m = glm::row(m, 0, glm::vec2( 0, 1));
+ m = glm::row(m, 1, glm::vec2( 4, 5));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat2x2_col_set()
+{
+ int Error = 0;
+
+ glm::mat2x2 m(1);
+
+ m = glm::column(m, 0, glm::vec2( 0, 1));
+ m = glm::column(m, 1, glm::vec2( 4, 5));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat2x3_row_set()
+{
+ int Error = 0;
+
+ glm::mat2x3 m(1);
+
+ m = glm::row(m, 0, glm::vec2( 0, 1));
+ m = glm::row(m, 1, glm::vec2( 4, 5));
+ m = glm::row(m, 2, glm::vec2( 8, 9));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat2x3_col_set()
+{
+ int Error = 0;
+
+ glm::mat2x3 m(1);
+
+ m = glm::column(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::column(m, 1, glm::vec3( 4, 5, 6));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat2x4_row_set()
+{
+ int Error = 0;
+
+ glm::mat2x4 m(1);
+
+ m = glm::row(m, 0, glm::vec2( 0, 1));
+ m = glm::row(m, 1, glm::vec2( 4, 5));
+ m = glm::row(m, 2, glm::vec2( 8, 9));
+ m = glm::row(m, 3, glm::vec2(12, 13));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 3), glm::vec2(12, 13), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat2x4_col_set()
+{
+ int Error = 0;
+
+ glm::mat2x4 m(1);
+
+ m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x2_row_set()
+{
+ int Error = 0;
+
+ glm::mat3x2 m(1);
+
+ m = glm::row(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::row(m, 1, glm::vec3( 4, 5, 6));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x2_col_set()
+{
+ int Error = 0;
+
+ glm::mat3x2 m(1);
+
+ m = glm::column(m, 0, glm::vec2( 0, 1));
+ m = glm::column(m, 1, glm::vec2( 4, 5));
+ m = glm::column(m, 2, glm::vec2( 8, 9));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x3_row_set()
+{
+ int Error = 0;
+
+ glm::mat3x3 m(1);
+
+ m = glm::row(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::row(m, 1, glm::vec3( 4, 5, 6));
+ m = glm::row(m, 2, glm::vec3( 8, 9, 10));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x3_col_set()
+{
+ int Error = 0;
+
+ glm::mat3x3 m(1);
+
+ m = glm::column(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::column(m, 1, glm::vec3( 4, 5, 6));
+ m = glm::column(m, 2, glm::vec3( 8, 9, 10));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x4_row_set()
+{
+ int Error = 0;
+
+ glm::mat3x4 m(1);
+
+ m = glm::row(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::row(m, 1, glm::vec3( 4, 5, 6));
+ m = glm::row(m, 2, glm::vec3( 8, 9, 10));
+ m = glm::row(m, 3, glm::vec3(12, 13, 14));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 3), glm::vec3(12, 13, 14), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat3x4_col_set()
+{
+ int Error = 0;
+
+ glm::mat3x4 m(1);
+
+ m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
+ m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x2_row_set()
+{
+ int Error = 0;
+
+ glm::mat4x2 m(1);
+
+ m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x2_col_set()
+{
+ int Error = 0;
+
+ glm::mat4x2 m(1);
+
+ m = glm::column(m, 0, glm::vec2( 0, 1));
+ m = glm::column(m, 1, glm::vec2( 4, 5));
+ m = glm::column(m, 2, glm::vec2( 8, 9));
+ m = glm::column(m, 3, glm::vec2(12, 13));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 3), glm::vec2(12, 13), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x3_row_set()
+{
+ int Error = 0;
+
+ glm::mat4x3 m(1);
+
+ m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
+ m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x3_col_set()
+{
+ int Error = 0;
+
+ glm::mat4x3 m(1);
+
+ m = glm::column(m, 0, glm::vec3( 0, 1, 2));
+ m = glm::column(m, 1, glm::vec3( 4, 5, 6));
+ m = glm::column(m, 2, glm::vec3( 8, 9, 10));
+ m = glm::column(m, 3, glm::vec3(12, 13, 14));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 3), glm::vec3(12, 13, 14), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x4_row_set()
+{
+ int Error = 0;
+
+ glm::mat4 m(1);
+
+ m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7));
+ m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11));
+ m = glm::row(m, 3, glm::vec4(12, 13, 14, 15));
+
+ Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::row(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x4_col_set()
+{
+ int Error = 0;
+
+ glm::mat4 m(1);
+
+ m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3));
+ m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7));
+ m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11));
+ m = glm::column(m, 3, glm::vec4(12, 13, 14, 15));
+
+ Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(glm::column(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x4_row_get()
+{
+ int Error = 0;
+
+ glm::mat4 m(1);
+
+ glm::vec4 A = glm::row(m, 0);
+ Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 B = glm::row(m, 1);
+ Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 C = glm::row(m, 2);
+ Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 D = glm::row(m, 3);
+ Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int test_mat4x4_col_get()
+{
+ int Error = 0;
+
+ glm::mat4 m(1);
+
+ glm::vec4 A = glm::column(m, 0);
+ Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 B = glm::column(m, 1);
+ Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 C = glm::column(m, 2);
+ Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon<float>())) ? 0 : 1;
+ glm::vec4 D = glm::column(m, 3);
+ Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_mat2x2_row_set();
+ Error += test_mat2x2_col_set();
+ Error += test_mat2x3_row_set();
+ Error += test_mat2x3_col_set();
+ Error += test_mat2x4_row_set();
+ Error += test_mat2x4_col_set();
+ Error += test_mat3x2_row_set();
+ Error += test_mat3x2_col_set();
+ Error += test_mat3x3_row_set();
+ Error += test_mat3x3_col_set();
+ Error += test_mat3x4_row_set();
+ Error += test_mat3x4_col_set();
+ Error += test_mat4x2_row_set();
+ Error += test_mat4x2_col_set();
+ Error += test_mat4x3_row_set();
+ Error += test_mat4x3_col_set();
+ Error += test_mat4x4_row_set();
+ Error += test_mat4x4_col_set();
+
+ Error += test_mat4x4_row_get();
+ Error += test_mat4x4_col_get();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp
new file mode 100644
index 0000000..108016a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp
@@ -0,0 +1,8 @@
+#include <glm/gtc/matrix_integer.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp
new file mode 100644
index 0000000..eaec6e1
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp
@@ -0,0 +1,51 @@
+#include <glm/gtc/matrix_inverse.hpp>
+#include <glm/gtc/epsilon.hpp>
+
+int test_affine()
+{
+ int Error = 0;
+
+ {
+ glm::mat3 const M(
+ 2.f, 0.f, 0.f,
+ 0.f, 2.f, 0.f,
+ 0.f, 0.f, 1.f);
+ glm::mat3 const A = glm::affineInverse(M);
+ glm::mat3 const I = glm::inverse(M);
+ glm::mat3 const R = glm::affineInverse(A);
+
+ for(glm::length_t i = 0; i < A.length(); ++i)
+ {
+ Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1;
+ }
+ }
+
+ {
+ glm::mat4 const M(
+ 2.f, 0.f, 0.f, 0.f,
+ 0.f, 2.f, 0.f, 0.f,
+ 0.f, 0.f, 2.f, 0.f,
+ 0.f, 0.f, 0.f, 1.f);
+ glm::mat4 const A = glm::affineInverse(M);
+ glm::mat4 const I = glm::inverse(M);
+ glm::mat4 const R = glm::affineInverse(A);
+
+ for(glm::length_t i = 0; i < A.length(); ++i)
+ {
+ Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1;
+ }
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_affine();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp
new file mode 100644
index 0000000..b50666e
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp
@@ -0,0 +1,55 @@
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/matrix_relational.hpp>
+
+int test_perspective()
+{
+ int Error = 0;
+
+ glm::mat4 Projection = glm::perspective(glm::pi<float>() * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f);
+
+ return Error;
+}
+
+int test_pick()
+{
+ int Error = 0;
+
+ glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240));
+
+ return Error;
+}
+
+int test_tweakedInfinitePerspective()
+{
+ int Error = 0;
+
+ glm::mat4 ProjectionA = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f);
+ glm::mat4 ProjectionB = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f, 0.001f);
+
+
+ return Error;
+}
+
+int test_translate()
+{
+ int Error = 0;
+
+ glm::lowp_vec3 v(1.0);
+ glm::lowp_mat4 m(0);
+ glm::lowp_mat4 t = glm::translate(m, v);
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_translate();
+ Error += test_tweakedInfinitePerspective();
+ Error += test_pick();
+ Error += test_perspective();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_noise.cpp b/3rdparty/glm/source/test/gtc/gtc_noise.cpp
new file mode 100644
index 0000000..6ecec22
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_noise.cpp
@@ -0,0 +1,86 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/noise.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/raw_data.hpp>
+
+static int test_simplex_float()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::vec2(0.f, 0.f))) * 255.f));
+ glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::vec3(0.f, 0.f, 0.f))) * 255.f));
+ glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f));
+
+ return Error;
+}
+
+static int test_simplex_double()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::dvec2(0.f, 0.f))) * 255.));
+ glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::dvec3(0.f, 0.f, 0.f))) * 255.));
+ glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.));
+
+ return Error;
+}
+
+static int test_perlin_float()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f))) * 255.f));
+ glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f))) * 255.f));
+ glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f));
+
+ return Error;
+}
+
+static int test_perlin_double()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f))) * 255.));
+ glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f))) * 255.));
+ glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.));
+
+ return Error;
+}
+
+static int test_perlin_pedioric_float()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f), glm::vec2(2.0f))) * 255.f));
+ glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f), glm::vec3(2.0f))) * 255.f));
+ glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f), glm::vec4(2.0f))) * 255.f));
+
+ return Error;
+}
+
+static int test_perlin_pedioric_double()
+{
+ int Error = 0;
+
+ glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f), glm::dvec2(2.0))) * 255.));
+ glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f), glm::dvec3(2.0))) * 255.));
+ glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f), glm::dvec4(2.0))) * 255.));
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_simplex_float();
+ Error += test_simplex_double();
+
+ Error += test_perlin_float();
+ Error += test_perlin_double();
+
+ Error += test_perlin_pedioric_float();
+ Error += test_perlin_pedioric_double();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_packing.cpp b/3rdparty/glm/source/test/gtc/gtc_packing.cpp
new file mode 100644
index 0000000..df5b3bb
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_packing.cpp
@@ -0,0 +1,878 @@
+#include <glm/packing.hpp>
+#include <glm/gtc/packing.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <cstdio>
+#include <vector>
+
+void print_bits(float const& s)
+{
+ union
+ {
+ float f;
+ unsigned int i;
+ } uif;
+
+ uif.f = s;
+
+ std::printf("f32: ");
+ for(std::size_t j = sizeof(s) * 8; j > 0; --j)
+ {
+ if(j == 23 || j == 31)
+ std::printf(" ");
+ std::printf("%d", (uif.i & (1 << (j - 1))) ? 1 : 0);
+ }
+}
+
+void print_10bits(glm::uint const& s)
+{
+ std::printf("10b: ");
+ for(std::size_t j = 10; j > 0; --j)
+ {
+ if(j == 5)
+ std::printf(" ");
+ std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0);
+ }
+}
+
+void print_11bits(glm::uint const& s)
+{
+ std::printf("11b: ");
+ for(std::size_t j = 11; j > 0; --j)
+ {
+ if(j == 6)
+ std::printf(" ");
+ std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0);
+ }
+}
+
+void print_value(float const& s)
+{
+ std::printf("%2.5f, ", static_cast<double>(s));
+ print_bits(s);
+ std::printf(", ");
+// print_11bits(detail::floatTo11bit(s));
+// std::printf(", ");
+// print_10bits(detail::floatTo10bit(s));
+ std::printf("\n");
+}
+
+int test_Half1x16()
+{
+ int Error = 0;
+
+ std::vector<float> Tests;
+ Tests.push_back(0.0f);
+ Tests.push_back(1.0f);
+ Tests.push_back(-1.0f);
+ Tests.push_back(2.0f);
+ Tests.push_back(-2.0f);
+ Tests.push_back(1.9f);
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint16 p0 = glm::packHalf1x16(Tests[i]);
+ float v0 = glm::unpackHalf1x16(p0);
+ glm::uint16 p1 = glm::packHalf1x16(v0);
+ float v1 = glm::unpackHalf1x16(p1);
+ Error += glm::epsilonEqual(v0, v1, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_Half4x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> Tests;
+ Tests.push_back(glm::vec4(1.0f));
+ Tests.push_back(glm::vec4(0.0f));
+ Tests.push_back(glm::vec4(2.0f));
+ Tests.push_back(glm::vec4(0.1f));
+ Tests.push_back(glm::vec4(0.5f));
+ Tests.push_back(glm::vec4(-0.9f));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint64 p0 = glm::packHalf4x16(Tests[i]);
+ glm::vec4 v0 = glm::unpackHalf4x16(p0);
+ glm::uint64 p1 = glm::packHalf4x16(v0);
+ glm::vec4 v1 = glm::unpackHalf4x16(p1);
+ glm::u16vec4 p2 = glm::packHalf(v0);
+ glm::vec4 v2 = glm::unpackHalf(p2);
+
+ Error += glm::all(glm::equal(v0, v1, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v0, v2, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_I3x10_1x2()
+{
+ int Error = 0;
+
+ std::vector<glm::ivec4> Tests;
+ Tests.push_back(glm::ivec4(0));
+ Tests.push_back(glm::ivec4(1));
+ Tests.push_back(glm::ivec4(-1));
+ Tests.push_back(glm::ivec4(2));
+ Tests.push_back(glm::ivec4(-2));
+ Tests.push_back(glm::ivec4(3));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packI3x10_1x2(Tests[i]);
+ glm::ivec4 v0 = glm::unpackI3x10_1x2(p0);
+ glm::uint32 p1 = glm::packI3x10_1x2(v0);
+ glm::ivec4 v1 = glm::unpackI3x10_1x2(p1);
+ Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_U3x10_1x2()
+{
+ int Error = 0;
+
+ std::vector<glm::uvec4> Tests;
+ Tests.push_back(glm::uvec4(0));
+ Tests.push_back(glm::uvec4(1));
+ Tests.push_back(glm::uvec4(2));
+ Tests.push_back(glm::uvec4(3));
+ Tests.push_back(glm::uvec4(4));
+ Tests.push_back(glm::uvec4(5));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packU3x10_1x2(Tests[i]);
+ glm::uvec4 v0 = glm::unpackU3x10_1x2(p0);
+ glm::uint32 p1 = glm::packU3x10_1x2(v0);
+ glm::uvec4 v1 = glm::unpackU3x10_1x2(p1);
+ Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
+ }
+
+ glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
+ glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
+ glm::uint32 const r0 = 0x330077ff;
+
+ Error += p0 == r0 ? 0 : 1;
+
+ glm::uvec4 const v1(0xff, 0x77, 0x0, 0x33);
+ glm::uint32 const p1 = glm::packU3x10_1x2(v1);
+ glm::uint32 const r1 = 0xc001dcff;
+
+ Error += p1 == r1 ? 0 : 1;
+
+ return Error;
+}
+
+int test_Snorm3x10_1x2()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> Tests;
+ Tests.push_back(glm::vec4(1.0f));
+ Tests.push_back(glm::vec4(0.0f));
+ Tests.push_back(glm::vec4(2.0f));
+ Tests.push_back(glm::vec4(0.1f));
+ Tests.push_back(glm::vec4(0.5f));
+ Tests.push_back(glm::vec4(0.9f));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packSnorm3x10_1x2(Tests[i]);
+ glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0);
+ glm::uint32 p1 = glm::packSnorm3x10_1x2(v0);
+ glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1);
+
+ Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_Unorm3x10_1x2()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> Tests;
+ Tests.push_back(glm::vec4(1.0f));
+ Tests.push_back(glm::vec4(0.0f));
+ Tests.push_back(glm::vec4(2.0f));
+ Tests.push_back(glm::vec4(0.1f));
+ Tests.push_back(glm::vec4(0.5f));
+ Tests.push_back(glm::vec4(0.9f));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packUnorm3x10_1x2(Tests[i]);
+ glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0);
+ glm::uint32 p1 = glm::packUnorm3x10_1x2(v0);
+ glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1);
+
+ Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_F2x11_1x10()
+{
+ int Error = 0;
+
+ std::vector<glm::vec3> Tests;
+ Tests.push_back(glm::vec3(1.0f));
+ Tests.push_back(glm::vec3(0.0f));
+ Tests.push_back(glm::vec3(2.0f));
+ Tests.push_back(glm::vec3(0.1f));
+ Tests.push_back(glm::vec3(0.5f));
+ Tests.push_back(glm::vec3(0.9f));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packF2x11_1x10(Tests[i]);
+ glm::vec3 v0 = glm::unpackF2x11_1x10(p0);
+ glm::uint32 p1 = glm::packF2x11_1x10(v0);
+ glm::vec3 v1 = glm::unpackF2x11_1x10(p1);
+ Error += glm::all(glm::equal(v0, v1, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_F3x9_E1x5()
+{
+ int Error = 0;
+
+ std::vector<glm::vec3> Tests;
+ Tests.push_back(glm::vec3(1.0f));
+ Tests.push_back(glm::vec3(0.0f));
+ Tests.push_back(glm::vec3(2.0f));
+ Tests.push_back(glm::vec3(0.1f));
+ Tests.push_back(glm::vec3(0.5f));
+ Tests.push_back(glm::vec3(0.9f));
+
+ for(std::size_t i = 0; i < Tests.size(); ++i)
+ {
+ glm::uint32 p0 = glm::packF3x9_E1x5(Tests[i]);
+ glm::vec3 v0 = glm::unpackF3x9_E1x5(p0);
+ glm::uint32 p1 = glm::packF3x9_E1x5(v0);
+ glm::vec3 v1 = glm::unpackF3x9_E1x5(p1);
+ Error += glm::all(glm::equal(v0, v1, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_RGBM()
+{
+ int Error = 0;
+
+ for(std::size_t i = 0; i < 1024; ++i)
+ {
+ glm::vec3 const Color(static_cast<float>(i));
+ glm::vec4 const RGBM = glm::packRGBM(Color);
+ glm::vec3 const Result= glm::unpackRGBM(RGBM);
+
+ Error += glm::all(glm::equal(Color, Result, 0.01f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_packUnorm1x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec1> A;
+ A.push_back(glm::vec1(1.0f));
+ A.push_back(glm::vec1(0.5f));
+ A.push_back(glm::vec1(0.1f));
+ A.push_back(glm::vec1(0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec1 B(A[i]);
+ glm::uint16 C = glm::packUnorm1x16(B.x);
+ glm::vec1 D(glm::unpackUnorm1x16(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm1x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec1> A;
+ A.push_back(glm::vec1( 1.0f));
+ A.push_back(glm::vec1( 0.0f));
+ A.push_back(glm::vec1(-0.5f));
+ A.push_back(glm::vec1(-0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec1 B(A[i]);
+ glm::uint16 C = glm::packSnorm1x16(B.x);
+ glm::vec1 D(glm::unpackSnorm1x16(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_packUnorm2x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.0f));
+ A.push_back(glm::vec2(0.5f, 0.7f));
+ A.push_back(glm::vec2(0.1f, 0.2f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint32 C = glm::packUnorm2x16(B);
+ glm::vec2 D = glm::unpackUnorm2x16(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm2x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2( 1.0f, 0.0f));
+ A.push_back(glm::vec2(-0.5f,-0.7f));
+ A.push_back(glm::vec2(-0.1f, 0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint32 C = glm::packSnorm2x16(B);
+ glm::vec2 D = glm::unpackSnorm2x16(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm4x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4(1.0f));
+ A.push_back(glm::vec4(0.5f));
+ A.push_back(glm::vec4(0.1f));
+ A.push_back(glm::vec4(0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint64 C = glm::packUnorm4x16(B);
+ glm::vec4 D(glm::unpackUnorm4x16(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm4x16()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4( 1.0f, 0.0f, -0.5f, 0.5f));
+ A.push_back(glm::vec4(-0.3f,-0.7f, 0.3f, 0.7f));
+ A.push_back(glm::vec4(-0.1f, 0.1f, -0.2f, 0.2f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint64 C = glm::packSnorm4x16(B);
+ glm::vec4 D(glm::unpackSnorm4x16(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm1x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec1> A;
+ A.push_back(glm::vec1(1.0f));
+ A.push_back(glm::vec1(0.5f));
+ A.push_back(glm::vec1(0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec1 B(A[i]);
+ glm::uint8 C = glm::packUnorm1x8(B.x);
+ glm::vec1 D(glm::unpackUnorm1x8(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm1x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec1> A;
+ A.push_back(glm::vec1( 1.0f));
+ A.push_back(glm::vec1(-0.7f));
+ A.push_back(glm::vec1(-1.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec1 B(A[i]);
+ glm::uint8 C = glm::packSnorm1x8(B.x);
+ glm::vec1 D(glm::unpackSnorm1x8(C));
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_packUnorm2x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.7f));
+ A.push_back(glm::vec2(0.5f, 0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint16 C = glm::packUnorm2x8(B);
+ glm::vec2 D = glm::unpackUnorm2x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm2x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2( 1.0f, 0.0f));
+ A.push_back(glm::vec2(-0.7f,-0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint16 C = glm::packSnorm2x8(B);
+ glm::vec2 D = glm::unpackSnorm2x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_packUnorm4x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f));
+ A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint32 C = glm::packUnorm4x8(B);
+ glm::vec4 D = glm::unpackUnorm4x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm4x8()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f));
+ A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint32 C = glm::packSnorm4x8(B);
+ glm::vec4 D = glm::unpackSnorm4x8(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.7f));
+ A.push_back(glm::vec2(0.5f, 0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::u16vec2 C = glm::packUnorm<glm::uint16>(B);
+ glm::vec2 D = glm::unpackUnorm<float>(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packSnorm()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2( 1.0f, 0.0f));
+ A.push_back(glm::vec2(-0.5f,-0.7f));
+ A.push_back(glm::vec2(-0.1f, 0.1f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::i16vec2 C = glm::packSnorm<glm::int16>(B);
+ glm::vec2 D = glm::unpackSnorm<float>(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm2x4()
+{
+ int Error = 0;
+
+ std::vector<glm::vec2> A;
+ A.push_back(glm::vec2(1.0f, 0.7f));
+ A.push_back(glm::vec2(0.5f, 0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec2 B(A[i]);
+ glm::uint8 C = glm::packUnorm2x4(B);
+ glm::vec2 D = glm::unpackUnorm2x4(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm4x4()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f));
+ A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint16 C = glm::packUnorm4x4(B);
+ glm::vec4 D = glm::unpackUnorm4x4(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm3x5_1x1()
+{
+ int Error = 0;
+
+ std::vector<glm::vec4> A;
+ A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f));
+ A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec4 B(A[i]);
+ glm::uint16 C = glm::packUnorm3x5_1x1(B);
+ glm::vec4 D = glm::unpackUnorm3x5_1x1(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm1x5_1x6_1x5()
+{
+ int Error = 0;
+
+ std::vector<glm::vec3> A;
+ A.push_back(glm::vec3(1.0f, 0.7f, 0.5f));
+ A.push_back(glm::vec3(0.5f, 0.1f, 0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec3 B(A[i]);
+ glm::uint16 C = glm::packUnorm1x5_1x6_1x5(B);
+ glm::vec3 D = glm::unpackUnorm1x5_1x6_1x5(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUnorm2x3_1x2()
+{
+ int Error = 0;
+
+ std::vector<glm::vec3> A;
+ A.push_back(glm::vec3(1.0f, 0.7f, 0.5f));
+ A.push_back(glm::vec3(0.5f, 0.1f, 0.0f));
+
+ for(std::size_t i = 0; i < A.size(); ++i)
+ {
+ glm::vec3 B(A[i]);
+ glm::uint8 C = glm::packUnorm2x3_1x2(B);
+ glm::vec3 D = glm::unpackUnorm2x3_1x2(C);
+ Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 3.f)) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_packUint2x8()
+{
+ int Error = 0;
+
+ glm::u8vec2 const Source(1, 2);
+
+ glm::uint16 const Packed = glm::packUint2x8(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::u8vec2 const Unpacked = glm::unpackUint2x8(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packUint4x8()
+{
+ int Error = 0;
+
+ glm::u8vec4 const Source(1, 2, 3, 4);
+
+ glm::uint32 const Packed = glm::packUint4x8(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::u8vec4 const Unpacked = glm::unpackUint4x8(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packUint2x16()
+{
+ int Error = 0;
+
+ glm::u16vec2 const Source(1, 2);
+
+ glm::uint32 const Packed = glm::packUint2x16(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::u16vec2 const Unpacked = glm::unpackUint2x16(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packUint4x16()
+{
+ int Error = 0;
+
+ glm::u16vec4 const Source(1, 2, 3, 4);
+
+ glm::uint64 const Packed = glm::packUint4x16(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::u16vec4 const Unpacked = glm::unpackUint4x16(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packUint2x32()
+{
+ int Error = 0;
+
+ glm::u32vec2 const Source(1, 2);
+
+ glm::uint64 const Packed = glm::packUint2x32(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::u32vec2 const Unpacked = glm::unpackUint2x32(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packInt2x8()
+{
+ int Error = 0;
+
+ glm::i8vec2 const Source(1, 2);
+
+ glm::int16 const Packed = glm::packInt2x8(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::i8vec2 const Unpacked = glm::unpackInt2x8(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packInt4x8()
+{
+ int Error = 0;
+
+ glm::i8vec4 const Source(1, 2, 3, 4);
+
+ glm::int32 const Packed = glm::packInt4x8(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::i8vec4 const Unpacked = glm::unpackInt4x8(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packInt2x16()
+{
+ int Error = 0;
+
+ glm::i16vec2 const Source(1, 2);
+
+ glm::int32 const Packed = glm::packInt2x16(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::i16vec2 const Unpacked = glm::unpackInt2x16(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packInt4x16()
+{
+ int Error = 0;
+
+ glm::i16vec4 const Source(1, 2, 3, 4);
+
+ glm::int64 const Packed = glm::packInt4x16(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::i16vec4 const Unpacked = glm::unpackInt4x16(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int test_packInt2x32()
+{
+ int Error = 0;
+
+ glm::i32vec2 const Source(1, 2);
+
+ glm::int64 const Packed = glm::packInt2x32(Source);
+ Error += Packed != 0 ? 0 : 1;
+
+ glm::i32vec2 const Unpacked = glm::unpackInt2x32(Packed);
+ Error += Source == Unpacked ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_packUnorm();
+ Error += test_packSnorm();
+
+ Error += test_packSnorm1x16();
+ Error += test_packSnorm2x16();
+ Error += test_packSnorm4x16();
+
+ Error += test_packSnorm1x8();
+ Error += test_packSnorm2x8();
+ Error += test_packSnorm4x8();
+
+ Error += test_packUnorm1x16();
+ Error += test_packUnorm2x16();
+ Error += test_packUnorm4x16();
+
+ Error += test_packUnorm1x8();
+ Error += test_packUnorm2x8();
+ Error += test_packUnorm4x8();
+
+ Error += test_packUnorm2x4();
+ Error += test_packUnorm4x4();
+ Error += test_packUnorm3x5_1x1();
+ Error += test_packUnorm1x5_1x6_1x5();
+ Error += test_packUnorm2x3_1x2();
+
+ Error += test_packUint2x8();
+ Error += test_packUint4x8();
+ Error += test_packUint2x16();
+ Error += test_packUint4x16();
+ Error += test_packUint2x32();
+
+ Error += test_packInt2x8();
+ Error += test_packInt4x8();
+ Error += test_packInt2x16();
+ Error += test_packInt4x16();
+ Error += test_packInt2x32();
+
+ Error += test_F2x11_1x10();
+ Error += test_F3x9_E1x5();
+ Error += test_RGBM();
+ Error += test_Unorm3x10_1x2();
+ Error += test_Snorm3x10_1x2();
+
+ Error += test_I3x10_1x2();
+ Error += test_U3x10_1x2();
+ Error += test_Half1x16();
+ Error += test_Half4x16();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp b/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp
new file mode 100644
index 0000000..540ca42
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp
@@ -0,0 +1,345 @@
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/glm.hpp>
+#include <vector>
+
+int test_quat_angle()
+{
+ int Error = 0;
+
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1;
+ float A = glm::angle(N);
+ Error += glm::equal(A, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ }
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::normalize(glm::vec3(0, 1, 1)));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1;
+ float A = glm::angle(N);
+ Error += glm::equal(A, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ }
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::normalize(glm::vec3(1, 2, 3)));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1;
+ float A = glm::angle(N);
+ Error += glm::equal(A, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_quat_angleAxis()
+{
+ int Error = 0;
+
+ glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f));
+ glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::quat C = glm::mix(A, B, 0.5f);
+ glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+
+ Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_quat_mix()
+{
+ int Error = 0;
+
+ glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f));
+ glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::quat C = glm::mix(A, B, 0.5f);
+ glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+
+ Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1;
+ Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_quat_normalize()
+{
+ int Error(0);
+
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1;
+ }
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 2));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1;
+ }
+ {
+ glm::quat Q = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(1, 2, 3));
+ glm::quat N = glm::normalize(Q);
+ float L = glm::length(N);
+ Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_quat_euler()
+{
+ int Error = 0;
+
+ {
+ glm::quat q(1.0f, 0.0f, 0.0f, 1.0f);
+ float Roll = glm::roll(q);
+ float Pitch = glm::pitch(q);
+ float Yaw = glm::yaw(q);
+ glm::vec3 Angles = glm::eulerAngles(q);
+ Error += glm::all(glm::equal(Angles, glm::vec3(Pitch, Yaw, Roll), 0.000001f)) ? 0 : 1;
+ }
+
+ {
+ glm::dquat q(1.0, 0.0, 0.0, 1.0);
+ double Roll = glm::roll(q);
+ double Pitch = glm::pitch(q);
+ double Yaw = glm::yaw(q);
+ glm::dvec3 Angles = glm::eulerAngles(q);
+ Error += glm::all(glm::equal(Angles, glm::dvec3(Pitch, Yaw, Roll), 0.000001)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_quat_slerp()
+{
+ int Error = 0;
+
+ float const Epsilon = 0.0001f;//glm::epsilon<float>();
+
+ float sqrt2 = std::sqrt(2.0f)/2.0f;
+ glm::quat id(static_cast<float>(1), static_cast<float>(0), static_cast<float>(0), static_cast<float>(0));
+ glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f);
+ glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f);
+
+ // Testing a == 0
+ // Must be id
+ glm::quat id2 = glm::slerp(id, Y90rot, 0.0f);
+ Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1;
+
+ // Testing a == 1
+ // Must be 90� rotation on Y : 0 0.7 0 0.7
+ glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f);
+ Error += glm::all(glm::equal(Y90rot, Y90rot2, Epsilon)) ? 0 : 1;
+
+ // Testing standard, easy case
+ // Must be 45� rotation on Y : 0 0.38 0 0.92
+ glm::quat Y45rot1 = glm::slerp(id, Y90rot, 0.5f);
+
+ // Testing reverse case
+ // Must be 45� rotation on Y : 0 0.38 0 0.92
+ glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.5f);
+
+ // Testing against full circle around the sphere instead of shortest path
+ // Must be 45� rotation on Y
+ // certainly not a 135� rotation
+ glm::quat Y45rot3 = glm::slerp(id , -Y90rot, 0.5f);
+ float Y45angle3 = glm::angle(Y45rot3);
+ Error += glm::equal(Y45angle3, glm::pi<float>() * 0.25f, Epsilon) ? 0 : 1;
+ Error += glm::all(glm::equal(Ym45rot2, Y45rot3, Epsilon)) ? 0 : 1;
+
+ // Same, but inverted
+ // Must also be 45� rotation on Y : 0 0.38 0 0.92
+ // -0 -0.38 -0 -0.92 is ok too
+ glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f);
+ Error += glm::all(glm::equal(Ym45rot2, -Y45rot4, Epsilon)) ? 0 : 1;
+
+ // Testing q1 = q2
+ // Must be 90� rotation on Y : 0 0.7 0 0.7
+ glm::quat Y90rot3 = glm::slerp(Y90rot, Y90rot, 0.5f);
+ Error += glm::all(glm::equal(Y90rot, Y90rot3, Epsilon)) ? 0 : 1;
+
+ // Testing 180� rotation
+ // Must be 90� rotation on almost any axis that is on the XZ plane
+ glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f);
+ float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78;
+ Error += glm::equal(XZ90angle, glm::pi<float>() * 0.25f, Epsilon) ? 0 : 1;
+
+ // Testing almost equal quaternions (this test should pass through the linear interpolation)
+ // Must be 0 0.00X 0 0.99999
+ glm::quat almostid = glm::slerp(id, glm::angleAxis(0.1f, glm::vec3(0.0f, 1.0f, 0.0f)), 0.5f);
+
+ // Testing quaternions with opposite sign
+ {
+ glm::quat a(-1, 0, 0, 0);
+
+ glm::quat result = glm::slerp(a, id, 0.5f);
+
+ Error += glm::equal(glm::pow(glm::dot(id, result), 2.f), 1.f, 0.01f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_quat_slerp_spins()
+{
+ int Error = 0;
+
+ float const Epsilon = 0.0001f;//glm::epsilon<float>();
+
+ float sqrt2 = std::sqrt(2.0f) / 2.0f;
+ glm::quat id(static_cast<float>(1), static_cast<float>(0), static_cast<float>(0), static_cast<float>(0));
+ glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f);
+ glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f);
+
+ // Testing a == 0, k == 1
+ // Must be id
+ glm::quat id2 = glm::slerp(id, id, 1.0f, 1);
+ Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1;
+
+ // Testing a == 1, k == 2
+ // Must be id
+ glm::quat id3 = glm::slerp(id, id, 1.0f, 2);
+ Error += glm::all(glm::equal(id, id3, Epsilon)) ? 0 : 1;
+
+ // Testing a == 1, k == 1
+ // Must be 90� rotation on Y : 0 0.7 0 0.7
+ // Negative quaternion is representing same orientation
+ glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f, 1);
+ Error += glm::all(glm::equal(Y90rot, -Y90rot2, Epsilon)) ? 0 : 1;
+
+ // Testing a == 1, k == 2
+ // Must be id
+ glm::quat Y90rot3 = glm::slerp(id, Y90rot, 8.0f / 9.0f, 2);
+ Error += glm::all(glm::equal(id, Y90rot3, Epsilon)) ? 0 : 1;
+
+ // Testing a == 1, k == 1
+ // Must be 90� rotation on Y : 0 0.7 0 0.7
+ glm::quat Y90rot4 = glm::slerp(id, Y90rot, 0.2f, 1);
+ Error += glm::all(glm::equal(Y90rot, Y90rot4, Epsilon)) ? 0 : 1;
+
+ // Testing reverse case
+ // Must be 45� rotation on Y : 0 0.38 0 0.92
+ // Negative quaternion is representing same orientation
+ glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.9f, 1);
+ glm::quat Ym45rot3 = glm::slerp(Y90rot, id, 0.5f);
+ Error += glm::all(glm::equal(-Ym45rot2, Ym45rot3, Epsilon)) ? 0 : 1;
+
+ // Testing against full circle around the sphere instead of shortest path
+ // Must be 45� rotation on Y
+ // certainly not a 135� rotation
+ glm::quat Y45rot3 = glm::slerp(id, -Y90rot, 0.5f, 0);
+ float Y45angle3 = glm::angle(Y45rot3);
+ Error += glm::equal(Y45angle3, glm::pi<float>() * 0.25f, Epsilon) ? 0 : 1;
+ Error += glm::all(glm::equal(Ym45rot3, Y45rot3, Epsilon)) ? 0 : 1;
+
+ // Same, but inverted
+ // Must also be 45� rotation on Y : 0 0.38 0 0.92
+ // -0 -0.38 -0 -0.92 is ok too
+ glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f, 0);
+ Error += glm::all(glm::equal(Ym45rot2, Y45rot4, Epsilon)) ? 0 : 1;
+
+ // Testing q1 = q2 k == 2
+ // Must be 90� rotation on Y : 0 0.7 0 0.7
+ glm::quat Y90rot5 = glm::slerp(Y90rot, Y90rot, 0.5f, 2);
+ Error += glm::all(glm::equal(Y90rot, Y90rot5, Epsilon)) ? 0 : 1;
+
+ // Testing 180� rotation
+ // Must be 90� rotation on almost any axis that is on the XZ plane
+ glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f, 1);
+ float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78;
+ Error += glm::equal(XZ90angle, glm::pi<float>() * 1.25f, Epsilon) ? 0 : 1;
+
+ // Testing rotation over long arc
+ // Distance from id to 90� is 270�, so 2/3 of it should be 180�
+ // Negative quaternion is representing same orientation
+ glm::quat Neg90rot = glm::slerp(id, Y90rot, 2.0f / 3.0f, -1);
+ Error += glm::all(glm::equal(Y180rot, -Neg90rot, Epsilon)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_quat_mul_vec()
+{
+ int Error(0);
+
+ glm::quat q = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::vec3 v(1, 0, 0);
+ glm::vec3 u(q * v);
+ glm::vec3 w(u * q);
+
+ Error += glm::all(glm::equal(v, w, 0.01f)) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_mul()
+{
+ int Error = 0;
+
+ glm::quat temp1 = glm::normalize(glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0)));
+ glm::quat temp2 = glm::normalize(glm::quat(0.5f, glm::vec3(1.0, 0.0, 0.0)));
+
+ glm::vec3 transformed0 = (temp1 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp1));
+ glm::vec3 temp4 = temp2 * transformed0 * glm::inverse(temp2);
+
+ glm::quat temp5 = glm::normalize(temp1 * temp2);
+ glm::vec3 temp6 = temp5 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp5);
+
+ glm::quat temp7(1.0f, glm::vec3(0.0, 1.0, 0.0));
+
+ temp7 *= temp5;
+ temp7 *= glm::inverse(temp5);
+
+ Error += glm::any(glm::notEqual(temp7, glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0)), glm::epsilon<float>())) ? 1 : 0;
+
+ return Error;
+}
+
+int test_identity()
+{
+ int Error = 0;
+
+ glm::quat const Q = glm::identity<glm::quat>();
+
+ Error += glm::all(glm::equal(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 0 : 1;
+ Error += glm::any(glm::notEqual(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 1 : 0;
+
+ glm::mat4 const M = glm::identity<glm::mat4x4>();
+ glm::mat4 const N(1.0f);
+
+ Error += glm::all(glm::equal(M, N, 0.0001f)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_mul();
+ Error += test_quat_mul_vec();
+ Error += test_quat_angle();
+ Error += test_quat_angleAxis();
+ Error += test_quat_mix();
+ Error += test_quat_normalize();
+ Error += test_quat_euler();
+ Error += test_quat_slerp();
+ Error += test_quat_slerp_spins();
+ Error += test_identity();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_random.cpp b/3rdparty/glm/source/test/gtc/gtc_random.cpp
new file mode 100644
index 0000000..60fb60c
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_random.cpp
@@ -0,0 +1,381 @@
+#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+#include <glm/gtc/random.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/type_precision.hpp>
+#if GLM_LANG & GLM_LANG_CXX0X_FLAG
+# include <array>
+#endif
+
+std::size_t const TestSamples = 10000;
+
+int test_linearRand()
+{
+ int Error = 0;
+
+ glm::int32 const Min = 16;
+ glm::int32 const Max = 32;
+
+ {
+ glm::u8vec2 AMin(std::numeric_limits<glm::u8>::max());
+ glm::u8vec2 AMax(std::numeric_limits<glm::u8>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::u8vec2 A = glm::linearRand(glm::u8vec2(Min), glm::u8vec2(Max));
+ AMin = glm::min(AMin, A);
+ AMax = glm::max(AMax, A);
+
+ if(!glm::all(glm::lessThanEqual(A, glm::u8vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(A, glm::u8vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(AMin, glm::u8vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(AMax, glm::u8vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::u16vec2 BMin(std::numeric_limits<glm::u16>::max());
+ glm::u16vec2 BMax(std::numeric_limits<glm::u16>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::u16vec2 B = glm::linearRand(glm::u16vec2(Min), glm::u16vec2(Max));
+ BMin = glm::min(BMin, B);
+ BMax = glm::max(BMax, B);
+
+ if(!glm::all(glm::lessThanEqual(B, glm::u16vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(B, glm::u16vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(BMin, glm::u16vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(BMax, glm::u16vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::u32vec2 CMin(std::numeric_limits<glm::u32>::max());
+ glm::u32vec2 CMax(std::numeric_limits<glm::u32>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::u32vec2 C = glm::linearRand(glm::u32vec2(Min), glm::u32vec2(Max));
+ CMin = glm::min(CMin, C);
+ CMax = glm::max(CMax, C);
+
+ if(!glm::all(glm::lessThanEqual(C, glm::u32vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(C, glm::u32vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(CMin, glm::u32vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(CMax, glm::u32vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::u64vec2 DMin(std::numeric_limits<glm::u64>::max());
+ glm::u64vec2 DMax(std::numeric_limits<glm::u64>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::u64vec2 D = glm::linearRand(glm::u64vec2(Min), glm::u64vec2(Max));
+ DMin = glm::min(DMin, D);
+ DMax = glm::max(DMax, D);
+
+ if(!glm::all(glm::lessThanEqual(D, glm::u64vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(D, glm::u64vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(DMin, glm::u64vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(DMax, glm::u64vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+ }
+
+ {
+ glm::i8vec2 AMin(std::numeric_limits<glm::i8>::max());
+ glm::i8vec2 AMax(std::numeric_limits<glm::i8>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::i8vec2 A = glm::linearRand(glm::i8vec2(Min), glm::i8vec2(Max));
+ AMin = glm::min(AMin, A);
+ AMax = glm::max(AMax, A);
+
+ if(!glm::all(glm::lessThanEqual(A, glm::i8vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(A, glm::i8vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(AMin, glm::i8vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(AMax, glm::i8vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::i16vec2 BMin(std::numeric_limits<glm::i16>::max());
+ glm::i16vec2 BMax(std::numeric_limits<glm::i16>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::i16vec2 B = glm::linearRand(glm::i16vec2(Min), glm::i16vec2(Max));
+ BMin = glm::min(BMin, B);
+ BMax = glm::max(BMax, B);
+
+ if(!glm::all(glm::lessThanEqual(B, glm::i16vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(B, glm::i16vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(BMin, glm::i16vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(BMax, glm::i16vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::i32vec2 CMin(std::numeric_limits<glm::i32>::max());
+ glm::i32vec2 CMax(std::numeric_limits<glm::i32>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::i32vec2 C = glm::linearRand(glm::i32vec2(Min), glm::i32vec2(Max));
+ CMin = glm::min(CMin, C);
+ CMax = glm::max(CMax, C);
+
+ if(!glm::all(glm::lessThanEqual(C, glm::i32vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(C, glm::i32vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(CMin, glm::i32vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(CMax, glm::i32vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ glm::i64vec2 DMin(std::numeric_limits<glm::i64>::max());
+ glm::i64vec2 DMax(std::numeric_limits<glm::i64>::min());
+ {
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::i64vec2 D = glm::linearRand(glm::i64vec2(Min), glm::i64vec2(Max));
+ DMin = glm::min(DMin, D);
+ DMax = glm::max(DMax, D);
+
+ if(!glm::all(glm::lessThanEqual(D, glm::i64vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(D, glm::i64vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ Error += glm::all(glm::equal(DMin, glm::i64vec2(Min))) ? 0 : 1;
+ Error += glm::all(glm::equal(DMax, glm::i64vec2(Max))) ? 0 : 1;
+ assert(!Error);
+ }
+ }
+
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ glm::f32vec2 const A(glm::linearRand(glm::f32vec2(static_cast<float>(Min)), glm::f32vec2(static_cast<float>(Max))));
+ if(!glm::all(glm::lessThanEqual(A, glm::f32vec2(static_cast<float>(Max)))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(A, glm::f32vec2(static_cast<float>(Min)))))
+ ++Error;
+
+ glm::f64vec2 const B(glm::linearRand(glm::f64vec2(Min), glm::f64vec2(Max)));
+ if(!glm::all(glm::lessThanEqual(B, glm::f64vec2(Max))))
+ ++Error;
+ if(!glm::all(glm::greaterThanEqual(B, glm::f64vec2(Min))))
+ ++Error;
+ assert(!Error);
+ }
+
+ {
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0;
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ ResultFloat += glm::linearRand(-1.0f, 1.0f);
+ ResultDouble += glm::linearRand(-1.0, 1.0);
+ }
+
+ Error += glm::epsilonEqual(ResultFloat, 0.0f, 0.0001f);
+ Error += glm::epsilonEqual(ResultDouble, 0.0, 0.0001);
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_circularRand()
+{
+ int Error = 0;
+
+ {
+ std::size_t Max = TestSamples;
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0;
+ double Radius = 2.0;
+
+ for(std::size_t i = 0; i < Max; ++i)
+ {
+ ResultFloat += glm::length(glm::circularRand(1.0f));
+ ResultDouble += glm::length(glm::circularRand(Radius));
+ }
+
+ Error += glm::epsilonEqual(ResultFloat, float(Max), 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultDouble, double(Max) * double(Radius), 0.01) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_sphericalRand()
+{
+ int Error = 0;
+
+ {
+ std::size_t Max = TestSamples;
+ float ResultFloatA = 0.0f;
+ float ResultFloatB = 0.0f;
+ float ResultFloatC = 0.0f;
+ double ResultDoubleA = 0.0;
+ double ResultDoubleB = 0.0;
+ double ResultDoubleC = 0.0;
+
+ for(std::size_t i = 0; i < Max; ++i)
+ {
+ ResultFloatA += glm::length(glm::sphericalRand(1.0f));
+ ResultDoubleA += glm::length(glm::sphericalRand(1.0));
+ ResultFloatB += glm::length(glm::sphericalRand(2.0f));
+ ResultDoubleB += glm::length(glm::sphericalRand(2.0));
+ ResultFloatC += glm::length(glm::sphericalRand(3.0f));
+ ResultDoubleC += glm::length(glm::sphericalRand(3.0));
+ }
+
+ Error += glm::epsilonEqual(ResultFloatA, float(Max), 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultDoubleA, double(Max), 0.0001) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultFloatB, float(Max * 2), 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultFloatC, float(Max * 3), 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(ResultDoubleC, double(Max * 3), 0.01) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_diskRand()
+{
+ int Error = 0;
+
+ {
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0;
+
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ ResultFloat += glm::length(glm::diskRand(2.0f));
+ ResultDouble += glm::length(glm::diskRand(2.0));
+ }
+
+ Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1;
+ Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_ballRand()
+{
+ int Error = 0;
+
+ {
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0;
+
+ for(std::size_t i = 0; i < TestSamples; ++i)
+ {
+ ResultFloat += glm::length(glm::ballRand(2.0f));
+ ResultDouble += glm::length(glm::ballRand(2.0));
+ }
+
+ Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1;
+ Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+/*
+#if(GLM_LANG & GLM_LANG_CXX0X_FLAG)
+int test_grid()
+{
+ int Error = 0;
+
+ typedef std::array<int, 8> colors;
+ typedef std::array<int, 8 * 8> grid;
+
+ grid Grid;
+ colors Colors;
+
+ grid GridBest;
+ colors ColorsBest;
+
+ while(true)
+ {
+ for(std::size_t i = 0; i < Grid.size(); ++i)
+ Grid[i] = int(glm::linearRand(0.0, 8.0 * 8.0 * 8.0 - 1.0) / 64.0);
+
+ for(std::size_t i = 0; i < Grid.size(); ++i)
+ ++Colors[Grid[i]];
+
+ bool Exit = true;
+ for(std::size_t i = 0; i < Colors.size(); ++i)
+ {
+ if(Colors[i] == 8)
+ continue;
+
+ Exit = false;
+ break;
+ }
+
+ if(Exit == true)
+ break;
+ }
+
+ return Error;
+}
+#endif
+*/
+int main()
+{
+ int Error = 0;
+
+ Error += test_linearRand();
+ Error += test_circularRand();
+ Error += test_sphericalRand();
+ Error += test_diskRand();
+ Error += test_ballRand();
+/*
+#if(GLM_LANG & GLM_LANG_CXX0X_FLAG)
+ Error += test_grid();
+#endif
+*/
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp b/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp
new file mode 100644
index 0000000..5158413
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp
@@ -0,0 +1,8 @@
+#include <glm/gtc/reciprocal.hpp>
+#include <ctime>
+
+int main()
+{
+ return 0;
+}
+
diff --git a/3rdparty/glm/source/test/gtc/gtc_round.cpp b/3rdparty/glm/source/test/gtc/gtc_round.cpp
new file mode 100644
index 0000000..60d9a85
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_round.cpp
@@ -0,0 +1,458 @@
+#include <glm/gtc/round.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <vector>
+#include <ctime>
+#include <cstdio>
+
+namespace isPowerOfTwo
+{
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ bool Return;
+ };
+
+ int test_int16()
+ {
+ type<glm::int16> const Data[] =
+ {
+ {0x0001, true},
+ {0x0002, true},
+ {0x0004, true},
+ {0x0080, true},
+ {0x0000, true},
+ {0x0003, false}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::int16>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint16()
+ {
+ type<glm::uint16> const Data[] =
+ {
+ {0x0001, true},
+ {0x0002, true},
+ {0x0004, true},
+ {0x0000, true},
+ {0x0000, true},
+ {0x0003, false}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint16>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_int32()
+ {
+ type<int> const Data[] =
+ {
+ {0x00000001, true},
+ {0x00000002, true},
+ {0x00000004, true},
+ {0x0000000f, false},
+ {0x00000000, true},
+ {0x00000003, false}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ glm::bvec1 Result = glm::isPowerOfTwo(glm::ivec1(Data[i].Value));
+ Error += glm::all(glm::equal(glm::bvec1(Data[i].Return), Result)) ? 0 : 1;
+ }
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ glm::bvec2 Result = glm::isPowerOfTwo(glm::ivec2(Data[i].Value));
+ Error += glm::all(glm::equal(glm::bvec2(Data[i].Return), Result)) ? 0 : 1;
+ }
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ glm::bvec3 Result = glm::isPowerOfTwo(glm::ivec3(Data[i].Value));
+ Error += glm::all(glm::equal(glm::bvec3(Data[i].Return), Result)) ? 0 : 1;
+ }
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ glm::bvec4 Result = glm::isPowerOfTwo(glm::ivec4(Data[i].Value));
+ Error += glm::all(glm::equal(glm::bvec4(Data[i].Return), Result)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint32()
+ {
+ type<glm::uint> const Data[] =
+ {
+ {0x00000001, true},
+ {0x00000002, true},
+ {0x00000004, true},
+ {0x80000000, true},
+ {0x00000000, true},
+ {0x00000003, false}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint>); i < n; ++i)
+ {
+ bool Result = glm::isPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_int16();
+ Error += test_uint16();
+ Error += test_int32();
+ Error += test_uint32();
+
+ return Error;
+ }
+}//isPowerOfTwo
+
+namespace ceilPowerOfTwo_advanced
+{
+ template<typename genIUType>
+ GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
+ {
+ genIUType tmp = Value;
+ genIUType result = genIUType(0);
+ while(tmp)
+ {
+ result = (tmp & (~tmp + 1)); // grab lowest bit
+ tmp &= ~result; // clear lowest bit
+ }
+ return result;
+ }
+
+ template<typename genType>
+ GLM_FUNC_QUALIFIER genType ceilPowerOfTwo_loop(genType value)
+ {
+ return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1;
+ }
+
+ template<typename genType>
+ struct type
+ {
+ genType Value;
+ genType Return;
+ };
+
+ int test_int32()
+ {
+ type<glm::int32> const Data[] =
+ {
+ {0x0000ffff, 0x00010000},
+ {-3, -4},
+ {-8, -8},
+ {0x00000001, 0x00000001},
+ {0x00000002, 0x00000002},
+ {0x00000004, 0x00000004},
+ {0x00000007, 0x00000008},
+ {0x0000fff0, 0x00010000},
+ {0x0000f000, 0x00010000},
+ {0x08000000, 0x08000000},
+ {0x00000000, 0x00000000},
+ {0x00000003, 0x00000004}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::int32>); i < n; ++i)
+ {
+ glm::int32 Result = glm::ceilPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_uint32()
+ {
+ type<glm::uint32> const Data[] =
+ {
+ {0x00000001, 0x00000001},
+ {0x00000002, 0x00000002},
+ {0x00000004, 0x00000004},
+ {0x00000007, 0x00000008},
+ {0x0000ffff, 0x00010000},
+ {0x0000fff0, 0x00010000},
+ {0x0000f000, 0x00010000},
+ {0x80000000, 0x80000000},
+ {0x00000000, 0x00000000},
+ {0x00000003, 0x00000004}
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::uint32>); i < n; ++i)
+ {
+ glm::uint32 Result = glm::ceilPowerOfTwo(Data[i].Value);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int perf()
+ {
+ int Error(0);
+
+ std::vector<glm::uint> v;
+ v.resize(100000000);
+
+ std::clock_t Timestramp0 = std::clock();
+
+ for(glm::uint32 i = 0, n = static_cast<glm::uint>(v.size()); i < n; ++i)
+ v[i] = ceilPowerOfTwo_loop(i);
+
+ std::clock_t Timestramp1 = std::clock();
+
+ for(glm::uint32 i = 0, n = static_cast<glm::uint>(v.size()); i < n; ++i)
+ v[i] = glm::ceilPowerOfTwo(i);
+
+ std::clock_t Timestramp2 = std::clock();
+
+ std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast<int>(Timestramp1 - Timestramp0));
+ std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast<int>(Timestramp2 - Timestramp1));
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_int32();
+ Error += test_uint32();
+
+ return Error;
+ }
+}//namespace ceilPowerOfTwo_advanced
+
+namespace roundPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::roundPowerOfTwo(7u);
+ Error += A == 8u ? 0 : 1;
+
+ glm::uint32 const B = glm::roundPowerOfTwo(15u);
+ Error += B == 16u ? 0 : 1;
+
+ glm::uint32 const C = glm::roundPowerOfTwo(31u);
+ Error += C == 32u ? 0 : 1;
+
+ glm::uint32 const D = glm::roundPowerOfTwo(9u);
+ Error += D == 8u ? 0 : 1;
+
+ glm::uint32 const E = glm::roundPowerOfTwo(17u);
+ Error += E == 16u ? 0 : 1;
+
+ glm::uint32 const F = glm::roundPowerOfTwo(33u);
+ Error += F == 32u ? 0 : 1;
+
+ return Error;
+ }
+}//namespace roundPowerOfTwo
+
+namespace floorPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::floorPowerOfTwo(7u);
+ Error += A == 4u ? 0 : 1;
+
+ glm::uint32 const B = glm::floorPowerOfTwo(15u);
+ Error += B == 8u ? 0 : 1;
+
+ glm::uint32 const C = glm::floorPowerOfTwo(31u);
+ Error += C == 16u ? 0 : 1;
+
+ return Error;
+ }
+}//namespace floorPowerOfTwo
+
+namespace ceilPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::ceilPowerOfTwo(7u);
+ Error += A == 8u ? 0 : 1;
+
+ glm::uint32 const B = glm::ceilPowerOfTwo(15u);
+ Error += B == 16u ? 0 : 1;
+
+ glm::uint32 const C = glm::ceilPowerOfTwo(31u);
+ Error += C == 32u ? 0 : 1;
+
+ return Error;
+ }
+}//namespace ceilPowerOfTwo
+
+namespace floorMultiple
+{
+ template<typename genType>
+ struct type
+ {
+ genType Source;
+ genType Multiple;
+ genType Return;
+ genType Epsilon;
+ };
+
+ int test_float()
+ {
+ type<glm::float64> const Data[] =
+ {
+ {3.4, 0.3, 3.3, 0.0001},
+ {-1.4, 0.3, -1.5, 0.0001},
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::float64>); i < n; ++i)
+ {
+ glm::float64 Result = glm::floorMultiple(Data[i].Source, Data[i].Multiple);
+ Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_float();
+
+ return Error;
+ }
+}//namespace floorMultiple
+
+namespace ceilMultiple
+{
+ template<typename genType>
+ struct type
+ {
+ genType Source;
+ genType Multiple;
+ genType Return;
+ genType Epsilon;
+ };
+
+ int test_float()
+ {
+ type<glm::float64> const Data[] =
+ {
+ {3.4, 0.3, 3.6, 0.0001},
+ {-1.4, 0.3, -1.2, 0.0001},
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<glm::float64>); i < n; ++i)
+ {
+ glm::float64 Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple);
+ Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test_int()
+ {
+ type<int> const Data[] =
+ {
+ {3, 4, 4, 0},
+ {7, 4, 8, 0},
+ {5, 4, 8, 0},
+ {1, 4, 4, 0},
+ {1, 3, 3, 0},
+ {4, 3, 6, 0},
+ {4, 1, 4, 0},
+ {1, 1, 1, 0},
+ {7, 1, 7, 0},
+ };
+
+ int Error(0);
+
+ for(std::size_t i = 0, n = sizeof(Data) / sizeof(type<int>); i < n; ++i)
+ {
+ int Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple);
+ Error += Data[i].Return == Result ? 0 : 1;
+ }
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ Error += test_int();
+ Error += test_float();
+
+ return Error;
+ }
+}//namespace ceilMultiple
+
+int main()
+{
+ int Error(0);
+
+ Error += isPowerOfTwo::test();
+ Error += floorPowerOfTwo::test();
+ Error += roundPowerOfTwo::test();
+ Error += ceilPowerOfTwo::test();
+ Error += ceilPowerOfTwo_advanced::test();
+
+# ifdef NDEBUG
+ Error += ceilPowerOfTwo_advanced::perf();
+# endif//NDEBUG
+
+ Error += floorMultiple::test();
+ Error += ceilMultiple::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp b/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp
new file mode 100644
index 0000000..3c071ef
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp
@@ -0,0 +1,181 @@
+#include <glm/glm.hpp>
+
+#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+
+GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
+GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
+GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
+GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
+GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
+GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
+
+struct my_vec4_packed
+{
+ glm::uint32 a;
+ glm::vec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct");
+
+struct my_vec4_aligned
+{
+ glm::uint32 a;
+ glm::aligned_vec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct");
+
+struct my_dvec4_packed
+{
+ glm::uint64 a;
+ glm::dvec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct");
+
+struct my_dvec4_aligned
+{
+ glm::uint64 a;
+ glm::aligned_dvec4 b;
+};
+//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
+
+struct my_ivec4_packed
+{
+ glm::uint32 a;
+ glm::ivec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct");
+
+struct my_ivec4_aligned
+{
+ glm::uint32 a;
+ glm::aligned_ivec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct");
+
+struct my_u8vec4_packed
+{
+ glm::uint32 a;
+ glm::u8vec4 b;
+};
+GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct");
+
+static int test_copy()
+{
+ int Error = 0;
+
+ {
+ glm::aligned_ivec4 const a(1, 2, 3, 4);
+ glm::ivec4 const u(a);
+
+ Error += a.x == u.x ? 0 : 1;
+ Error += a.y == u.y ? 0 : 1;
+ Error += a.z == u.z ? 0 : 1;
+ Error += a.w == u.w ? 0 : 1;
+ }
+
+ {
+ my_ivec4_aligned a;
+ a.b = glm::ivec4(1, 2, 3, 4);
+
+ my_ivec4_packed u;
+ u.b = a.b;
+
+ Error += a.b.x == u.b.x ? 0 : 1;
+ Error += a.b.y == u.b.y ? 0 : 1;
+ Error += a.b.z == u.b.z ? 0 : 1;
+ Error += a.b.w == u.b.w ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ctor()
+{
+ int Error = 0;
+
+# if GLM_HAS_CONSTEXPR
+ {
+ constexpr glm::aligned_ivec4 v(1);
+
+ Error += v.x == 1 ? 0 : 1;
+ Error += v.y == 1 ? 0 : 1;
+ Error += v.z == 1 ? 0 : 1;
+ Error += v.w == 1 ? 0 : 1;
+ }
+
+ {
+ constexpr glm::packed_ivec4 v(1);
+
+ Error += v.x == 1 ? 0 : 1;
+ Error += v.y == 1 ? 0 : 1;
+ Error += v.z == 1 ? 0 : 1;
+ Error += v.w == 1 ? 0 : 1;
+ }
+
+ {
+ constexpr glm::ivec4 v(1);
+
+ Error += v.x == 1 ? 0 : 1;
+ Error += v.y == 1 ? 0 : 1;
+ Error += v.z == 1 ? 0 : 1;
+ Error += v.w == 1 ? 0 : 1;
+ }
+# endif//GLM_HAS_CONSTEXPR
+
+ return Error;
+}
+
+static int test_aligned_ivec4()
+{
+ int Error = 0;
+
+ glm::aligned_ivec4 const v(1, 2, 3, 4);
+ Error += glm::all(glm::equal(v, glm::aligned_ivec4(1, 2, 3, 4))) ? 0 : 1;
+
+ glm::aligned_ivec4 const u = v * 2;
+ Error += glm::all(glm::equal(u, glm::aligned_ivec4(2, 4, 6, 8))) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_aligned_mat4()
+{
+ int Error = 0;
+
+ glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f);
+ Error += glm::all(glm::equal(u, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1;
+
+ glm::aligned_vec4 const v(1, 2, 3, 4);
+ Error += glm::all(glm::equal(v, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1;
+
+ glm::aligned_mat4 const m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+ glm::aligned_mat4 const t = glm::transpose(m);
+ glm::aligned_mat4 const expected = glm::mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
+ Error += glm::all(glm::equal(t, expected, 0.0001f)) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ctor();
+ Error += test_copy();
+ Error += test_aligned_ivec4();
+ Error += test_aligned_mat4();
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp b/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp
new file mode 100644
index 0000000..77f0686
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp
@@ -0,0 +1,1041 @@
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <vector>
+#if GLM_HAS_OPENMP
+# include <omp.h>
+#endif
+
+#if GLM_HAS_STATIC_ASSERT
+static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform");
+
+
+static_assert(sizeof(glm::lowp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::mediump_u8vec4) == 4, "uint8 size isn't 1 byte on this platform");
+static_assert(sizeof(glm::highp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform");
+
+static_assert(sizeof(glm::lowp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::mediump_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform");
+static_assert(sizeof(glm::highp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::mediump_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform");
+static_assert(sizeof(glm::highp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform");
+
+static_assert(sizeof(glm::lowp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::mediump_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
+static_assert(sizeof(glm::highp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
+
+#endif
+
+static int test_scalar_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::int8) != 1;
+ Error += sizeof(glm::int16) != 2;
+ Error += sizeof(glm::int32) != 4;
+ Error += sizeof(glm::int64) != 8;
+ Error += sizeof(glm::uint8) != 1;
+ Error += sizeof(glm::uint16) != 2;
+ Error += sizeof(glm::uint32) != 4;
+ Error += sizeof(glm::uint64) != 8;
+ Error += sizeof(glm::float32) != 4;
+ Error += sizeof(glm::float64) != 8;
+
+ Error += sizeof(glm::lowp_int8) != 1;
+ Error += sizeof(glm::lowp_int16) != 2;
+ Error += sizeof(glm::lowp_int32) != 4;
+ Error += sizeof(glm::lowp_int64) != 8;
+ Error += sizeof(glm::lowp_uint8) != 1;
+ Error += sizeof(glm::lowp_uint16) != 2;
+ Error += sizeof(glm::lowp_uint32) != 4;
+ Error += sizeof(glm::lowp_uint64) != 8;
+ Error += sizeof(glm::lowp_float32) != 4;
+ Error += sizeof(glm::lowp_float64) != 8;
+
+ Error += sizeof(glm::mediump_int8) != 1;
+ Error += sizeof(glm::mediump_int16) != 2;
+ Error += sizeof(glm::mediump_int32) != 4;
+ Error += sizeof(glm::mediump_int64) != 8;
+ Error += sizeof(glm::mediump_uint8) != 1;
+ Error += sizeof(glm::mediump_uint16) != 2;
+ Error += sizeof(glm::mediump_uint32) != 4;
+ Error += sizeof(glm::mediump_uint64) != 8;
+ Error += sizeof(glm::mediump_float32) != 4;
+ Error += sizeof(glm::mediump_float64) != 8;
+
+ Error += sizeof(glm::highp_int8) != 1;
+ Error += sizeof(glm::highp_int16) != 2;
+ Error += sizeof(glm::highp_int32) != 4;
+ Error += sizeof(glm::highp_int64) != 8;
+ Error += sizeof(glm::highp_uint8) != 1;
+ Error += sizeof(glm::highp_uint16) != 2;
+ Error += sizeof(glm::highp_uint32) != 4;
+ Error += sizeof(glm::highp_uint64) != 8;
+ Error += sizeof(glm::highp_float32) != 4;
+ Error += sizeof(glm::highp_float64) != 8;
+
+ return Error;
+}
+
+static int test_fvec_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::f32vec2) != 8;
+ Error += sizeof(glm::f32vec3) != 12;
+ Error += sizeof(glm::f32vec4) != 16;
+ Error += sizeof(glm::f64vec2) != 16;
+ Error += sizeof(glm::f64vec3) != 24;
+ Error += sizeof(glm::f64vec4) != 32;
+
+ Error += sizeof(glm::lowp_f32vec2) != 8;
+ Error += sizeof(glm::lowp_f32vec3) != 12;
+ Error += sizeof(glm::lowp_f32vec4) != 16;
+ Error += sizeof(glm::lowp_f64vec2) != 16;
+ Error += sizeof(glm::lowp_f64vec3) != 24;
+ Error += sizeof(glm::lowp_f64vec4) != 32;
+
+ Error += sizeof(glm::mediump_f32vec2) != 8;
+ Error += sizeof(glm::mediump_f32vec3) != 12;
+ Error += sizeof(glm::mediump_f32vec4) != 16;
+ Error += sizeof(glm::mediump_f64vec2) != 16;
+ Error += sizeof(glm::mediump_f64vec3) != 24;
+ Error += sizeof(glm::mediump_f64vec4) != 32;
+
+ Error += sizeof(glm::highp_f32vec2) != 8;
+ Error += sizeof(glm::highp_f32vec3) != 12;
+ Error += sizeof(glm::highp_f32vec4) != 16;
+ Error += sizeof(glm::highp_f64vec2) != 16;
+ Error += sizeof(glm::highp_f64vec3) != 24;
+ Error += sizeof(glm::highp_f64vec4) != 32;
+
+ return Error;
+}
+
+static int test_fvec_precision()
+{
+ int Error = 0;
+
+ {
+ glm::f32vec2 v1(1.f);
+ glm::lowp_f32vec2 v2(v1);
+ glm::mediump_f32vec2 v3(v1);
+ glm::highp_f32vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f32vec2(v2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec2(v3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec2(v4), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::f32vec3 v1(1.f);
+ glm::lowp_f32vec3 v2(v1);
+ glm::mediump_f32vec3 v3(v1);
+ glm::highp_f32vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f32vec3(v2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec3(v3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec3(v4), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ {
+ glm::f32vec4 v1(1.f);
+ glm::lowp_f32vec4 v2(v1);
+ glm::mediump_f32vec4 v3(v1);
+ glm::highp_f32vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f32vec4(v2), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec4(v3), glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f32vec4(v4), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_dvec_precision()
+{
+ int Error = 0;
+
+ {
+ glm::f64vec2 v1(1.0);
+ glm::lowp_f64vec2 v2(v1);
+ glm::mediump_f64vec2 v3(v1);
+ glm::highp_f64vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f64vec2(v2), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec2(v3), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec2(v4), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::f64vec3 v1(1.0);
+ glm::lowp_f64vec3 v2(v1);
+ glm::mediump_f64vec3 v3(v1);
+ glm::highp_f64vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f64vec3(v2), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec3(v3), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec3(v4), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ {
+ glm::f64vec4 v1(1.0);
+ glm::lowp_f64vec4 v2(v1);
+ glm::mediump_f64vec4 v3(v1);
+ glm::highp_f64vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::f64vec4(v2), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec4(v3), glm::epsilon<double>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::f64vec4(v4), glm::epsilon<double>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_ivec_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::i8vec2) != 2;
+ Error += sizeof(glm::i8vec3) != 3;
+ Error += sizeof(glm::i8vec4) != 4;
+ Error += sizeof(glm::i16vec2) != 4;
+ Error += sizeof(glm::i16vec3) != 6;
+ Error += sizeof(glm::i16vec4) != 8;
+ Error += sizeof(glm::i32vec2) != 8;
+ Error += sizeof(glm::i32vec3) != 12;
+ Error += sizeof(glm::i32vec4) != 16;
+ Error += sizeof(glm::i64vec2) != 16;
+ Error += sizeof(glm::i64vec3) != 24;
+ Error += sizeof(glm::i64vec4) != 32;
+
+ Error += sizeof(glm::lowp_i8vec2) != 2;
+ Error += sizeof(glm::lowp_i8vec3) != 3;
+ Error += sizeof(glm::lowp_i8vec4) != 4;
+ Error += sizeof(glm::lowp_i16vec2) != 4;
+ Error += sizeof(glm::lowp_i16vec3) != 6;
+ Error += sizeof(glm::lowp_i16vec4) != 8;
+ Error += sizeof(glm::lowp_i32vec2) != 8;
+ Error += sizeof(glm::lowp_i32vec3) != 12;
+ Error += sizeof(glm::lowp_i32vec4) != 16;
+ Error += sizeof(glm::lowp_i64vec2) != 16;
+ Error += sizeof(glm::lowp_i64vec3) != 24;
+ Error += sizeof(glm::lowp_i64vec4) != 32;
+
+ Error += sizeof(glm::mediump_i8vec2) != 2;
+ Error += sizeof(glm::mediump_i8vec3) != 3;
+ Error += sizeof(glm::mediump_i8vec4) != 4;
+ Error += sizeof(glm::mediump_i16vec2) != 4;
+ Error += sizeof(glm::mediump_i16vec3) != 6;
+ Error += sizeof(glm::mediump_i16vec4) != 8;
+ Error += sizeof(glm::mediump_i32vec2) != 8;
+ Error += sizeof(glm::mediump_i32vec3) != 12;
+ Error += sizeof(glm::mediump_i32vec4) != 16;
+ Error += sizeof(glm::mediump_i64vec2) != 16;
+ Error += sizeof(glm::mediump_i64vec3) != 24;
+ Error += sizeof(glm::mediump_i64vec4) != 32;
+
+ Error += sizeof(glm::highp_i8vec2) != 2;
+ Error += sizeof(glm::highp_i8vec3) != 3;
+ Error += sizeof(glm::highp_i8vec4) != 4;
+ Error += sizeof(glm::highp_i16vec2) != 4;
+ Error += sizeof(glm::highp_i16vec3) != 6;
+ Error += sizeof(glm::highp_i16vec4) != 8;
+ Error += sizeof(glm::highp_i32vec2) != 8;
+ Error += sizeof(glm::highp_i32vec3) != 12;
+ Error += sizeof(glm::highp_i32vec4) != 16;
+ Error += sizeof(glm::highp_i64vec2) != 16;
+ Error += sizeof(glm::highp_i64vec3) != 24;
+ Error += sizeof(glm::highp_i64vec4) != 32;
+
+ return Error;
+}
+
+static int test_ivec_precision()
+{
+ int Error = 0;
+
+ {
+ glm::i8vec2 v1(0);
+ glm::lowp_i8vec2 v2(v1);
+ glm::mediump_i8vec2 v3(v1);
+ glm::highp_i8vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i8vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i8vec3 v1(0);
+ glm::lowp_i8vec3 v2(v1);
+ glm::mediump_i8vec3 v3(v1);
+ glm::highp_i8vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i8vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i8vec4 v1(0);
+ glm::lowp_i8vec4 v2(v1);
+ glm::mediump_i8vec4 v3(v1);
+ glm::highp_i8vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i8vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i8vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i16vec2 v1(0);
+ glm::lowp_i16vec2 v2(v1);
+ glm::mediump_i16vec2 v3(v1);
+ glm::highp_i16vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i16vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i16vec3 v1(0);
+ glm::lowp_i16vec3 v2(v1);
+ glm::mediump_i16vec3 v3(v1);
+ glm::highp_i16vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i16vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i16vec4 v1(0);
+ glm::lowp_i16vec4 v2(v1);
+ glm::mediump_i16vec4 v3(v1);
+ glm::highp_i16vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i16vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i16vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i32vec2 v1(0);
+ glm::lowp_i32vec2 v2(v1);
+ glm::mediump_i32vec2 v3(v1);
+ glm::highp_i32vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i32vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i32vec3 v1(0);
+ glm::lowp_i32vec3 v2(v1);
+ glm::mediump_i32vec3 v3(v1);
+ glm::highp_i32vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i32vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i32vec4 v1(0);
+ glm::lowp_i32vec4 v2(v1);
+ glm::mediump_i32vec4 v3(v1);
+ glm::highp_i32vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i32vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i32vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i64vec2 v1(0);
+ glm::lowp_i64vec2 v2(v1);
+ glm::mediump_i64vec2 v3(v1);
+ glm::highp_i64vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i64vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i64vec3 v1(0);
+ glm::lowp_i64vec3 v2(v1);
+ glm::mediump_i64vec3 v3(v1);
+ glm::highp_i64vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i64vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::i64vec4 v1(0);
+ glm::lowp_i64vec4 v2(v1);
+ glm::mediump_i64vec4 v3(v1);
+ glm::highp_i64vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::i64vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::i64vec4(v4))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_uvec_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::u8vec2) != 2;
+ Error += sizeof(glm::u8vec3) != 3;
+ Error += sizeof(glm::u8vec4) != 4;
+ Error += sizeof(glm::u16vec2) != 4;
+ Error += sizeof(glm::u16vec3) != 6;
+ Error += sizeof(glm::u16vec4) != 8;
+ Error += sizeof(glm::u32vec2) != 8;
+ Error += sizeof(glm::u32vec3) != 12;
+ Error += sizeof(glm::u32vec4) != 16;
+ Error += sizeof(glm::u64vec2) != 16;
+ Error += sizeof(glm::u64vec3) != 24;
+ Error += sizeof(glm::u64vec4) != 32;
+
+ Error += sizeof(glm::lowp_u8vec2) != 2;
+ Error += sizeof(glm::lowp_u8vec3) != 3;
+ Error += sizeof(glm::lowp_u8vec4) != 4;
+ Error += sizeof(glm::lowp_u16vec2) != 4;
+ Error += sizeof(glm::lowp_u16vec3) != 6;
+ Error += sizeof(glm::lowp_u16vec4) != 8;
+ Error += sizeof(glm::lowp_u32vec2) != 8;
+ Error += sizeof(glm::lowp_u32vec3) != 12;
+ Error += sizeof(glm::lowp_u32vec4) != 16;
+ Error += sizeof(glm::lowp_u64vec2) != 16;
+ Error += sizeof(glm::lowp_u64vec3) != 24;
+ Error += sizeof(glm::lowp_u64vec4) != 32;
+
+ Error += sizeof(glm::mediump_u8vec2) != 2;
+ Error += sizeof(glm::mediump_u8vec3) != 3;
+ Error += sizeof(glm::mediump_u8vec4) != 4;
+ Error += sizeof(glm::mediump_u16vec2) != 4;
+ Error += sizeof(glm::mediump_u16vec3) != 6;
+ Error += sizeof(glm::mediump_u16vec4) != 8;
+ Error += sizeof(glm::mediump_u32vec2) != 8;
+ Error += sizeof(glm::mediump_u32vec3) != 12;
+ Error += sizeof(glm::mediump_u32vec4) != 16;
+ Error += sizeof(glm::mediump_u64vec2) != 16;
+ Error += sizeof(glm::mediump_u64vec3) != 24;
+ Error += sizeof(glm::mediump_u64vec4) != 32;
+
+ Error += sizeof(glm::highp_u8vec2) != 2;
+ Error += sizeof(glm::highp_u8vec3) != 3;
+ Error += sizeof(glm::highp_u8vec4) != 4;
+ Error += sizeof(glm::highp_u16vec2) != 4;
+ Error += sizeof(glm::highp_u16vec3) != 6;
+ Error += sizeof(glm::highp_u16vec4) != 8;
+ Error += sizeof(glm::highp_u32vec2) != 8;
+ Error += sizeof(glm::highp_u32vec3) != 12;
+ Error += sizeof(glm::highp_u32vec4) != 16;
+ Error += sizeof(glm::highp_u64vec2) != 16;
+ Error += sizeof(glm::highp_u64vec3) != 24;
+ Error += sizeof(glm::highp_u64vec4) != 32;
+
+ return Error;
+}
+
+static int test_uvec_precision()
+{
+ int Error = 0;
+
+ {
+ glm::u8vec2 v1(0);
+ glm::lowp_u8vec2 v2(v1);
+ glm::mediump_u8vec2 v3(v1);
+ glm::highp_u8vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u8vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u8vec3 v1(0);
+ glm::lowp_u8vec3 v2(v1);
+ glm::mediump_u8vec3 v3(v1);
+ glm::highp_u8vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u8vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u8vec4 v1(0);
+ glm::lowp_u8vec4 v2(v1);
+ glm::mediump_u8vec4 v3(v1);
+ glm::highp_u8vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u8vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u8vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u16vec2 v1(0);
+ glm::lowp_u16vec2 v2(v1);
+ glm::mediump_u16vec2 v3(v1);
+ glm::highp_u16vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u16vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u16vec3 v1(0);
+ glm::lowp_u16vec3 v2(v1);
+ glm::mediump_u16vec3 v3(v1);
+ glm::highp_u16vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u16vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u16vec4 v1(0);
+ glm::lowp_u16vec4 v2(v1);
+ glm::mediump_u16vec4 v3(v1);
+ glm::highp_u16vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u16vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u16vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u32vec2 v1(0);
+ glm::lowp_u32vec2 v2(v1);
+ glm::mediump_u32vec2 v3(v1);
+ glm::highp_u32vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u32vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u32vec3 v1(0);
+ glm::lowp_u32vec3 v2(v1);
+ glm::mediump_u32vec3 v3(v1);
+ glm::highp_u32vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u32vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u32vec4 v1(0);
+ glm::lowp_u32vec4 v2(v1);
+ glm::mediump_u32vec4 v3(v1);
+ glm::highp_u32vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u32vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u32vec4(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u64vec2 v1(0);
+ glm::lowp_u64vec2 v2(v1);
+ glm::mediump_u64vec2 v3(v1);
+ glm::highp_u64vec2 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u64vec2(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec2(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec2(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u64vec3 v1(0);
+ glm::lowp_u64vec3 v2(v1);
+ glm::mediump_u64vec3 v3(v1);
+ glm::highp_u64vec3 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u64vec3(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec3(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec3(v4))) ? 0 : 1;
+ }
+
+ {
+ glm::u64vec4 v1(0);
+ glm::lowp_u64vec4 v2(v1);
+ glm::mediump_u64vec4 v3(v1);
+ glm::highp_u64vec4 v4(v1);
+
+ Error += glm::all(glm::equal(v1, glm::u64vec4(v2))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec4(v3))) ? 0 : 1;
+ Error += glm::all(glm::equal(v1, glm::u64vec4(v4))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_fmat_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::mat2) != 16;
+ Error += sizeof(glm::mat3) != 36;
+ Error += sizeof(glm::mat4) != 64;
+ Error += sizeof(glm::mat2x2) != 16;
+ Error += sizeof(glm::mat2x3) != 24;
+ Error += sizeof(glm::mat2x4) != 32;
+ Error += sizeof(glm::mat3x2) != 24;
+ Error += sizeof(glm::mat3x3) != 36;
+ Error += sizeof(glm::mat3x4) != 48;
+ Error += sizeof(glm::mat4x2) != 32;
+ Error += sizeof(glm::mat4x3) != 48;
+ Error += sizeof(glm::mat4x4) != 64;
+
+ Error += sizeof(glm::fmat2) != 16;
+ Error += sizeof(glm::fmat3) != 36;
+ Error += sizeof(glm::fmat4) != 64;
+ Error += sizeof(glm::fmat2x2) != 16;
+ Error += sizeof(glm::fmat2x3) != 24;
+ Error += sizeof(glm::fmat2x4) != 32;
+ Error += sizeof(glm::fmat3x2) != 24;
+ Error += sizeof(glm::fmat3x3) != 36;
+ Error += sizeof(glm::fmat3x4) != 48;
+ Error += sizeof(glm::fmat4x2) != 32;
+ Error += sizeof(glm::fmat4x3) != 48;
+ Error += sizeof(glm::fmat4x4) != 64;
+
+ Error += sizeof(glm::f32mat2) != 16;
+ Error += sizeof(glm::f32mat3) != 36;
+ Error += sizeof(glm::f32mat4) != 64;
+ Error += sizeof(glm::f32mat2x2) != 16;
+ Error += sizeof(glm::f32mat2x3) != 24;
+ Error += sizeof(glm::f32mat2x4) != 32;
+ Error += sizeof(glm::f32mat3x2) != 24;
+ Error += sizeof(glm::f32mat3x3) != 36;
+ Error += sizeof(glm::f32mat3x4) != 48;
+ Error += sizeof(glm::f32mat4x2) != 32;
+ Error += sizeof(glm::f32mat4x3) != 48;
+ Error += sizeof(glm::f32mat4x4) != 64;
+
+
+ Error += sizeof(glm::lowp_mat2) != 16;
+ Error += sizeof(glm::lowp_mat3) != 36;
+ Error += sizeof(glm::lowp_mat4) != 64;
+ Error += sizeof(glm::lowp_mat2x2) != 16;
+ Error += sizeof(glm::lowp_mat2x3) != 24;
+ Error += sizeof(glm::lowp_mat2x4) != 32;
+ Error += sizeof(glm::lowp_mat3x2) != 24;
+ Error += sizeof(glm::lowp_mat3x3) != 36;
+ Error += sizeof(glm::lowp_mat3x4) != 48;
+ Error += sizeof(glm::lowp_mat4x2) != 32;
+ Error += sizeof(glm::lowp_mat4x3) != 48;
+ Error += sizeof(glm::lowp_mat4x4) != 64;
+
+ Error += sizeof(glm::lowp_fmat2) != 16;
+ Error += sizeof(glm::lowp_fmat3) != 36;
+ Error += sizeof(glm::lowp_fmat4) != 64;
+ Error += sizeof(glm::lowp_fmat2x2) != 16;
+ Error += sizeof(glm::lowp_fmat2x3) != 24;
+ Error += sizeof(glm::lowp_fmat2x4) != 32;
+ Error += sizeof(glm::lowp_fmat3x2) != 24;
+ Error += sizeof(glm::lowp_fmat3x3) != 36;
+ Error += sizeof(glm::lowp_fmat3x4) != 48;
+ Error += sizeof(glm::lowp_fmat4x2) != 32;
+ Error += sizeof(glm::lowp_fmat4x3) != 48;
+ Error += sizeof(glm::lowp_fmat4x4) != 64;
+
+ Error += sizeof(glm::lowp_f32mat2) != 16;
+ Error += sizeof(glm::lowp_f32mat3) != 36;
+ Error += sizeof(glm::lowp_f32mat4) != 64;
+ Error += sizeof(glm::lowp_f32mat2x2) != 16;
+ Error += sizeof(glm::lowp_f32mat2x3) != 24;
+ Error += sizeof(glm::lowp_f32mat2x4) != 32;
+ Error += sizeof(glm::lowp_f32mat3x2) != 24;
+ Error += sizeof(glm::lowp_f32mat3x3) != 36;
+ Error += sizeof(glm::lowp_f32mat3x4) != 48;
+ Error += sizeof(glm::lowp_f32mat4x2) != 32;
+ Error += sizeof(glm::lowp_f32mat4x3) != 48;
+ Error += sizeof(glm::lowp_f32mat4x4) != 64;
+
+ Error += sizeof(glm::mediump_mat2) != 16;
+ Error += sizeof(glm::mediump_mat3) != 36;
+ Error += sizeof(glm::mediump_mat4) != 64;
+ Error += sizeof(glm::mediump_mat2x2) != 16;
+ Error += sizeof(glm::mediump_mat2x3) != 24;
+ Error += sizeof(glm::mediump_mat2x4) != 32;
+ Error += sizeof(glm::mediump_mat3x2) != 24;
+ Error += sizeof(glm::mediump_mat3x3) != 36;
+ Error += sizeof(glm::mediump_mat3x4) != 48;
+ Error += sizeof(glm::mediump_mat4x2) != 32;
+ Error += sizeof(glm::mediump_mat4x3) != 48;
+ Error += sizeof(glm::mediump_mat4x4) != 64;
+
+ Error += sizeof(glm::mediump_fmat2) != 16;
+ Error += sizeof(glm::mediump_fmat3) != 36;
+ Error += sizeof(glm::mediump_fmat4) != 64;
+ Error += sizeof(glm::mediump_fmat2x2) != 16;
+ Error += sizeof(glm::mediump_fmat2x3) != 24;
+ Error += sizeof(glm::mediump_fmat2x4) != 32;
+ Error += sizeof(glm::mediump_fmat3x2) != 24;
+ Error += sizeof(glm::mediump_fmat3x3) != 36;
+ Error += sizeof(glm::mediump_fmat3x4) != 48;
+ Error += sizeof(glm::mediump_fmat4x2) != 32;
+ Error += sizeof(glm::mediump_fmat4x3) != 48;
+ Error += sizeof(glm::mediump_fmat4x4) != 64;
+
+ Error += sizeof(glm::mediump_f32mat2) != 16;
+ Error += sizeof(glm::mediump_f32mat3) != 36;
+ Error += sizeof(glm::mediump_f32mat4) != 64;
+ Error += sizeof(glm::mediump_f32mat2x2) != 16;
+ Error += sizeof(glm::mediump_f32mat2x3) != 24;
+ Error += sizeof(glm::mediump_f32mat2x4) != 32;
+ Error += sizeof(glm::mediump_f32mat3x2) != 24;
+ Error += sizeof(glm::mediump_f32mat3x3) != 36;
+ Error += sizeof(glm::mediump_f32mat3x4) != 48;
+ Error += sizeof(glm::mediump_f32mat4x2) != 32;
+ Error += sizeof(glm::mediump_f32mat4x3) != 48;
+ Error += sizeof(glm::mediump_f32mat4x4) != 64;
+
+ Error += sizeof(glm::highp_mat2) != 16;
+ Error += sizeof(glm::highp_mat3) != 36;
+ Error += sizeof(glm::highp_mat4) != 64;
+ Error += sizeof(glm::highp_mat2x2) != 16;
+ Error += sizeof(glm::highp_mat2x3) != 24;
+ Error += sizeof(glm::highp_mat2x4) != 32;
+ Error += sizeof(glm::highp_mat3x2) != 24;
+ Error += sizeof(glm::highp_mat3x3) != 36;
+ Error += sizeof(glm::highp_mat3x4) != 48;
+ Error += sizeof(glm::highp_mat4x2) != 32;
+ Error += sizeof(glm::highp_mat4x3) != 48;
+ Error += sizeof(glm::highp_mat4x4) != 64;
+
+ Error += sizeof(glm::highp_fmat2) != 16;
+ Error += sizeof(glm::highp_fmat3) != 36;
+ Error += sizeof(glm::highp_fmat4) != 64;
+ Error += sizeof(glm::highp_fmat2x2) != 16;
+ Error += sizeof(glm::highp_fmat2x3) != 24;
+ Error += sizeof(glm::highp_fmat2x4) != 32;
+ Error += sizeof(glm::highp_fmat3x2) != 24;
+ Error += sizeof(glm::highp_fmat3x3) != 36;
+ Error += sizeof(glm::highp_fmat3x4) != 48;
+ Error += sizeof(glm::highp_fmat4x2) != 32;
+ Error += sizeof(glm::highp_fmat4x3) != 48;
+ Error += sizeof(glm::highp_fmat4x4) != 64;
+
+ Error += sizeof(glm::highp_f32mat2) != 16;
+ Error += sizeof(glm::highp_f32mat3) != 36;
+ Error += sizeof(glm::highp_f32mat4) != 64;
+ Error += sizeof(glm::highp_f32mat2x2) != 16;
+ Error += sizeof(glm::highp_f32mat2x3) != 24;
+ Error += sizeof(glm::highp_f32mat2x4) != 32;
+ Error += sizeof(glm::highp_f32mat3x2) != 24;
+ Error += sizeof(glm::highp_f32mat3x3) != 36;
+ Error += sizeof(glm::highp_f32mat3x4) != 48;
+ Error += sizeof(glm::highp_f32mat4x2) != 32;
+ Error += sizeof(glm::highp_f32mat4x3) != 48;
+ Error += sizeof(glm::highp_f32mat4x4) != 64;
+
+ return Error;
+}
+
+static int test_dmat_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::f64mat2) != 32;
+ Error += sizeof(glm::f64mat3) != 72;
+ Error += sizeof(glm::f64mat4) != 128;
+ Error += sizeof(glm::f64mat2x2) != 32;
+ Error += sizeof(glm::f64mat2x3) != 48;
+ Error += sizeof(glm::f64mat2x4) != 64;
+ Error += sizeof(glm::f64mat3x2) != 48;
+ Error += sizeof(glm::f64mat3x3) != 72;
+ Error += sizeof(glm::f64mat3x4) != 96;
+ Error += sizeof(glm::f64mat4x2) != 64;
+ Error += sizeof(glm::f64mat4x3) != 96;
+ Error += sizeof(glm::f64mat4x4) != 128;
+
+ Error += sizeof(glm::lowp_f64mat2) != 32;
+ Error += sizeof(glm::lowp_f64mat3) != 72;
+ Error += sizeof(glm::lowp_f64mat4) != 128;
+ Error += sizeof(glm::lowp_f64mat2x2) != 32;
+ Error += sizeof(glm::lowp_f64mat2x3) != 48;
+ Error += sizeof(glm::lowp_f64mat2x4) != 64;
+ Error += sizeof(glm::lowp_f64mat3x2) != 48;
+ Error += sizeof(glm::lowp_f64mat3x3) != 72;
+ Error += sizeof(glm::lowp_f64mat3x4) != 96;
+ Error += sizeof(glm::lowp_f64mat4x2) != 64;
+ Error += sizeof(glm::lowp_f64mat4x3) != 96;
+ Error += sizeof(glm::lowp_f64mat4x4) != 128;
+
+ Error += sizeof(glm::mediump_f64mat2) != 32;
+ Error += sizeof(glm::mediump_f64mat3) != 72;
+ Error += sizeof(glm::mediump_f64mat4) != 128;
+ Error += sizeof(glm::mediump_f64mat2x2) != 32;
+ Error += sizeof(glm::mediump_f64mat2x3) != 48;
+ Error += sizeof(glm::mediump_f64mat2x4) != 64;
+ Error += sizeof(glm::mediump_f64mat3x2) != 48;
+ Error += sizeof(glm::mediump_f64mat3x3) != 72;
+ Error += sizeof(glm::mediump_f64mat3x4) != 96;
+ Error += sizeof(glm::mediump_f64mat4x2) != 64;
+ Error += sizeof(glm::mediump_f64mat4x3) != 96;
+ Error += sizeof(glm::mediump_f64mat4x4) != 128;
+
+ Error += sizeof(glm::highp_f64mat2) != 32;
+ Error += sizeof(glm::highp_f64mat3) != 72;
+ Error += sizeof(glm::highp_f64mat4) != 128;
+ Error += sizeof(glm::highp_f64mat2x2) != 32;
+ Error += sizeof(glm::highp_f64mat2x3) != 48;
+ Error += sizeof(glm::highp_f64mat2x4) != 64;
+ Error += sizeof(glm::highp_f64mat3x2) != 48;
+ Error += sizeof(glm::highp_f64mat3x3) != 72;
+ Error += sizeof(glm::highp_f64mat3x4) != 96;
+ Error += sizeof(glm::highp_f64mat4x2) != 64;
+ Error += sizeof(glm::highp_f64mat4x3) != 96;
+ Error += sizeof(glm::highp_f64mat4x4) != 128;
+
+ return Error;
+}
+
+static int test_quat_size()
+{
+ int Error = 0;
+
+ Error += sizeof(glm::f32quat) != 16;
+ Error += sizeof(glm::f64quat) != 32;
+
+ Error += sizeof(glm::lowp_f32quat) != 16;
+ Error += sizeof(glm::lowp_f64quat) != 32;
+
+ Error += sizeof(glm::mediump_f32quat) != 16;
+ Error += sizeof(glm::mediump_f64quat) != 32;
+
+ Error += sizeof(glm::highp_f32quat) != 16;
+ Error += sizeof(glm::highp_f64quat) != 32;
+
+ return Error;
+}
+
+static int test_quat_precision()
+{
+ int Error = 0;
+
+ {
+ glm::f32quat q1(0.f, glm::vec3(0.f, 0.f, 1.f));
+ glm::lowp_f32quat qA(q1);
+ glm::mediump_f32quat qB(q1);
+ glm::highp_f32quat qC(q1);
+ glm::f32quat q2(qA);
+ glm::f32quat q3(qB);
+ glm::f32quat q4(qC);
+
+ Error += glm::all(glm::equal(q1, q2, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(q1, q3, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(q1, q4, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+static int test_fvec_conversion()
+{
+ int Error(0);
+
+ {
+ glm::highp_vec4 a = glm::vec4(1, 2, 3, 4);
+ glm::mediump_vec4 b = glm::vec4(1, 2, 3, 4);
+ glm::lowp_vec4 c = b;
+ glm::mediump_vec4 d = c;
+ glm::lowp_ivec4 e = glm::ivec4(d);
+ glm::lowp_ivec3 f = glm::ivec3(e);
+
+ Error += glm::all(glm::equal(b, d, glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+#if GLM_HAS_OPENMP
+static int test_openmp()
+{
+ std::vector<glm::u8vec3> VectorA(1000);
+ std::vector<glm::u8vec3> VectorB(1000);
+ std::vector<glm::u8vec3> VectorC(1000);
+
+ for (std::size_t i = 0; i < VectorA.size(); ++i)
+ {
+ VectorA[i] = glm::u8vec3(1, 1, 1);
+ VectorB[i] = glm::u8vec3(1, 1, 1);
+ }
+
+ #pragma omp parallel for default(none) shared(VectorA, VectorB, VectorC)
+ for (int i = 0; i < static_cast<int>(VectorC.size()); ++i)
+ {
+ VectorC[i] = VectorA[i] + VectorB[i];
+ }
+
+ return 0;
+}
+#endif//GLM_HAS_OPENMP
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_scalar_size();
+ Error += test_fvec_size();
+
+ Error += test_fvec_precision();
+ Error += test_fvec_conversion();
+
+ Error += test_dvec_precision();
+
+ Error += test_uvec_size();
+ Error += test_uvec_precision();
+ Error += test_ivec_size();
+ Error += test_ivec_precision();
+
+ Error += test_fmat_size();
+ Error += test_dmat_size();
+ Error += test_quat_size();
+ Error += test_quat_precision();
+
+# if GLM_HAS_OPENMP
+ Error += test_openmp();
+# endif//
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp b/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp
new file mode 100644
index 0000000..6fcd305
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp
@@ -0,0 +1,335 @@
+#include <glm/gtc/type_ptr.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+
+int test_value_ptr_vec()
+{
+ int Error = 0;
+
+ {
+ glm::vec2 v(1.0);
+ float * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::vec3 v(1.0);
+ float * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::vec4 v(1.0);
+ float * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+
+ {
+ glm::dvec2 v(1.0);
+ double * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::dvec3 v(1.0);
+ double * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::dvec4 v(1.0);
+ double * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_value_ptr_vec_const()
+{
+ int Error = 0;
+
+ {
+ glm::vec2 const v(1.0);
+ float const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::vec3 const v(1.0);
+ float const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::vec4 const v(1.0);
+ float const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+
+ {
+ glm::dvec2 const v(1.0);
+ double const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::dvec3 const v(1.0);
+ double const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+ {
+ glm::dvec4 const v(1.0);
+ double const * p = glm::value_ptr(v);
+ Error += p == &v[0] ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_value_ptr_mat()
+{
+ int Error = 0;
+
+ {
+ glm::mat2x2 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat2x3 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat2x4 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x2 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x3 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x4 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x2 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x3 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x4 m(1.0);
+ float * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_value_ptr_mat_const()
+{
+ int Error = 0;
+
+ {
+ glm::mat2x2 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat2x3 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat2x4 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x2 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x3 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat3x4 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x2 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x3 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+ {
+ glm::mat4x4 const m(1.0);
+ float const * p = glm::value_ptr(m);
+ Error += p == &m[0][0] ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_make_pointer_mat()
+{
+ int Error = 0;
+
+ float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ double ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+
+ glm::mat2x2 Mat2x2A = glm::make_mat2x2(ArrayA);
+ glm::mat2x3 Mat2x3A = glm::make_mat2x3(ArrayA);
+ glm::mat2x4 Mat2x4A = glm::make_mat2x4(ArrayA);
+ glm::mat3x2 Mat3x2A = glm::make_mat3x2(ArrayA);
+ glm::mat3x3 Mat3x3A = glm::make_mat3x3(ArrayA);
+ glm::mat3x4 Mat3x4A = glm::make_mat3x4(ArrayA);
+ glm::mat4x2 Mat4x2A = glm::make_mat4x2(ArrayA);
+ glm::mat4x3 Mat4x3A = glm::make_mat4x3(ArrayA);
+ glm::mat4x4 Mat4x4A = glm::make_mat4x4(ArrayA);
+
+ glm::dmat2x2 Mat2x2B = glm::make_mat2x2(ArrayB);
+ glm::dmat2x3 Mat2x3B = glm::make_mat2x3(ArrayB);
+ glm::dmat2x4 Mat2x4B = glm::make_mat2x4(ArrayB);
+ glm::dmat3x2 Mat3x2B = glm::make_mat3x2(ArrayB);
+ glm::dmat3x3 Mat3x3B = glm::make_mat3x3(ArrayB);
+ glm::dmat3x4 Mat3x4B = glm::make_mat3x4(ArrayB);
+ glm::dmat4x2 Mat4x2B = glm::make_mat4x2(ArrayB);
+ glm::dmat4x3 Mat4x3B = glm::make_mat4x3(ArrayB);
+ glm::dmat4x4 Mat4x4B = glm::make_mat4x4(ArrayB);
+
+ return Error;
+}
+
+int test_make_pointer_vec()
+{
+ int Error = 0;
+
+ float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ int ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ bool ArrayC[] = {true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false};
+
+ glm::vec2 Vec2A = glm::make_vec2(ArrayA);
+ glm::vec3 Vec3A = glm::make_vec3(ArrayA);
+ glm::vec4 Vec4A = glm::make_vec4(ArrayA);
+
+ glm::ivec2 Vec2B = glm::make_vec2(ArrayB);
+ glm::ivec3 Vec3B = glm::make_vec3(ArrayB);
+ glm::ivec4 Vec4B = glm::make_vec4(ArrayB);
+
+ glm::bvec2 Vec2C = glm::make_vec2(ArrayC);
+ glm::bvec3 Vec3C = glm::make_vec3(ArrayC);
+ glm::bvec4 Vec4C = glm::make_vec4(ArrayC);
+
+ return Error;
+}
+
+int test_make_vec1()
+{
+ int Error = 0;
+
+ glm::ivec1 const v1 = glm::make_vec1(glm::ivec1(2));
+ Error += v1 == glm::ivec1(2) ? 0 : 1;
+
+ glm::ivec1 const v2 = glm::make_vec1(glm::ivec2(2));
+ Error += v2 == glm::ivec1(2) ? 0 : 1;
+
+ glm::ivec1 const v3 = glm::make_vec1(glm::ivec3(2));
+ Error += v3 == glm::ivec1(2) ? 0 : 1;
+
+ glm::ivec1 const v4 = glm::make_vec1(glm::ivec4(2));
+ Error += v3 == glm::ivec1(2) ? 0 : 1;
+
+ return Error;
+}
+
+int test_make_vec2()
+{
+ int Error = 0;
+
+ glm::ivec2 const v1 = glm::make_vec2(glm::ivec1(2));
+ Error += v1 == glm::ivec2(2, 0) ? 0 : 1;
+
+ glm::ivec2 const v2 = glm::make_vec2(glm::ivec2(2));
+ Error += v2 == glm::ivec2(2, 2) ? 0 : 1;
+
+ glm::ivec2 const v3 = glm::make_vec2(glm::ivec3(2));
+ Error += v3 == glm::ivec2(2, 2) ? 0 : 1;
+
+ glm::ivec2 const v4 = glm::make_vec2(glm::ivec4(2));
+ Error += v3 == glm::ivec2(2, 2) ? 0 : 1;
+
+ return Error;
+}
+
+int test_make_vec3()
+{
+ int Error = 0;
+
+ glm::ivec3 const v1 = glm::make_vec3(glm::ivec1(2));
+ Error += v1 == glm::ivec3(2, 0, 0) ? 0 : 1;
+
+ glm::ivec3 const v2 = glm::make_vec3(glm::ivec2(2));
+ Error += v2 == glm::ivec3(2, 2, 0) ? 0 : 1;
+
+ glm::ivec3 const v3 = glm::make_vec3(glm::ivec3(2));
+ Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1;
+
+ glm::ivec3 const v4 = glm::make_vec3(glm::ivec4(2));
+ Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1;
+
+ return Error;
+}
+
+int test_make_vec4()
+{
+ int Error = 0;
+
+ glm::ivec4 const v1 = glm::make_vec4(glm::ivec1(2));
+ Error += v1 == glm::ivec4(2, 0, 0, 1) ? 0 : 1;
+
+ glm::ivec4 const v2 = glm::make_vec4(glm::ivec2(2));
+ Error += v2 == glm::ivec4(2, 2, 0, 1) ? 0 : 1;
+
+ glm::ivec4 const v3 = glm::make_vec4(glm::ivec3(2));
+ Error += v3 == glm::ivec4(2, 2, 2, 1) ? 0 : 1;
+
+ glm::ivec4 const v4 = glm::make_vec4(glm::ivec4(2));
+ Error += v4 == glm::ivec4(2, 2, 2, 2) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_make_vec1();
+ Error += test_make_vec2();
+ Error += test_make_vec3();
+ Error += test_make_vec4();
+ Error += test_make_pointer_vec();
+ Error += test_make_pointer_mat();
+ Error += test_value_ptr_vec();
+ Error += test_value_ptr_vec_const();
+ Error += test_value_ptr_mat();
+ Error += test_value_ptr_mat_const();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_ulp.cpp b/3rdparty/glm/source/test/gtc/gtc_ulp.cpp
new file mode 100644
index 0000000..d5074a3
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_ulp.cpp
@@ -0,0 +1,99 @@
+#include <glm/gtc/ulp.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <limits>
+
+int test_ulp_float_dist()
+{
+ int Error = 0;
+
+ float A = 1.0f;
+
+ float B = glm::next_float(A);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ float C = glm::prev_float(B);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ int D = glm::float_distance(A, B);
+ Error += D == 1 ? 0 : 1;
+ int E = glm::float_distance(A, C);
+ Error += E == 0 ? 0 : 1;
+
+ return Error;
+}
+
+int test_ulp_float_step()
+{
+ int Error = 0;
+
+ float A = 1.0f;
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ float B = glm::next_float(A, i);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ float C = glm::prev_float(B, i);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ int D = glm::float_distance(A, B);
+ Error += D == i ? 0 : 1;
+ int E = glm::float_distance(A, C);
+ Error += E == 0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_ulp_double_dist()
+{
+ int Error = 0;
+
+ double A = 1.0;
+
+ double B = glm::next_float(A);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ double C = glm::prev_float(B);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ glm::int64 const D = glm::float_distance(A, B);
+ Error += D == 1 ? 0 : 1;
+ glm::int64 const E = glm::float_distance(A, C);
+ Error += E == 0 ? 0 : 1;
+
+ return Error;
+}
+
+int test_ulp_double_step()
+{
+ int Error = 0;
+
+ double A = 1.0;
+
+ for(int i = 10; i < 1000; i *= 10)
+ {
+ double B = glm::next_float(A, i);
+ Error += glm::notEqual(A, B, 0) ? 0 : 1;
+ double C = glm::prev_float(B, i);
+ Error += glm::equal(A, C, 0) ? 0 : 1;
+
+ glm::int64 const D = glm::float_distance(A, B);
+ Error += D == i ? 0 : 1;
+ glm::int64 const E = glm::float_distance(A, C);
+ Error += E == 0 ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_ulp_float_dist();
+ Error += test_ulp_float_step();
+ Error += test_ulp_double_dist();
+ Error += test_ulp_double_step();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp b/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp
new file mode 100644
index 0000000..af39620
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2010-09-16
+// Updated : 2011-05-27
+// Licence : This source is under MIT licence
+// File : test/gtc/type_ptr.cpp
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define GLM_FORCE_RADIANS
+#include <glm/gtc/user_defined_type.hpp>
+
+int test_make_pointer_vec()
+{
+ int Error = 0;
+
+ glm::func();
+ //func();
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_make_pointer_vec();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtc/gtc_vec1.cpp b/3rdparty/glm/source/test/gtc/gtc_vec1.cpp
new file mode 100644
index 0000000..268d95e
--- /dev/null
+++ b/3rdparty/glm/source/test/gtc/gtc_vec1.cpp
@@ -0,0 +1,8 @@
+#include <glm/gtc/vec1.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/CMakeLists.txt b/3rdparty/glm/source/test/gtx/CMakeLists.txt
new file mode 100644
index 0000000..ad7bf49
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/CMakeLists.txt
@@ -0,0 +1,59 @@
+glmCreateTestGTC(gtx)
+glmCreateTestGTC(gtx_associated_min_max)
+glmCreateTestGTC(gtx_closest_point)
+glmCreateTestGTC(gtx_color_encoding)
+glmCreateTestGTC(gtx_color_space_YCoCg)
+glmCreateTestGTC(gtx_color_space)
+glmCreateTestGTC(gtx_common)
+glmCreateTestGTC(gtx_compatibility)
+glmCreateTestGTC(gtx_component_wise)
+glmCreateTestGTC(gtx_easing)
+glmCreateTestGTC(gtx_euler_angle)
+glmCreateTestGTC(gtx_extend)
+glmCreateTestGTC(gtx_extended_min_max)
+glmCreateTestGTC(gtx_exterior_product)
+glmCreateTestGTC(gtx_fast_exponential)
+glmCreateTestGTC(gtx_fast_square_root)
+glmCreateTestGTC(gtx_fast_trigonometry)
+glmCreateTestGTC(gtx_functions)
+glmCreateTestGTC(gtx_gradient_paint)
+glmCreateTestGTC(gtx_handed_coordinate_space)
+glmCreateTestGTC(gtx_integer)
+glmCreateTestGTC(gtx_intersect)
+glmCreateTestGTC(gtx_io)
+glmCreateTestGTC(gtx_load)
+glmCreateTestGTC(gtx_log_base)
+glmCreateTestGTC(gtx_matrix_cross_product)
+glmCreateTestGTC(gtx_matrix_decompose)
+glmCreateTestGTC(gtx_matrix_factorisation)
+glmCreateTestGTC(gtx_matrix_interpolation)
+glmCreateTestGTC(gtx_matrix_major_storage)
+glmCreateTestGTC(gtx_matrix_operation)
+glmCreateTestGTC(gtx_matrix_query)
+glmCreateTestGTC(gtx_matrix_transform_2d)
+glmCreateTestGTC(gtx_norm)
+glmCreateTestGTC(gtx_normal)
+glmCreateTestGTC(gtx_normalize_dot)
+glmCreateTestGTC(gtx_number_precision)
+glmCreateTestGTC(gtx_orthonormalize)
+glmCreateTestGTC(gtx_optimum_pow)
+glmCreateTestGTC(gtx_pca)
+glmCreateTestGTC(gtx_perpendicular)
+glmCreateTestGTC(gtx_polar_coordinates)
+glmCreateTestGTC(gtx_projection)
+glmCreateTestGTC(gtx_quaternion)
+glmCreateTestGTC(gtx_dual_quaternion)
+glmCreateTestGTC(gtx_range)
+glmCreateTestGTC(gtx_rotate_normalized_axis)
+glmCreateTestGTC(gtx_rotate_vector)
+glmCreateTestGTC(gtx_scalar_multiplication)
+glmCreateTestGTC(gtx_scalar_relational)
+glmCreateTestGTC(gtx_spline)
+glmCreateTestGTC(gtx_string_cast)
+glmCreateTestGTC(gtx_texture)
+glmCreateTestGTC(gtx_type_aligned)
+glmCreateTestGTC(gtx_type_trait)
+glmCreateTestGTC(gtx_vec_swizzle)
+glmCreateTestGTC(gtx_vector_angle)
+glmCreateTestGTC(gtx_vector_query)
+glmCreateTestGTC(gtx_wrap)
diff --git a/3rdparty/glm/source/test/gtx/gtx.cpp b/3rdparty/glm/source/test/gtx/gtx.cpp
new file mode 100644
index 0000000..1b143b6
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx.cpp
@@ -0,0 +1,8 @@
+#include <glm/ext.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp
new file mode 100644
index 0000000..9007f8a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp
@@ -0,0 +1,10 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/associated_min_max.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp b/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp
new file mode 100644
index 0000000..0f6303a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/closest_point.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp b/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp
new file mode 100644
index 0000000..8b499be
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp
@@ -0,0 +1,51 @@
+#include <glm/gtx/color_encoding.hpp>
+#include <glm/gtc/color_space.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+
+namespace srgb
+{
+ int test()
+ {
+ int Error(0);
+
+ glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0);
+/*
+ {
+ glm::vec3 const ColorSRGB = glm::convertLinearSRGBToD65XYZ(ColorSourceRGB);
+ glm::vec3 const ColorRGB = glm::convertD65XYZToLinearSRGB(ColorSRGB);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+*/
+ {
+ glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f);
+ glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0);
+
+ {
+ glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA);
+ glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f);
+ glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f);
+ Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace srgb
+
+int main()
+{
+ int Error(0);
+
+ Error += srgb::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_color_space.cpp b/3rdparty/glm/source/test/gtx/gtx_color_space.cpp
new file mode 100644
index 0000000..a23d2c8
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_color_space.cpp
@@ -0,0 +1,20 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/color_space.hpp>
+
+int test_saturation()
+{
+ int Error(0);
+
+ glm::vec4 Color = glm::saturation(1.0f, glm::vec4(1.0, 0.5, 0.0, 1.0));
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_saturation();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp b/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp
new file mode 100644
index 0000000..2ca131d
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/color_space_YCoCg.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_common.cpp b/3rdparty/glm/source/test/gtx/gtx_common.cpp
new file mode 100644
index 0000000..fd4fa99
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_common.cpp
@@ -0,0 +1,161 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/common.hpp>
+#include <glm/gtc/integer.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/common.hpp>
+
+namespace fmod_
+{
+ template<typename genType>
+ GLM_FUNC_QUALIFIER genType modTrunc(genType a, genType b)
+ {
+ return a - b * glm::trunc(a / b);
+ }
+
+ int test()
+ {
+ int Error(0);
+
+ {
+ float A0(3.0);
+ float B0(2.0f);
+ float C0 = glm::fmod(A0, B0);
+
+ Error += glm::abs(C0 - 1.0f) < 0.00001f ? 0 : 1;
+
+ glm::vec4 A1(3.0);
+ float B1(2.0f);
+ glm::vec4 C1 = glm::fmod(A1, B1);
+
+ Error += glm::all(glm::epsilonEqual(C1, glm::vec4(1.0f), 0.00001f)) ? 0 : 1;
+
+ glm::vec4 A2(3.0);
+ glm::vec4 B2(2.0f);
+ glm::vec4 C2 = glm::fmod(A2, B2);
+
+ Error += glm::all(glm::epsilonEqual(C2, glm::vec4(1.0f), 0.00001f)) ? 0 : 1;
+
+ glm::ivec4 A3(3);
+ int B3(2);
+ glm::ivec4 C3 = glm::fmod(A3, B3);
+
+ Error += glm::all(glm::equal(C3, glm::ivec4(1))) ? 0 : 1;
+
+ glm::ivec4 A4(3);
+ glm::ivec4 B4(2);
+ glm::ivec4 C4 = glm::fmod(A4, B4);
+
+ Error += glm::all(glm::equal(C4, glm::ivec4(1))) ? 0 : 1;
+ }
+
+ {
+ float A0(22.0);
+ float B0(-10.0f);
+ float C0 = glm::fmod(A0, B0);
+
+ Error += glm::abs(C0 - 2.0f) < 0.00001f ? 0 : 1;
+
+ glm::vec4 A1(22.0);
+ float B1(-10.0f);
+ glm::vec4 C1 = glm::fmod(A1, B1);
+
+ Error += glm::all(glm::epsilonEqual(C1, glm::vec4(2.0f), 0.00001f)) ? 0 : 1;
+
+ glm::vec4 A2(22.0);
+ glm::vec4 B2(-10.0f);
+ glm::vec4 C2 = glm::fmod(A2, B2);
+
+ Error += glm::all(glm::epsilonEqual(C2, glm::vec4(2.0f), 0.00001f)) ? 0 : 1;
+
+ glm::ivec4 A3(22);
+ int B3(-10);
+ glm::ivec4 C3 = glm::fmod(A3, B3);
+
+ Error += glm::all(glm::equal(C3, glm::ivec4(2))) ? 0 : 1;
+
+ glm::ivec4 A4(22);
+ glm::ivec4 B4(-10);
+ glm::ivec4 C4 = glm::fmod(A4, B4);
+
+ Error += glm::all(glm::equal(C4, glm::ivec4(2))) ? 0 : 1;
+ }
+
+ // http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod
+ {
+ for (float y = -10.0f; y < 10.0f; y += 0.1f)
+ for (float x = -10.0f; x < 10.0f; x += 0.1f)
+ {
+ float const A(std::fmod(x, y));
+ //float const B(std::remainder(x, y));
+ float const C(glm::fmod(x, y));
+ float const D(modTrunc(x, y));
+
+ //Error += glm::epsilonEqual(A, B, 0.0001f) ? 0 : 1;
+ //assert(!Error);
+ Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
+ assert(!Error);
+ Error += glm::epsilonEqual(A, D, 0.00001f) ? 0 : 1;
+ assert(!Error);
+ }
+ }
+
+ return Error;
+ }
+}//namespace fmod_
+
+int test_isdenormal()
+{
+ int Error = 0;
+
+ bool A = glm::isdenormal(1.0f);
+ Error += !A ? 0 : 1;
+
+ glm::bvec1 B = glm::isdenormal(glm::vec1(1.0f));
+ Error += !glm::any(B) ? 0 : 1;
+
+ glm::bvec2 C = glm::isdenormal(glm::vec2(1.0f));
+ Error += !glm::any(C) ? 0 : 1;
+
+ glm::bvec3 D = glm::isdenormal(glm::vec3(1.0f));
+ Error += !glm::any(D) ? 0 : 1;
+
+ glm::bvec4 E = glm::isdenormal(glm::vec4(1.0f));
+ Error += !glm::any(E) ? 0 : 1;
+
+ return Error;
+}
+
+int test_openBounded()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::openBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+ Error += !glm::all(glm::openBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+ Error += !glm::all(glm::openBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+
+ return Error;
+}
+
+int test_closeBounded()
+{
+ int Error = 0;
+
+ Error += glm::all(glm::closeBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+ Error += glm::all(glm::closeBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+ Error += glm::all(glm::closeBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_isdenormal();
+ Error += ::fmod_::test();
+ Error += test_openBounded();
+ Error += test_closeBounded();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp b/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp
new file mode 100644
index 0000000..e5351ce
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp
@@ -0,0 +1,19 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/compatibility.hpp>
+
+int main()
+{
+ int Error(0);
+
+ Error += glm::isfinite(1.0f) ? 0 : 1;
+ Error += glm::isfinite(1.0) ? 0 : 1;
+ Error += glm::isfinite(-1.0f) ? 0 : 1;
+ Error += glm::isfinite(-1.0) ? 0 : 1;
+
+ Error += glm::all(glm::isfinite(glm::vec4(1.0f))) ? 0 : 1;
+ Error += glm::all(glm::isfinite(glm::dvec4(1.0))) ? 0 : 1;
+ Error += glm::all(glm::isfinite(glm::vec4(-1.0f))) ? 0 : 1;
+ Error += glm::all(glm::isfinite(glm::dvec4(-1.0))) ? 0 : 1;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp b/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp
new file mode 100644
index 0000000..29c81af
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp
@@ -0,0 +1,116 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/component_wise.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/constants.hpp>
+#include <limits>
+
+namespace compNormalize
+{
+ int run()
+ {
+ int Error(0);
+
+ {
+ glm::vec4 const A = glm::compNormalize<float>(glm::u8vec4(0, 127, 128, 255));
+
+ Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += A.y < 0.5f ? 0 : 1;
+ Error += A.z > 0.5f ? 0 : 1;
+ Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const A = glm::compNormalize<float>(glm::i8vec4(-128, -1, 0, 127));
+
+ Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += A.y < 0.0f ? 0 : 1;
+ Error += A.z > 0.0f ? 0 : 1;
+ Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const A = glm::compNormalize<float>(glm::u16vec4(
+ std::numeric_limits<glm::u16>::min(),
+ (std::numeric_limits<glm::u16>::max() >> 1) + 0,
+ (std::numeric_limits<glm::u16>::max() >> 1) + 1,
+ std::numeric_limits<glm::u16>::max()));
+
+ Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += A.y < 0.5f ? 0 : 1;
+ Error += A.z > 0.5f ? 0 : 1;
+ Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 const A = glm::compNormalize<float>(glm::i16vec4(
+ std::numeric_limits<glm::i16>::min(),
+ static_cast<glm::i16>(-1),
+ static_cast<glm::i16>(0),
+ std::numeric_limits<glm::i16>::max()));
+
+ Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += A.y < 0.0f ? 0 : 1;
+ Error += A.z > 0.0f ? 0 : 1;
+ Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace compNormalize
+
+namespace compScale
+{
+ int run()
+ {
+ int Error(0);
+
+ {
+ glm::u8vec4 const A = glm::compScale<glm::u8>(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f));
+
+ Error += A.x == std::numeric_limits<glm::u8>::min() ? 0 : 1;
+ Error += A.y < (std::numeric_limits<glm::u8>::max() >> 2) ? 0 : 1;
+ Error += A.z == 127 ? 0 : 1;
+ Error += A.w == 255 ? 0 : 1;
+ }
+
+ {
+ glm::i8vec4 const A = glm::compScale<glm::i8>(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f));
+
+ Error += A.x == 0 ? 0 : 1;
+ Error += A.y == -128 ? 0 : 1;
+ Error += A.z == 63 ? 0 : 1;
+ Error += A.w == 127 ? 0 : 1;
+ }
+
+ {
+ glm::u16vec4 const A = glm::compScale<glm::u16>(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f));
+
+ Error += A.x == std::numeric_limits<glm::u16>::min() ? 0 : 1;
+ Error += A.y < (std::numeric_limits<glm::u16>::max() >> 2) ? 0 : 1;
+ Error += A.z == 32767 ? 0 : 1;
+ Error += A.w == 65535 ? 0 : 1;
+ }
+
+ {
+ glm::i16vec4 const A = glm::compScale<glm::i16>(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f));
+
+ Error += A.x == 0 ? 0 : 1;
+ Error += A.y == -32768 ? 0 : 1;
+ Error += A.z == 16383 ? 0 : 1;
+ Error += A.w == 32767 ? 0 : 1;
+ }
+
+ return Error;
+ }
+}// compScale
+
+int main()
+{
+ int Error(0);
+
+ Error += compNormalize::run();
+ Error += compScale::run();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp b/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp
new file mode 100644
index 0000000..ceedc2c
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp
@@ -0,0 +1,205 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#define GLM_FORCE_CTOR_INIT
+#include <glm/gtx/dual_quaternion.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/euler_angles.hpp>
+#include <glm/vector_relational.hpp>
+#if GLM_HAS_TRIVIAL_QUERIES
+# include <type_traits>
+#endif
+
+int myrand()
+{
+ static int holdrand = 1;
+ return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
+}
+
+float myfrand() // returns values from -1 to 1 inclusive
+{
+ return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f;
+}
+
+int test_dquat_type()
+{
+ glm::dvec3 vA;
+ glm::dquat dqA, dqB;
+ glm::ddualquat C(dqA, dqB);
+ glm::ddualquat B(dqA);
+ glm::ddualquat D(dqA, vA);
+ return 0;
+}
+
+int test_scalars()
+{
+ float const Epsilon = 0.0001f;
+
+ int Error(0);
+
+ glm::quat src_q1 = glm::quat(1.0f,2.0f,3.0f,4.0f);
+ glm::quat src_q2 = glm::quat(5.0f,6.0f,7.0f,8.0f);
+ glm::dualquat src1(src_q1,src_q2);
+
+ {
+ glm::dualquat dst1 = src1 * 2.0f;
+ glm::dualquat dst2 = 2.0f * src1;
+ glm::dualquat dst3 = src1;
+ dst3 *= 2.0f;
+ glm::dualquat dstCmp(src_q1 * 2.0f,src_q2 * 2.0f);
+ Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst3.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst3.dual,dstCmp.dual, Epsilon)) ? 0 : 1;
+ }
+
+ {
+ glm::dualquat dst1 = src1 / 2.0f;
+ glm::dualquat dst2 = src1;
+ dst2 /= 2.0f;
+ glm::dualquat dstCmp(src_q1 / 2.0f,src_q2 / 2.0f);
+ Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1;
+ }
+ return Error;
+}
+
+int test_inverse()
+{
+ int Error(0);
+
+ float const Epsilon = 0.0001f;
+
+ glm::dualquat dqid = glm::dual_quat_identity<float, glm::defaultp>();
+ glm::mat4x4 mid(1.0f);
+
+ for (int j = 0; j < 100; ++j)
+ {
+ glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f);
+ glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f);
+
+ glm::mat4x4 m = glm::translate(mid, vt) * rot;
+
+ glm::quat qr = glm::quat_cast(m);
+
+ glm::dualquat dq(qr);
+
+ glm::dualquat invdq = glm::inverse(dq);
+
+ glm::dualquat r1 = invdq * dq;
+ glm::dualquat r2 = dq * invdq;
+
+ Error += glm::all(glm::epsilonEqual(r1.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r1.dual, dqid.dual, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(r2.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r2.dual, dqid.dual, Epsilon)) ? 0 : 1;
+
+ // testing commutative property
+ glm::dualquat r ( glm::quat( myfrand() * glm::pi<float>() * 2.0f, myfrand(), myfrand(), myfrand() ),
+ glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f) );
+ glm::dualquat riq = (r * invdq) * dq;
+ glm::dualquat rqi = (r * dq) * invdq;
+
+ Error += glm::all(glm::epsilonEqual(riq.real, rqi.real, Epsilon)) && glm::all(glm::epsilonEqual(riq.dual, rqi.dual, Epsilon)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_mul()
+{
+ int Error(0);
+
+ float const Epsilon = 0.0001f;
+
+ glm::mat4x4 mid(1.0f);
+
+ for (int j = 0; j < 100; ++j)
+ {
+ // generate random rotations and translations and compare transformed by matrix and dualquats random points
+ glm::vec3 vt1 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f);
+ glm::vec3 vt2 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f);
+
+ glm::mat4x4 rot1 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f);
+ glm::mat4x4 rot2 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f);
+ glm::mat4x4 m1 = glm::translate(mid, vt1) * rot1;
+ glm::mat4x4 m2 = glm::translate(mid, vt2) * rot2;
+ glm::mat4x4 m3 = m2 * m1;
+ glm::mat4x4 m4 = m1 * m2;
+
+ glm::quat qrot1 = glm::quat_cast(rot1);
+ glm::quat qrot2 = glm::quat_cast(rot2);
+
+ glm::dualquat dq1 = glm::dualquat(qrot1,vt1);
+ glm::dualquat dq2 = glm::dualquat(qrot2,vt2);
+ glm::dualquat dq3 = dq2 * dq1;
+ glm::dualquat dq4 = dq1 * dq2;
+
+ for (int i = 0; i < 100; ++i)
+ {
+ glm::vec4 src_pt = glm::vec4(myfrand() * 4.0f, myfrand() * 5.0f, myfrand() * 3.0f,1.0f);
+ // test both multiplication orders
+ glm::vec4 dst_pt_m3 = m3 * src_pt;
+ glm::vec4 dst_pt_dq3 = dq3 * src_pt;
+
+ glm::vec4 dst_pt_m3_i = glm::inverse(m3) * src_pt;
+ glm::vec4 dst_pt_dq3_i = src_pt * dq3;
+
+ glm::vec4 dst_pt_m4 = m4 * src_pt;
+ glm::vec4 dst_pt_dq4 = dq4 * src_pt;
+
+ glm::vec4 dst_pt_m4_i = glm::inverse(m4) * src_pt;
+ glm::vec4 dst_pt_dq4_i = src_pt * dq4;
+
+ Error += glm::all(glm::epsilonEqual(dst_pt_m3, dst_pt_dq3, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst_pt_m4, dst_pt_dq4, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst_pt_m3_i, dst_pt_dq3_i, Epsilon)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(dst_pt_m4_i, dst_pt_dq4_i, Epsilon)) ? 0 : 1;
+ }
+ }
+
+ return Error;
+}
+
+int test_dual_quat_ctr()
+{
+ int Error(0);
+
+# if GLM_HAS_TRIVIAL_QUERIES
+ // Error += std::is_trivially_default_constructible<glm::dualquat>::value ? 0 : 1;
+ // Error += std::is_trivially_default_constructible<glm::ddualquat>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::dualquat>::value ? 0 : 1;
+ // Error += std::is_trivially_copy_assignable<glm::ddualquat>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::dualquat>::value ? 0 : 1;
+ Error += std::is_trivially_copyable<glm::ddualquat>::value ? 0 : 1;
+
+ Error += std::is_copy_constructible<glm::dualquat>::value ? 0 : 1;
+ Error += std::is_copy_constructible<glm::ddualquat>::value ? 0 : 1;
+# endif
+
+ return Error;
+}
+
+int test_size()
+{
+ int Error = 0;
+
+ Error += 32 == sizeof(glm::dualquat) ? 0 : 1;
+ Error += 64 == sizeof(glm::ddualquat) ? 0 : 1;
+ Error += glm::dualquat().length() == 2 ? 0 : 1;
+ Error += glm::ddualquat().length() == 2 ? 0 : 1;
+ Error += glm::dualquat::length() == 2 ? 0 : 1;
+ Error += glm::ddualquat::length() == 2 ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_dual_quat_ctr();
+ Error += test_dquat_type();
+ Error += test_scalars();
+ Error += test_inverse();
+ Error += test_mul();
+ Error += test_size();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_easing.cpp b/3rdparty/glm/source/test/gtx/gtx_easing.cpp
new file mode 100644
index 0000000..0e98cd5
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_easing.cpp
@@ -0,0 +1,65 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#include <glm/gtx/quaternion.hpp>
+#include <glm/gtx/easing.hpp>
+
+namespace
+{
+
+ template<typename T>
+ void _test_easing()
+ {
+ T a = static_cast<T>(0.5);
+ T r;
+
+ r = glm::linearInterpolation(a);
+
+ r = glm::quadraticEaseIn(a);
+ r = glm::quadraticEaseOut(a);
+ r = glm::quadraticEaseInOut(a);
+
+ r = glm::cubicEaseIn(a);
+ r = glm::cubicEaseOut(a);
+ r = glm::cubicEaseInOut(a);
+
+ r = glm::quarticEaseIn(a);
+ r = glm::quarticEaseOut(a);
+ r = glm::quinticEaseInOut(a);
+
+ r = glm::sineEaseIn(a);
+ r = glm::sineEaseOut(a);
+ r = glm::sineEaseInOut(a);
+
+ r = glm::circularEaseIn(a);
+ r = glm::circularEaseOut(a);
+ r = glm::circularEaseInOut(a);
+
+ r = glm::exponentialEaseIn(a);
+ r = glm::exponentialEaseOut(a);
+ r = glm::exponentialEaseInOut(a);
+
+ r = glm::elasticEaseIn(a);
+ r = glm::elasticEaseOut(a);
+ r = glm::elasticEaseInOut(a);
+
+ r = glm::backEaseIn(a);
+ r = glm::backEaseOut(a);
+ r = glm::backEaseInOut(a);
+
+ r = glm::bounceEaseIn(a);
+ r = glm::bounceEaseOut(a);
+ r = glm::bounceEaseInOut(a);
+ }
+
+}
+
+int main()
+{
+ int Error = 0;
+
+ _test_easing<float>();
+ _test_easing<double>();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp b/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp
new file mode 100644
index 0000000..348f581
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp
@@ -0,0 +1,539 @@
+// Code sample from Filippo Ramaciotti
+
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtx/matrix_cross_product.hpp>
+#include <glm/gtx/matrix_operation.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/string_cast.hpp>
+#include <glm/gtx/euler_angles.hpp>
+#include <cstdio>
+#include <vector>
+#include <utility>
+
+namespace test_eulerAngleX
+{
+ int test()
+ {
+ int Error = 0;
+
+ float const Angle(glm::pi<float>() * 0.5f);
+ glm::vec3 const X(1.0f, 0.0f, 0.0f);
+
+ glm::vec4 const Y(0.0f, 1.0f, 0.0f, 1.0f);
+ glm::vec4 const Y1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Y;
+ glm::vec4 const Y2 = glm::eulerAngleX(Angle) * Y;
+ glm::vec4 const Y3 = glm::eulerAngleXY(Angle, 0.0f) * Y;
+ glm::vec4 const Y4 = glm::eulerAngleYX(0.0f, Angle) * Y;
+ glm::vec4 const Y5 = glm::eulerAngleXZ(Angle, 0.0f) * Y;
+ glm::vec4 const Y6 = glm::eulerAngleZX(0.0f, Angle) * Y;
+ glm::vec4 const Y7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Y;
+ Error += glm::all(glm::epsilonEqual(Y1, Y2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Y1, Y3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Y1, Y4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Y1, Y5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Y1, Y6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Y1, Y7, 0.00001f)) ? 0 : 1;
+
+ glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f);
+ glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Z;
+ glm::vec4 const Z2 = glm::eulerAngleX(Angle) * Z;
+ glm::vec4 const Z3 = glm::eulerAngleXY(Angle, 0.0f) * Z;
+ glm::vec4 const Z4 = glm::eulerAngleYX(0.0f, Angle) * Z;
+ glm::vec4 const Z5 = glm::eulerAngleXZ(Angle, 0.0f) * Z;
+ glm::vec4 const Z6 = glm::eulerAngleZX(0.0f, Angle) * Z;
+ glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Z;
+ Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleX
+
+namespace test_eulerAngleY
+{
+ int test()
+ {
+ int Error = 0;
+
+ float const Angle(glm::pi<float>() * 0.5f);
+ glm::vec3 const Y(0.0f, 1.0f, 0.0f);
+
+ glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f);
+ glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Y) * X;
+ glm::vec4 const X2 = glm::eulerAngleY(Angle) * X;
+ glm::vec4 const X3 = glm::eulerAngleYX(Angle, 0.0f) * X;
+ glm::vec4 const X4 = glm::eulerAngleXY(0.0f, Angle) * X;
+ glm::vec4 const X5 = glm::eulerAngleYZ(Angle, 0.0f) * X;
+ glm::vec4 const X6 = glm::eulerAngleZY(0.0f, Angle) * X;
+ glm::vec4 const X7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * X;
+ Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1;
+
+ glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f);
+ glm::vec4 const Z1 = glm::eulerAngleY(Angle) * Z;
+ glm::vec4 const Z2 = glm::rotate(glm::mat4(1.0f), Angle, Y) * Z;
+ glm::vec4 const Z3 = glm::eulerAngleYX(Angle, 0.0f) * Z;
+ glm::vec4 const Z4 = glm::eulerAngleXY(0.0f, Angle) * Z;
+ glm::vec4 const Z5 = glm::eulerAngleYZ(Angle, 0.0f) * Z;
+ glm::vec4 const Z6 = glm::eulerAngleZY(0.0f, Angle) * Z;
+ glm::vec4 const Z7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * Z;
+ Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleY
+
+namespace test_eulerAngleZ
+{
+ int test()
+ {
+ int Error = 0;
+
+ float const Angle(glm::pi<float>() * 0.5f);
+ glm::vec3 const Z(0.0f, 0.0f, 1.0f);
+
+ glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f);
+ glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * X;
+ glm::vec4 const X2 = glm::eulerAngleZ(Angle) * X;
+ glm::vec4 const X3 = glm::eulerAngleZX(Angle, 0.0f) * X;
+ glm::vec4 const X4 = glm::eulerAngleXZ(0.0f, Angle) * X;
+ glm::vec4 const X5 = glm::eulerAngleZY(Angle, 0.0f) * X;
+ glm::vec4 const X6 = glm::eulerAngleYZ(0.0f, Angle) * X;
+ glm::vec4 const X7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * X;
+ Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1;
+
+ glm::vec4 const Y(1.0f, 0.0f, 0.0f, 1.0f);
+ glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * Y;
+ glm::vec4 const Z2 = glm::eulerAngleZ(Angle) * Y;
+ glm::vec4 const Z3 = glm::eulerAngleZX(Angle, 0.0f) * Y;
+ glm::vec4 const Z4 = glm::eulerAngleXZ(0.0f, Angle) * Y;
+ glm::vec4 const Z5 = glm::eulerAngleZY(Angle, 0.0f) * Y;
+ glm::vec4 const Z6 = glm::eulerAngleYZ(0.0f, Angle) * Y;
+ glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * Y;
+ Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleZ
+
+namespace test_derivedEulerAngles
+{
+ bool epsilonEqual(glm::mat4 const& mat1, glm::mat4 const& mat2, glm::mat4::value_type const& epsilon)
+ {
+ return glm::all(glm::epsilonEqual(mat1[0], mat2[0], epsilon)) ?
+ (
+ glm::all(glm::epsilonEqual(mat1[1], mat2[1], epsilon)) ?
+ (
+ glm::all(glm::epsilonEqual(mat1[2], mat2[2], epsilon)) ?
+ (
+ glm::all(glm::epsilonEqual(mat1[3], mat2[3], epsilon)) ? true : false
+ ) : false
+ ) : false
+ ) : false;
+ }
+
+ template<typename RotationFunc, typename TestDerivedFunc>
+ int test(RotationFunc rotationFunc, TestDerivedFunc testDerivedFunc, const glm::vec3& basis)
+ {
+ int Error = 0;
+
+ typedef glm::vec3::value_type value;
+ value const zeroAngle(0.0f);
+ value const Angle(glm::pi<float>() * 0.75f);
+ value const negativeAngle(-Angle);
+ value const zeroAngleVelocity(0.0f);
+ value const AngleVelocity(glm::pi<float>() * 0.27f);
+ value const negativeAngleVelocity(-AngleVelocity);
+
+ typedef std::pair<value,value> AngleAndAngleVelocity;
+ std::vector<AngleAndAngleVelocity> testPairs;
+ testPairs.push_back(AngleAndAngleVelocity(zeroAngle, zeroAngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(zeroAngle, AngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(zeroAngle, negativeAngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(Angle, zeroAngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(Angle, AngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(Angle, negativeAngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(negativeAngle, zeroAngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(negativeAngle, AngleVelocity));
+ testPairs.push_back(AngleAndAngleVelocity(negativeAngle, negativeAngleVelocity));
+
+ for (size_t i = 0, size = testPairs.size(); i < size; ++i)
+ {
+ AngleAndAngleVelocity const& pair = testPairs.at(i);
+
+ glm::mat4 const W = glm::matrixCross4(basis * pair.second);
+ glm::mat4 const rotMt = glm::transpose(rotationFunc(pair.first));
+ glm::mat4 const derivedRotM = testDerivedFunc(pair.first, pair.second);
+
+ Error += epsilonEqual(W, derivedRotM * rotMt, 0.00001f) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace test_derivedEulerAngles
+
+namespace test_eulerAngleXY
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleX(glm::pi<float>() * 0.5f);
+ float const AngleY(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisY(0.0f, 1.0f, 0.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V;
+ glm::vec4 const V2 = glm::eulerAngleXY(AngleX, AngleY) * V;
+ glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleY(AngleY) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleXY
+
+namespace test_eulerAngleYX
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleX(glm::pi<float>() * 0.5f);
+ float const AngleY(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisY(0.0f, 1.0f, 0.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V;
+ glm::vec4 const V2 = glm::eulerAngleYX(AngleY, AngleX) * V;
+ glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleX(AngleX) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleYX
+
+namespace test_eulerAngleXZ
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleX(glm::pi<float>() * 0.5f);
+ float const AngleZ(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisZ(0.0f, 0.0f, 1.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V;
+ glm::vec4 const V2 = glm::eulerAngleXZ(AngleX, AngleZ) * V;
+ glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleZ(AngleZ) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleXZ
+
+namespace test_eulerAngleZX
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleX(glm::pi<float>() * 0.5f);
+ float const AngleZ(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisZ(0.0f, 0.0f, 1.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V;
+ glm::vec4 const V2 = glm::eulerAngleZX(AngleZ, AngleX) * V;
+ glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleX(AngleX) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleZX
+
+namespace test_eulerAngleYZ
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleY(glm::pi<float>() * 0.5f);
+ float const AngleZ(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisY(0.0f, 1.0f, 0.0f);
+ glm::vec3 const axisZ(0.0f, 0.0f, 1.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V;
+ glm::vec4 const V2 = glm::eulerAngleYZ(AngleY, AngleZ) * V;
+ glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleZ(AngleZ) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleYZ
+
+namespace test_eulerAngleZY
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::vec4 const V(1.0f);
+
+ float const AngleY(glm::pi<float>() * 0.5f);
+ float const AngleZ(glm::pi<float>() * 0.25f);
+
+ glm::vec3 const axisX(1.0f, 0.0f, 0.0f);
+ glm::vec3 const axisY(0.0f, 1.0f, 0.0f);
+ glm::vec3 const axisZ(0.0f, 0.0f, 1.0f);
+
+ glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V;
+ glm::vec4 const V2 = glm::eulerAngleZY(AngleZ, AngleY) * V;
+ glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleY(AngleY) * V;
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace test_eulerAngleZY
+
+namespace test_eulerAngleYXZ
+{
+ int test()
+ {
+ glm::f32 first = 1.046f;
+ glm::f32 second = 0.52f;
+ glm::f32 third = -0.785f;
+
+ glm::fmat4 rotationEuler = glm::eulerAngleYXZ(first, second, third);
+
+ glm::fmat4 rotationInvertedY = glm::eulerAngleY(-1.f*first) * glm::eulerAngleX(second) * glm::eulerAngleZ(third);
+ glm::fmat4 rotationDumb = glm::fmat4();
+ rotationDumb = glm::rotate(rotationDumb, first, glm::fvec3(0,1,0));
+ rotationDumb = glm::rotate(rotationDumb, second, glm::fvec3(1,0,0));
+ rotationDumb = glm::rotate(rotationDumb, third, glm::fvec3(0,0,1));
+
+ std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler)).c_str());
+ std::printf("%s\n", glm::to_string(glm::fmat3(rotationDumb)).c_str());
+ std::printf("%s\n", glm::to_string(glm::fmat3(rotationInvertedY)).c_str());
+
+ std::printf("\nRESIDUAL\n");
+ std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationDumb))).c_str());
+ std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationInvertedY))).c_str());
+
+ return 0;
+ }
+}//namespace eulerAngleYXZ
+
+namespace test_eulerAngles
+{
+ template<typename TestRotationFunc>
+ int test(TestRotationFunc testRotationFunc, glm::vec3 const& I, glm::vec3 const& J, glm::vec3 const& K)
+ {
+ int Error = 0;
+
+ typedef glm::mat4::value_type value;
+ value const minAngle(-glm::pi<value>());
+ value const maxAngle(glm::pi<value>());
+ value const maxAngleWithDelta(maxAngle - 0.0000001f);
+ value const minMidAngle(-glm::pi<value>() * 0.5f);
+ value const maxMidAngle(glm::pi<value>() * 0.5f);
+
+ std::vector<glm::vec3> testEulerAngles;
+ testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle));
+
+ for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i)
+ {
+ glm::vec3 const& angles = testEulerAngles.at(i);
+ glm::mat4 const rotationEuler = testRotationFunc(angles.x, angles.y, angles.z);
+
+ glm::mat4 rotationDumb = glm::diagonal4x4(glm::mat4::col_type(1.0f));
+ rotationDumb = glm::rotate(rotationDumb, angles.x, I);
+ rotationDumb = glm::rotate(rotationDumb, angles.y, J);
+ rotationDumb = glm::rotate(rotationDumb, angles.z, K);
+
+ glm::vec4 const V(1.0f,1.0f,1.0f,1.0f);
+ glm::vec4 const V1 = rotationEuler * V;
+ glm::vec4 const V2 = rotationDumb * V;
+
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace test_extractsEulerAngles
+
+namespace test_extractsEulerAngles
+{
+ template<typename RotationFunc, typename TestExtractionFunc>
+ int test(RotationFunc rotationFunc, TestExtractionFunc testExtractionFunc)
+ {
+ int Error = 0;
+
+ typedef glm::mat4::value_type value;
+ value const minAngle(-glm::pi<value>());
+ value const maxAngle(glm::pi<value>());
+ value const maxAngleWithDelta(maxAngle - 0.0000001f);
+ value const minMidAngle(-glm::pi<value>() * 0.5f);
+ value const maxMidAngle(glm::pi<value>() * 0.5f);
+
+ std::vector<glm::vec3> testEulerAngles;
+ testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta));
+ testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle));
+ testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle));
+ testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle));
+
+ for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i)
+ {
+ glm::vec3 const& angles = testEulerAngles.at(i);
+ glm::mat4 const rotation = rotationFunc(angles.x, angles.y, angles.z);
+
+ glm::vec3 extractedEulerAngles(0.0f);
+ testExtractionFunc(rotation, extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z);
+ glm::mat4 const extractedRotation = rotationFunc(extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z);
+
+ glm::vec4 const V(1.0f,1.0f,1.0f,1.0f);
+ glm::vec4 const V1 = rotation * V;
+ glm::vec4 const V2 = extractedRotation * V;
+
+ Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace test_extractsEulerAngles
+
+int main()
+{
+ int Error = 0;
+
+ typedef glm::mat4::value_type value;
+ glm::vec3 const X(1.0f, 0.0f, 0.0f);
+ glm::vec3 const Y(0.0f, 1.0f, 0.0f);
+ glm::vec3 const Z(0.0f, 0.0f, 1.0f);
+
+ Error += test_eulerAngleX::test();
+ Error += test_eulerAngleY::test();
+ Error += test_eulerAngleZ::test();
+
+ Error += test_derivedEulerAngles::test(glm::eulerAngleX<value>, glm::derivedEulerAngleX<value>, X);
+ Error += test_derivedEulerAngles::test(glm::eulerAngleY<value>, glm::derivedEulerAngleY<value>, Y);
+ Error += test_derivedEulerAngles::test(glm::eulerAngleZ<value>, glm::derivedEulerAngleZ<value>, Z);
+
+ Error += test_eulerAngleXY::test();
+ Error += test_eulerAngleYX::test();
+ Error += test_eulerAngleXZ::test();
+ Error += test_eulerAngleZX::test();
+ Error += test_eulerAngleYZ::test();
+ Error += test_eulerAngleZY::test();
+ Error += test_eulerAngleYXZ::test();
+
+ Error += test_eulerAngles::test(glm::eulerAngleXZX<value>, X, Z, X);
+ Error += test_eulerAngles::test(glm::eulerAngleXYX<value>, X, Y, X);
+ Error += test_eulerAngles::test(glm::eulerAngleYXY<value>, Y, X, Y);
+ Error += test_eulerAngles::test(glm::eulerAngleYZY<value>, Y, Z, Y);
+ Error += test_eulerAngles::test(glm::eulerAngleZYZ<value>, Z, Y, Z);
+ Error += test_eulerAngles::test(glm::eulerAngleZXZ<value>, Z, X, Z);
+ Error += test_eulerAngles::test(glm::eulerAngleXZY<value>, X, Z, Y);
+ Error += test_eulerAngles::test(glm::eulerAngleYZX<value>, Y, Z, X);
+ Error += test_eulerAngles::test(glm::eulerAngleZYX<value>, Z, Y, X);
+ Error += test_eulerAngles::test(glm::eulerAngleZXY<value>, Z, X, Y);
+
+ Error += test_extractsEulerAngles::test(glm::eulerAngleYXZ<value>, glm::extractEulerAngleYXZ<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleXZX<value>, glm::extractEulerAngleXZX<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleXYX<value>, glm::extractEulerAngleXYX<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleYXY<value>, glm::extractEulerAngleYXY<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleYZY<value>, glm::extractEulerAngleYZY<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleZYZ<value>, glm::extractEulerAngleZYZ<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleZXZ<value>, glm::extractEulerAngleZXZ<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleXZY<value>, glm::extractEulerAngleXZY<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleYZX<value>, glm::extractEulerAngleYZX<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleZYX<value>, glm::extractEulerAngleZYX<value>);
+ Error += test_extractsEulerAngles::test(glm::eulerAngleZXY<value>, glm::extractEulerAngleZXY<value>);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_extend.cpp b/3rdparty/glm/source/test/gtx/gtx_extend.cpp
new file mode 100644
index 0000000..0c37df5
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_extend.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/extend.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp
new file mode 100644
index 0000000..3d20f10
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp
@@ -0,0 +1,101 @@
+#define GLM_ENABLE_EXPERIMENTAL
+
+#include <glm/gtx/extended_min_max.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+
+// This file has divisions by zero to test isnan
+#if GLM_COMPILER & GLM_COMPILER_VC
+# pragma warning(disable : 4723)
+#endif
+
+namespace fmin_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ float Zero_f = 0.0f;
+ glm::vec1 A0 = glm::fmin(glm::vec1(1), glm::vec1(Zero_f / 0.0f));
+ Error += glm::equal(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ glm::vec1 A1 = glm::fmin(glm::vec1(Zero_f / 0.0f), glm::vec1(1));
+ Error += glm::equal(A1.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ glm::vec2 B0 = glm::fmin(glm::vec2(1), glm::vec2(1));
+ glm::vec2 B1 = glm::fmin(glm::vec2(1), 1.0f);
+ bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon<float>()));
+ Error += B2 ? 0 : 1;
+
+ glm::vec3 C0 = glm::fmin(glm::vec3(1), glm::vec3(1));
+ glm::vec3 C1 = glm::fmin(glm::vec3(1), 1.0f);
+ bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon<float>()));
+ Error += C2 ? 0 : 1;
+
+ glm::vec4 D0 = glm::fmin(glm::vec4(1), glm::vec4(1));
+ glm::vec4 D1 = glm::fmin(glm::vec4(1), 1.0f);
+ bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon<float>()));
+ Error += D2 ? 0 : 1;
+
+ return Error;
+ }
+}//namespace fmin_
+
+namespace fmax_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ float Zero_f = 0.0f;
+ glm::vec1 A0 = glm::fmax(glm::vec1(1), glm::vec1(Zero_f / 0.0f));
+ Error += glm::equal(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ glm::vec1 A1 = glm::fmax(glm::vec1(Zero_f / 0.0f), glm::vec1(1));
+ Error += glm::equal(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ glm::vec2 B0 = glm::fmax(glm::vec2(1), glm::vec2(1));
+ glm::vec2 B1 = glm::fmax(glm::vec2(1), 1.0f);
+ bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon<float>()));
+ Error += B2 ? 0 : 1;
+
+ glm::vec3 C0 = glm::fmax(glm::vec3(1), glm::vec3(1));
+ glm::vec3 C1 = glm::fmax(glm::vec3(1), 1.0f);
+ bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon<float>()));
+ Error += C2 ? 0 : 1;
+
+ glm::vec4 D0 = glm::fmax(glm::vec4(1), glm::vec4(1));
+ glm::vec4 D1 = glm::fmax(glm::vec4(1), 1.0f);
+ bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon<float>()));
+ Error += D2 ? 0 : 1;
+
+ return Error;
+ }
+}//namespace fmax_
+
+namespace fclamp_
+{
+ static int test()
+ {
+ int Error = 0;
+
+ float Zero_f = 0.0f;
+ glm::vec1 A0 = glm::fclamp(glm::vec1(1), glm::vec1(Zero_f / 0.0f), glm::vec1(2.0f));
+ Error += glm::equal(A0.x, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace fclamp_
+
+int main()
+{
+ int Error = 0;
+
+ Error += fmin_::test();
+ Error += fmax_::test();
+ Error += fclamp_::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp
new file mode 100644
index 0000000..c8c7847
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp
@@ -0,0 +1,39 @@
+///////////////////////////////////////////////////////////////////////////////////
+/// OpenGL Mathematics (glm.g-truc.net)
+///
+/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
+/// Permission is hereby granted, free of charge, to any person obtaining a copy
+/// of this software and associated documentation files (the "Software"), to deal
+/// in the Software without restriction, including without limitation the rights
+/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+/// copies of the Software, and to permit persons to whom the Software is
+/// furnished to do so, subject to the following conditions:
+///
+/// The above copyright notice and this permission notice shall be included in
+/// all copies or substantial portions of the Software.
+///
+/// Restrictions:
+/// By making use of the Software for military purposes, you choose to make
+/// a Bunny unhappy.
+///
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+/// THE SOFTWARE.
+///
+/// @file test/gtx/gtx_extented_min_max.cpp
+/// @date 2013-10-25 / 2014-11-25
+/// @author Christophe Riccio
+///////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/gtx/extended_min_max.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp b/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp
new file mode 100644
index 0000000..a02c983
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp
@@ -0,0 +1,14 @@
+#include <glm/gtx/exterior_product.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/vec2.hpp>
+
+int main()
+{
+ int Error = 0;
+
+ float const f = glm::cross(glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f));
+ Error += glm::epsilonEqual(f, 0.0f, 0.001f) ? 0 : 1;
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp
new file mode 100644
index 0000000..341e26e
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/fast_exponential.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp
new file mode 100644
index 0000000..80d7fe4
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp
@@ -0,0 +1,45 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/fast_square_root.hpp>
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/vector_relational.hpp>
+
+int test_fastInverseSqrt()
+{
+ int Error = 0;
+
+ Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0f), 1.0f, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0), 1.0, 0.01) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::vec2(1.0f)), glm::vec2(1.0f), 0.01f)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec3(1.0)), glm::dvec3(1.0), 0.01)) ? 0 : 1;
+ Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec4(1.0)), glm::dvec4(1.0), 0.01)) ? 0 : 1;
+
+ return Error;
+}
+
+int test_fastDistance()
+{
+ int Error = 0;
+
+ float const A = glm::fastDistance(0.0f, 1.0f);
+ float const B = glm::fastDistance(glm::vec2(0.0f), glm::vec2(1.0f, 0.0f));
+ float const C = glm::fastDistance(glm::vec3(0.0f), glm::vec3(1.0f, 0.0f, 0.0f));
+ float const D = glm::fastDistance(glm::vec4(0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 0.0f));
+
+ Error += glm::epsilonEqual(A, 1.0f, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(B, 1.0f, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C, 1.0f, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(D, 1.0f, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_fastInverseSqrt();
+ Error += test_fastDistance();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp
new file mode 100644
index 0000000..8bf86ba
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp
@@ -0,0 +1,564 @@
+#include <glm/ext/scalar_ulp.hpp>
+
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/fast_trigonometry.hpp>
+#include <glm/gtx/integer.hpp>
+#include <glm/gtx/common.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/trigonometric.hpp>
+#include <cmath>
+#include <ctime>
+#include <cstdio>
+#include <vector>
+
+namespace fastCos
+{
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastCos(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::cos(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+ std::printf("fastCos Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("cos Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastCos
+
+namespace fastSin
+{
+ /*
+ float sin(float x) {
+ float temp;
+ temp = (x + M_PI) / ((2 * M_PI) - M_PI);
+ return limited_sin((x + M_PI) - ((2 * M_PI) - M_PI) * temp));
+ }
+ */
+
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastSin(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::sin(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+ std::printf("fastSin Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("sin Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastSin
+
+namespace fastTan
+{
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastTan(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for (float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::tan(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+ std::printf("fastTan Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("tan Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastTan
+
+namespace fastAcos
+{
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastAcos(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::acos(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+
+ std::printf("fastAcos Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("acos Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastAcos
+
+namespace fastAsin
+{
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastAsin(i);
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::asin(i);
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+ std::printf("fastAsin Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("asin Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastAsin
+
+namespace fastAtan
+{
+ int perf(bool NextFloat)
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+ float result = 0.f;
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::fastAtan(i);
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+ result = glm::atan(i);
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+ std::printf("fastAtan Time %d clocks\n", static_cast<int>(time_fast));
+ std::printf("atan Time %d clocks\n", static_cast<int>(time_default));
+
+ return time_fast <= time_default ? 0 : 1;
+ }
+}//namespace fastAtan
+
+namespace taylorCos
+{
+ using glm::qualifier;
+ using glm::length_t;
+
+ glm::vec4 const AngleShift(0.0f, glm::half_pi<float>(), glm::pi<float>(), glm::three_over_two_pi<float>());
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> taylorSeriesNewCos(glm::vec<L, T, Q> const& x)
+ {
+ glm::vec<L, T, Q> const Powed2(x * x);
+ glm::vec<L, T, Q> const Powed4(Powed2 * Powed2);
+ glm::vec<L, T, Q> const Powed6(Powed4 * Powed2);
+ glm::vec<L, T, Q> const Powed8(Powed4 * Powed4);
+
+ return static_cast<T>(1)
+ - Powed2 * static_cast<T>(0.5)
+ + Powed4 * static_cast<T>(0.04166666666666666666666666666667)
+ - Powed6 * static_cast<T>(0.00138888888888888888888888888889)
+ + Powed8 * static_cast<T>(2.4801587301587301587301587301587e-5);
+ }
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> taylorSeriesNewCos6(glm::vec<L, T, Q> const& x)
+ {
+ glm::vec<L, T, Q> const Powed2(x * x);
+ glm::vec<L, T, Q> const Powed4(Powed2 * Powed2);
+ glm::vec<L, T, Q> const Powed6(Powed4 * Powed2);
+
+ return static_cast<T>(1)
+ - Powed2 * static_cast<T>(0.5)
+ + Powed4 * static_cast<T>(0.04166666666666666666666666666667)
+ - Powed6 * static_cast<T>(0.00138888888888888888888888888889);
+ }
+
+ template<glm::length_t L, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, float, Q> fastAbs(glm::vec<L, float, Q> x)
+ {
+ int* Pointer = reinterpret_cast<int*>(&x[0]);
+ Pointer[0] &= 0x7fffffff;
+ Pointer[1] &= 0x7fffffff;
+ Pointer[2] &= 0x7fffffff;
+ Pointer[3] &= 0x7fffffff;
+ return x;
+ }
+
+ template<glm::length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> fastCosNew(glm::vec<L, T, Q> const& x)
+ {
+ glm::vec<L, T, Q> const Angle0_PI(fastAbs(fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
+ return taylorSeriesNewCos6(x);
+/*
+ vec<L, bool, Q> const FirstQuarterPi(lessThanEqual(Angle0_PI, vec<L, T, Q>(glm::half_pi<T>())));
+
+ vec<L, T, Q> const RevertAngle(mix(vec<L, T, Q>(glm::pi<T>()), vec<L, T, Q>(0), FirstQuarterPi));
+ vec<L, T, Q> const ReturnSign(mix(vec<L, T, Q>(-1), vec<L, T, Q>(1), FirstQuarterPi));
+ vec<L, T, Q> const SectionAngle(RevertAngle - Angle0_PI);
+
+ return ReturnSign * taylorSeriesNewCos(SectionAngle);
+*/
+ }
+
+ int perf_fastCosNew(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<glm::vec4> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = fastCosNew(AngleShift + glm::vec4(Begin + Steps * static_cast<float>(i)));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("fastCosNew %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> deterministic_fmod(glm::vec<L, T, Q> const& x, T y)
+ {
+ return x - y * trunc(x / y);
+ }
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> fastCosDeterminisctic(glm::vec<L, T, Q> const& x)
+ {
+ glm::vec<L, T, Q> const Angle0_PI(abs(deterministic_fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
+ glm::vec<L, bool, Q> const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec<L, T, Q>(glm::half_pi<T>())));
+
+ glm::vec<L, T, Q> const RevertAngle(mix(glm::vec<L, T, Q>(glm::pi<T>()), glm::vec<L, T, Q>(0), FirstQuarterPi));
+ glm::vec<L, T, Q> const ReturnSign(mix(glm::vec<L, T, Q>(-1), glm::vec<L, T, Q>(1), FirstQuarterPi));
+ glm::vec<L, T, Q> const SectionAngle(RevertAngle - Angle0_PI);
+
+ return ReturnSign * taylorSeriesNewCos(SectionAngle);
+ }
+
+ int perf_fastCosDeterminisctic(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<glm::vec4> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = taylorCos::fastCosDeterminisctic(AngleShift + glm::vec4(Begin + Steps * static_cast<float>(i)));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("fastCosDeterminisctic %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> taylorSeriesRefCos(glm::vec<L, T, Q> const& x)
+ {
+ return static_cast<T>(1)
+ - (x * x) / glm::factorial(static_cast<T>(2))
+ + (x * x * x * x) / glm::factorial(static_cast<T>(4))
+ - (x * x * x * x * x * x) / glm::factorial(static_cast<T>(6))
+ + (x * x * x * x * x * x * x * x) / glm::factorial(static_cast<T>(8));
+ }
+
+ template<length_t L, typename T, qualifier Q>
+ GLM_FUNC_QUALIFIER glm::vec<L, T, Q> fastRefCos(glm::vec<L, T, Q> const& x)
+ {
+ glm::vec<L, T, Q> const Angle0_PI(glm::abs(fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
+// return taylorSeriesRefCos(Angle0_PI);
+
+ glm::vec<L, bool, Q> const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec<L, T, Q>(glm::half_pi<T>())));
+
+ glm::vec<L, T, Q> const RevertAngle(mix(glm::vec<L, T, Q>(glm::pi<T>()), glm::vec<L, T, Q>(0), FirstQuarterPi));
+ glm::vec<L, T, Q> const ReturnSign(mix(glm::vec<L, T, Q>(-1), glm::vec<L, T, Q>(1), FirstQuarterPi));
+ glm::vec<L, T, Q> const SectionAngle(RevertAngle - Angle0_PI);
+
+ return ReturnSign * taylorSeriesRefCos(SectionAngle);
+ }
+
+ int perf_fastCosRef(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<glm::vec4> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = taylorCos::fastRefCos(AngleShift + glm::vec4(Begin + Steps * static_cast<float>(i)));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("fastCosRef %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf_fastCosOld(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<glm::vec4> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = glm::fastCos(AngleShift + glm::vec4(Begin + Steps * static_cast<float>(i)));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("fastCosOld %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf_cos(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<glm::vec4> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = glm::cos(AngleShift + glm::vec4(Begin + Steps * static_cast<float>(i)));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("cos %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf(std::size_t const Samples)
+ {
+ int Error = 0;
+
+ float const Begin = -glm::pi<float>();
+ float const End = glm::pi<float>();
+
+ Error += perf_cos(Begin, End, Samples);
+ Error += perf_fastCosOld(Begin, End, Samples);
+ Error += perf_fastCosRef(Begin, End, Samples);
+ //Error += perf_fastCosNew(Begin, End, Samples);
+ Error += perf_fastCosDeterminisctic(Begin, End, Samples);
+
+ return Error;
+ }
+
+ int test()
+ {
+ int Error = 0;
+
+ //for(float Angle = -4.0f * glm::pi<float>(); Angle < 4.0f * glm::pi<float>(); Angle += 0.1f)
+ //for(float Angle = -720.0f; Angle < 720.0f; Angle += 0.1f)
+ for(float Angle = 0.0f; Angle < 180.0f; Angle += 0.1f)
+ {
+ float const modAngle = std::fmod(glm::abs(Angle), 360.f);
+ assert(modAngle >= 0.0f && modAngle <= 360.f);
+ float const radAngle = glm::radians(modAngle);
+ float const Cos0 = std::cos(radAngle);
+
+ float const Cos1 = taylorCos::fastRefCos(glm::fvec1(radAngle)).x;
+ Error += glm::abs(Cos1 - Cos0) < 0.1f ? 0 : 1;
+
+ //float const Cos2 = taylorCos::fastCosNew(glm::fvec1(radAngle)).x;
+ //Error += glm::abs(Cos2 - Cos0) < 0.1f ? 0 : 1;
+
+ assert(!Error);
+ }
+
+ return Error;
+ }
+}//namespace taylorCos
+
+namespace taylor2
+{
+ glm::vec4 const AngleShift(0.0f, glm::pi<float>() * 0.5f, glm::pi<float>() * 1.0f, glm::pi<float>() * 1.5f);
+
+ float taylorCosA(float x)
+ {
+ return 1.f
+ - (x * x) * (1.f / 2.f)
+ + (x * x * x * x) * (1.f / 24.f)
+ - (x * x * x * x * x * x) * (1.f / 720.f)
+ + (x * x * x * x * x * x * x * x) * (1.f / 40320.f);
+ }
+
+ float taylorCosB(float x)
+ {
+ return 1.f
+ - (x * x) * (1.f / 2.f)
+ + (x * x * x * x) * (1.f / 24.f)
+ - (x * x * x * x * x * x) * (1.f / 720.f)
+ + (x * x * x * x * x * x * x * x) * (1.f / 40320.f);
+ }
+
+ float taylorCosC(float x)
+ {
+ return 1.f
+ - (x * x) * (1.f / 2.f)
+ + ((x * x) * (x * x)) * (1.f / 24.f)
+ - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f)
+ + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f);
+ }
+
+ int perf_taylorCosA(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<float> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = taylorCosA(AngleShift.x + Begin + Steps * static_cast<float>(i));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("taylorCosA %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf_taylorCosB(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<float> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = taylorCosB(AngleShift.x + Begin + Steps * static_cast<float>(i));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("taylorCosB %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf_taylorCosC(float Begin, float End, std::size_t Samples)
+ {
+ std::vector<float> Results;
+ Results.resize(Samples);
+
+ float const Steps = (End - Begin) / static_cast<float>(Samples);
+
+ std::clock_t const TimeStampBegin = std::clock();
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ Results[i] = taylorCosC(AngleShift.x + Begin + Steps * static_cast<float>(i));
+
+ std::clock_t const TimeStampEnd = std::clock();
+
+ std::printf("taylorCosC %d clocks\n", static_cast<int>(TimeStampEnd - TimeStampBegin));
+
+ int Error = 0;
+ for(std::size_t i = 0; i < Samples; ++i)
+ Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1;
+ return Error;
+ }
+
+ int perf(std::size_t Samples)
+ {
+ int Error = 0;
+
+ float const Begin = -glm::pi<float>();
+ float const End = glm::pi<float>();
+
+ Error += perf_taylorCosA(Begin, End, Samples);
+ Error += perf_taylorCosB(Begin, End, Samples);
+ Error += perf_taylorCosC(Begin, End, Samples);
+
+ return Error;
+ }
+
+}//namespace taylor2
+
+int main()
+{
+ int Error(0);
+
+ Error += ::taylor2::perf(1000);
+ Error += ::taylorCos::test();
+ Error += ::taylorCos::perf(1000);
+
+# ifdef NDEBUG
+ ::fastCos::perf(false);
+ ::fastSin::perf(false);
+ ::fastTan::perf(false);
+ ::fastAcos::perf(false);
+ ::fastAsin::perf(false);
+ ::fastAtan::perf(false);
+# endif//NDEBUG
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_functions.cpp b/3rdparty/glm/source/test/gtx/gtx_functions.cpp
new file mode 100644
index 0000000..48a6af0
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_functions.cpp
@@ -0,0 +1,36 @@
+#include <glm/gtx/functions.hpp>
+#include <glm/ext/vector_float2.hpp>
+#include <vector>
+
+int test_gauss_1d()
+{
+ int Error = 0;
+
+ std::vector<float> Result(20);
+ for(std::size_t i = 0, n = Result.size(); i < n; ++i)
+ Result[i] = glm::gauss(static_cast<float>(i) * 0.1f, 0.0f, 1.0f);
+
+ return Error;
+}
+
+int test_gauss_2d()
+{
+ int Error = 0;
+
+ std::vector<float> Result(20);
+ for(std::size_t i = 0, n = Result.size(); i < n; ++i)
+ Result[i] = glm::gauss(glm::vec2(static_cast<float>(i)) * 0.1f, glm::vec2(0.0f), glm::vec2(1.0f));
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_gauss_1d();
+ Error += test_gauss_2d();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp b/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp
new file mode 100644
index 0000000..01f521b
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp
@@ -0,0 +1,34 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/gradient_paint.hpp>
+
+int test_radialGradient()
+{
+ int Error = 0;
+
+ float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5));
+ Error += Gradient != 0.0f ? 0 : 1;
+
+ return Error;
+}
+
+int test_linearGradient()
+{
+ int Error = 0;
+
+ float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5));
+ Error += Gradient != 0.0f ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_radialGradient();
+ Error += test_linearGradient();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp b/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp
new file mode 100644
index 0000000..e417688
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/handed_coordinate_space.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp b/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp
new file mode 100644
index 0000000..ab59bb2
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp
@@ -0,0 +1,18 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2013-10-25
+// Updated : 2013-10-25
+// Licence : This source is under MIT licence
+// File : test/gtx/associated_min_max.cpp
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/associated_min_max.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_integer.cpp b/3rdparty/glm/source/test/gtx/gtx_integer.cpp
new file mode 100644
index 0000000..4c4225d
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_integer.cpp
@@ -0,0 +1,108 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/exponential.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/integer.hpp>
+#include <cstdio>
+/*
+int test_floor_log2()
+{
+ int Error = 0;
+
+ for(std::size_t i = 1; i < 1000000; ++i)
+ {
+ glm::uint A = glm::floor_log2(glm::uint(i));
+ glm::uint B = glm::uint(glm::floor(glm::log2(double(i)))); // Will fail with float, lack of accuracy
+
+ Error += A == B ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+*/
+int test_log2()
+{
+ int Error = 0;
+
+ for(std::size_t i = 1; i < 24; ++i)
+ {
+ glm::uint A = glm::log2(glm::uint(1 << i));
+ glm::uint B = glm::uint(glm::log2(double(1 << i)));
+
+ //Error += glm::equalEpsilon(double(A), B, 1.0) ? 0 : 1;
+ Error += glm::abs(double(A) - B) <= 24 ? 0 : 1;
+ assert(!Error);
+
+ std::printf("Log2(%d) error A=%d, B=%d\n", 1 << i, A, B);
+ }
+
+ std::printf("log2 error=%d\n", Error);
+
+ return Error;
+}
+
+int test_nlz()
+{
+ int Error = 0;
+
+ for(glm::uint i = 1; i < glm::uint(33); ++i)
+ Error += glm::nlz(i) == glm::uint(31u) - glm::findMSB(i) ? 0 : 1;
+ //printf("%d, %d\n", glm::nlz(i), 31u - glm::findMSB(i));
+
+ return Error;
+}
+
+int test_pow_uint()
+{
+ int Error = 0;
+
+ glm::uint const p0 = glm::pow(2u, 0u);
+ Error += p0 == 1u ? 0 : 1;
+
+ glm::uint const p1 = glm::pow(2u, 1u);
+ Error += p1 == 2u ? 0 : 1;
+
+ glm::uint const p2 = glm::pow(2u, 2u);
+ Error += p2 == 4u ? 0 : 1;
+
+ return Error;
+}
+
+int test_pow_int()
+{
+ int Error = 0;
+
+ int const p0 = glm::pow(2, 0u);
+ Error += p0 == 1 ? 0 : 1;
+
+ int const p1 = glm::pow(2, 1u);
+ Error += p1 == 2 ? 0 : 1;
+
+ int const p2 = glm::pow(2, 2u);
+ Error += p2 == 4 ? 0 : 1;
+
+ int const p0n = glm::pow(-2, 0u);
+ Error += p0n == -1 ? 0 : 1;
+
+ int const p1n = glm::pow(-2, 1u);
+ Error += p1n == -2 ? 0 : 1;
+
+ int const p2n = glm::pow(-2, 2u);
+ Error += p2n == 4 ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_nlz();
+// Error += test_floor_log2();
+ Error += test_log2();
+ Error += test_pow_uint();
+ Error += test_pow_int();
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_intersect.cpp b/3rdparty/glm/source/test/gtx/gtx_intersect.cpp
new file mode 100644
index 0000000..c4a1b2a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_intersect.cpp
@@ -0,0 +1,88 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/intersect.hpp>
+
+int test_intersectRayPlane()
+{
+ int Error = 0;
+ glm::vec3 const PlaneOrigin(0, 0, 1);
+ glm::vec3 const PlaneNormal(0, 0, -1);
+ glm::vec3 const RayOrigin(0, 0, 0);
+ glm::vec3 const RayDir(0, 0, 1);
+
+ // check that inversion of the plane normal has no effect
+ {
+ float Distance = 0;
+ bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, PlaneNormal, Distance);
+ Error += glm::abs(Distance - 1.f) <= std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += Result ? 0 : 1;
+ }
+ {
+ float Distance = 0;
+ bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, -1.f * PlaneNormal, Distance);
+ Error += glm::abs(Distance - 1.f) <= std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += Result ? 0 : 1;
+ }
+
+ // check if plane is before of behind the ray origin
+ {
+ float Distance = 9.9999f; // value should not be changed
+ bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, -1.f * PlaneOrigin, PlaneNormal, Distance);
+ Error += glm::abs(Distance - 9.9999f) <= std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += Result ? 1 : 0; // there is no intersection in front of the ray origin, only behind
+ }
+
+ return Error;
+}
+
+int test_intersectRayTriangle()
+{
+ int Error = 0;
+
+ glm::vec3 const Orig(0, 0, 2);
+ glm::vec3 const Dir(0, 0, -1);
+ glm::vec3 const Vert0(0, 0, 0);
+ glm::vec3 const Vert1(-1, -1, 0);
+ glm::vec3 const Vert2(1, -1, 0);
+ glm::vec2 BaryPosition(0);
+ float Distance = 0;
+
+ bool const Result = glm::intersectRayTriangle(Orig, Dir, Vert0, Vert1, Vert2, BaryPosition, Distance);
+
+ Error += glm::all(glm::epsilonEqual(BaryPosition, glm::vec2(0), std::numeric_limits<float>::epsilon())) ? 0 : 1;
+ Error += glm::abs(Distance - 2.f) <= std::numeric_limits<float>::epsilon() ? 0 : 1;
+ Error += Result ? 0 : 1;
+
+ return Error;
+}
+
+int test_intersectLineTriangle()
+{
+ int Error = 0;
+
+ glm::vec3 const Orig(0, 0, 2);
+ glm::vec3 const Dir(0, 0, -1);
+ glm::vec3 const Vert0(0, 0, 0);
+ glm::vec3 const Vert1(-1, -1, 0);
+ glm::vec3 const Vert2(1, -1, 0);
+ glm::vec3 Position(2.0f, 0.0f, 0.0f);
+
+ bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position);
+
+ Error += glm::all(glm::epsilonEqual(Position, glm::vec3(2.0f, 0.0f, 0.0f), std::numeric_limits<float>::epsilon())) ? 0 : 1;
+ Error += Result ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_intersectRayPlane();
+ Error += test_intersectRayTriangle();
+ Error += test_intersectLineTriangle();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_io.cpp b/3rdparty/glm/source/test/gtx/gtx_io.cpp
new file mode 100644
index 0000000..7d90fd7
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_io.cpp
@@ -0,0 +1,186 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#if GLM_LANG & GLM_LANG_CXXMS_FLAG
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/io.hpp>
+#include <iostream>
+#include <sstream>
+#include <typeinfo>
+
+namespace
+{
+ template<typename CTy, typename CTr>
+ std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, glm::qualifier const& a)
+ {
+ typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os);
+
+ if (cerberus)
+ {
+ switch (a) {
+ case glm::highp: os << "uhi"; break;
+ case glm::mediump: os << "umd"; break;
+ case glm::lowp: os << "ulo"; break;
+# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+ case glm::aligned_highp: os << "ahi"; break;
+ case glm::aligned_mediump: os << "amd"; break;
+ case glm::aligned_lowp: os << "alo"; break;
+# endif
+ }
+ }
+
+ return os;
+ }
+
+ template<typename U, glm::qualifier P, typename T, typename CTy, typename CTr>
+ std::basic_string<CTy> type_name(std::basic_ostream<CTy,CTr>&, T const&)
+ {
+ std::basic_ostringstream<CTy,CTr> ostr;
+
+ if (typeid(T) == typeid(glm::qua<U,P>)) { ostr << "quat"; }
+ else if (typeid(T) == typeid(glm::vec<2, U,P>)) { ostr << "vec2"; }
+ else if (typeid(T) == typeid(glm::vec<3, U,P>)) { ostr << "vec3"; }
+ else if (typeid(T) == typeid(glm::vec<4, U,P>)) { ostr << "vec4"; }
+ else if (typeid(T) == typeid(glm::mat<2, 2, U,P>)) { ostr << "mat2x2"; }
+ else if (typeid(T) == typeid(glm::mat<2, 3, U,P>)) { ostr << "mat2x3"; }
+ else if (typeid(T) == typeid(glm::mat<2, 4, U,P>)) { ostr << "mat2x4"; }
+ else if (typeid(T) == typeid(glm::mat<3, 2, U,P>)) { ostr << "mat3x2"; }
+ else if (typeid(T) == typeid(glm::mat<3, 3, U,P>)) { ostr << "mat3x3"; }
+ else if (typeid(T) == typeid(glm::mat<3, 4, U,P>)) { ostr << "mat3x4"; }
+ else if (typeid(T) == typeid(glm::mat<4, 2, U,P>)) { ostr << "mat4x2"; }
+ else if (typeid(T) == typeid(glm::mat<4, 3, U,P>)) { ostr << "mat4x3"; }
+ else if (typeid(T) == typeid(glm::mat<4, 4, U,P>)) { ostr << "mat4x4"; }
+ else { ostr << "unknown"; }
+
+ ostr << '<' << typeid(U).name() << ',' << P << '>';
+
+ return ostr.str();
+ }
+} // namespace {
+
+template<typename T, glm::qualifier P, typename OS>
+int test_io_quat(OS& os)
+{
+ os << '\n' << typeid(OS).name() << '\n';
+
+ glm::qua<T, P> const q(1, 0, 0, 0);
+
+ {
+ glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
+
+ os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2)
+ << type_name<T, P>(os, q) << ": " << q << '\n';
+ }
+
+ {
+ glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
+
+ os << glm::io::unformatted
+ << type_name<T, P>(os, q) << ": " << q << '\n';
+ }
+
+ return 0;
+}
+
+template<typename T, glm::qualifier P, typename OS>
+int test_io_vec(OS& os)
+{
+ os << '\n' << typeid(OS).name() << '\n';
+
+ glm::vec<2, T,P> const v2(0, 1);
+ glm::vec<3, T,P> const v3(2, 3, 4);
+ glm::vec<4, T,P> const v4(5, 6, 7, 8);
+
+ os << type_name<T,P>(os, v2) << ": " << v2 << '\n'
+ << type_name<T,P>(os, v3) << ": " << v3 << '\n'
+ << type_name<T,P>(os, v4) << ": " << v4 << '\n';
+
+ glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
+
+ os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2)
+ << type_name<T,P>(os, v2) << ": " << v2 << '\n'
+ << type_name<T,P>(os, v3) << ": " << v3 << '\n'
+ << type_name<T,P>(os, v4) << ": " << v4 << '\n';
+
+ return 0;
+}
+
+template<typename T, glm::qualifier P, typename OS>
+int test_io_mat(OS& os, glm::io::order_type otype)
+{
+ os << '\n' << typeid(OS).name() << '\n';
+
+ glm::vec<2, T,P> const v2_1( 0, 1);
+ glm::vec<2, T,P> const v2_2( 2, 3);
+ glm::vec<2, T,P> const v2_3( 4, 5);
+ glm::vec<2, T,P> const v2_4( 6, 7);
+ glm::vec<3, T,P> const v3_1( 8, 9, 10);
+ glm::vec<3, T,P> const v3_2(11, 12, 13);
+ glm::vec<3, T,P> const v3_3(14, 15, 16);
+ glm::vec<3, T,P> const v3_4(17, 18, 19);
+ glm::vec<4, T,P> const v4_1(20, 21, 22, 23);
+ glm::vec<4, T,P> const v4_2(24, 25, 26, 27);
+ glm::vec<4, T,P> const v4_3(28, 29, 30, 31);
+ glm::vec<4, T,P> const v4_4(32, 33, 34, 35);
+
+ glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
+
+ os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2)
+ << glm::io::order(otype)
+ << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n'
+ << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n'
+ << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n'
+ << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n'
+ << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n'
+ << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n'
+ << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n'
+ << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n'
+ << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n';
+
+ os << glm::io::unformatted
+ << glm::io::order(otype)
+ << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n'
+ << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n'
+ << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n'
+ << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n'
+ << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n'
+ << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n'
+ << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n'
+ << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n'
+ << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n';
+
+ return 0;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_io_quat<float, glm::highp>(std::cout);
+ Error += test_io_quat<float, glm::highp>(std::wcout);
+ Error += test_io_quat<int, glm::mediump>(std::cout);
+ Error += test_io_quat<int, glm::mediump>(std::wcout);
+ Error += test_io_quat<glm::uint, glm::lowp>(std::cout);
+ Error += test_io_quat<glm::uint, glm::lowp>(std::wcout);
+
+ Error += test_io_vec<float, glm::highp>(std::cout);
+ Error += test_io_vec<float, glm::highp>(std::wcout);
+ Error += test_io_vec<int, glm::mediump>(std::cout);
+ Error += test_io_vec<int, glm::mediump>(std::wcout);
+ Error += test_io_vec<glm::uint, glm::lowp>(std::cout);
+ Error += test_io_vec<glm::uint, glm::lowp>(std::wcout);
+
+ Error += test_io_mat<float, glm::highp>(std::cout, glm::io::column_major);
+ Error += test_io_mat<float, glm::lowp>(std::wcout, glm::io::column_major);
+ Error += test_io_mat<float, glm::highp>(std::cout, glm::io::row_major);
+ Error += test_io_mat<float, glm::lowp>(std::wcout, glm::io::row_major);
+
+ return Error;
+}
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif// GLM_LANG & GLM_LANG_CXXMS_FLAG
diff --git a/3rdparty/glm/source/test/gtx/gtx_load.cpp b/3rdparty/glm/source/test/gtx/gtx_load.cpp
new file mode 100644
index 0000000..1467b9b
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_load.cpp
@@ -0,0 +1,124 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+/*
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+
+#include <glm/gtx/common.hpp>
+#include <glm/gtc/integer.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/type_aligned.hpp>
+#include <glm/ext/vector_relational.hpp>
+
+namespace glm
+{
+ enum genTypeEnum
+ {
+ QUALIFIER_HIGHP,
+ QUALIFIER_MEDIUMP,
+ QUALIFIER_LOWP
+ };
+
+ template <typename genType>
+ struct genTypeTrait
+ {};
+
+ template <length_t L, typename T>
+ struct genTypeTrait<vec<L, T, aligned_highp> >
+ {
+ static const genTypeEnum GENTYPE = QUALIFIER_HIGHP;
+ };
+
+ template <length_t L, typename T>
+ struct genTypeTrait<vec<L, T, aligned_mediump> >
+ {
+ static const genTypeEnum GENTYPE = QUALIFIER_MEDIUMP;
+ };
+
+ template <length_t L, typename T>
+ struct genTypeTrait<vec<L, T, aligned_lowp> >
+ {
+ static const genTypeEnum GENTYPE = QUALIFIER_LOWP;
+ };
+
+ template<length_t L, typename T, qualifier Q, bool isAligned>
+ struct load_gentype
+ {
+
+ };
+
+# if GLM_ARCH & GLM_ARCH_SSE_BIT
+ template<qualifier Q>
+ struct load_gentype<4, float, Q, true>
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, float, Q> load(float const* Mem)
+ {
+ vec<4, float, Q> Result;
+ Result.data = _mm_loadu_ps(Mem);
+ return Result;
+ }
+ };
+# endif//GLM_ARCH & GLM_ARCH_SSE_BIT
+
+ template<typename genType>
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType example_identity()
+ {
+ return detail::init_gentype<genType, detail::genTypeTrait<genType>::GENTYPE>::identity();
+ }
+
+ template <typename genType, typename valType>
+ genType load(valType const* Mem)
+ {
+
+ }
+
+ aligned_vec4 loadu(float const* Mem)
+ {
+ aligned_vec4 Result;
+# if GLM_ARCH & GLM_ARCH_SSE_BIT
+ Result.data = _mm_loadu_ps(Mem);
+# else
+ Result[0] = *(Mem + 0);
+ Result[1] = *(Mem + 1);
+ Result[2] = *(Mem + 2);
+ Result[3] = *(Mem + 3);
+# endif//GLM_ARCH & GLM_ARCH_SSE_BIT
+ return Result;
+ }
+
+ aligned_vec4 loada(float const* Mem)
+ {
+ aligned_vec4 Result;
+# if GLM_ARCH & GLM_ARCH_SSE_BIT
+ Result.data = _mm_load_ps(Mem);
+# else
+ Result[0] = *(Mem + 0);
+ Result[1] = *(Mem + 1);
+ Result[2] = *(Mem + 2);
+ Result[3] = *(Mem + 3);
+# endif//GLM_ARCH & GLM_ARCH_SSE_BIT
+ return Result;
+ }
+}//namespace glm
+
+int test_vec4_load()
+{
+ int Error = 0;
+
+ float Data[] = {1.f, 2.f, 3.f, 4.f};
+ glm::aligned_vec4 const V = glm::loadu(Data);
+ Error += glm::all(glm::equal(V, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+#endif
+*/
+int main()
+{
+ int Error = 0;
+/*
+# if GLM_CONFIG_SIMD == GLM_ENABLE
+ Error += test_vec4_load();
+# endif
+*/
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_log_base.cpp b/3rdparty/glm/source/test/gtx/gtx_log_base.cpp
new file mode 100644
index 0000000..37c7464
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_log_base.cpp
@@ -0,0 +1,54 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/log_base.hpp>
+#include <glm/gtc/vec1.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/exponential.hpp>
+
+namespace test_log
+{
+ int run()
+ {
+ int Error = 0;
+
+ {
+ float A = glm::log(10.f, 2.0f);
+ float B = glm::log2(10.f);
+ Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f));
+ glm::vec1 B = glm::log2(glm::vec1(10.f));
+ Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1;
+ }
+
+ {
+ glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f));
+ glm::vec2 B = glm::log2(glm::vec2(10.f));
+ Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1;
+ }
+
+ {
+ glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f));
+ glm::vec3 B = glm::log2(glm::vec3(10.f));
+ Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1;
+ }
+
+ {
+ glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f));
+ glm::vec4 B = glm::log2(glm::vec4(10.f));
+ Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1;
+ }
+
+ return Error;
+ }
+}//namespace test_log
+
+int main()
+{
+ int Error(0);
+
+ Error += test_log::run();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp
new file mode 100644
index 0000000..c1d0fa9
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_cross_product.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp
new file mode 100644
index 0000000..5a1884e
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp
@@ -0,0 +1,19 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_decompose.hpp>
+
+int main()
+{
+ int Error(0);
+
+ glm::mat4 Matrix(1);
+
+ glm::vec3 Scale;
+ glm::quat Orientation;
+ glm::vec3 Translation;
+ glm::vec3 Skew(1);
+ glm::vec4 Perspective(1);
+
+ glm::decompose(Matrix, Scale, Orientation, Translation, Skew, Perspective);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp
new file mode 100644
index 0000000..6771dba
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp
@@ -0,0 +1,105 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_factorisation.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/gtc/epsilon.hpp>
+
+template <glm::length_t C, glm::length_t R, typename T, glm::qualifier Q>
+int test_qr(glm::mat<C, R, T, Q> m)
+{
+ int Error = 0;
+
+ T const epsilon = static_cast<T>(1e-10);
+
+ glm::mat<(C < R ? C : R), R, T, Q> q(-999);
+ glm::mat<C, (C < R ? C : R), T, Q> r(-999);
+
+ glm::qr_decompose(m, q, r);
+
+ //Test if q*r really equals the input matrix
+ glm::mat<C, R, T, Q> tm = q*r;
+ glm::mat<C, R, T, Q> err = tm - m;
+
+ for (glm::length_t i = 0; i < C; i++)
+ for (glm::length_t j = 0; j < R; j++)
+ Error += glm::abs(err[i][j]) > epsilon ? 1 : 0;
+
+ //Test if the columns of q are orthonormal
+ for (glm::length_t i = 0; i < (C < R ? C : R); i++)
+ {
+ Error += (length(q[i]) - 1) > epsilon ? 1 : 0;
+
+ for (glm::length_t j = 0; j<i; j++)
+ Error += glm::abs(dot(q[i], q[j])) > epsilon ? 1 : 0;
+ }
+
+ //Test if the matrix r is upper triangular
+ for (glm::length_t i = 0; i < C; i++)
+ for (glm::length_t j = i + 1; j < (C < R ? C : R); j++)
+ Error += glm::epsilonEqual(r[i][j], static_cast<T>(0), glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+template <glm::length_t C, glm::length_t R, typename T, glm::qualifier Q>
+int test_rq(glm::mat<C, R, T, Q> m)
+{
+ int Error = 0;
+
+ T const epsilon = static_cast<T>(1e-10);
+
+ glm::mat<C, (C < R ? C : R), T, Q> q(-999);
+ glm::mat<(C < R ? C : R), R, T, Q> r(-999);
+
+ glm::rq_decompose(m, r, q);
+
+ //Test if q*r really equals the input matrix
+ glm::mat<C, R, T, Q> tm = r*q;
+ glm::mat<C, R, T, Q> err = tm - m;
+
+ for (glm::length_t i = 0; i < C; i++)
+ for (glm::length_t j = 0; j < R; j++)
+ Error += glm::abs(err[i][j]) > epsilon ? 1 : 0;
+
+ //Test if the rows of q are orthonormal
+ glm::mat<(C < R ? C : R), C, T, Q> tq = transpose(q);
+
+ for (glm::length_t i = 0; i < (C < R ? C : R); i++)
+ {
+ Error += (length(tq[i]) - 1) > epsilon ? 1 : 0;
+
+ for (glm::length_t j = 0; j<i; j++)
+ Error += glm::abs(dot(tq[i], tq[j])) > epsilon ? 1 : 0;
+ }
+
+ //Test if the matrix r is upper triangular
+ for (glm::length_t i = 0; i < (C < R ? C : R); i++)
+ for (glm::length_t j = R - (C < R ? C : R) + i + 1; j < R; j++)
+ Error += glm::epsilonEqual(r[i][j], static_cast<T>(0), glm::epsilon<T>()) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ //Test QR square
+ Error += test_qr(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0;
+
+ //Test RQ square
+ Error += test_rq(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0;
+
+ //Test QR triangular 1
+ Error += test_qr(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0;
+
+ //Test QR triangular 2
+ Error += test_qr(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0;
+
+ //Test RQ triangular 1 : Fails at the triangular test
+ Error += test_rq(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0;
+
+ //Test QR triangular 2
+ Error += test_rq(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0;
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp
new file mode 100644
index 0000000..108f02e
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp
@@ -0,0 +1,122 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtx/component_wise.hpp>
+#include <glm/gtx/matrix_interpolation.hpp>
+
+#include <iostream>
+#include <limits>
+#include <math.h>
+
+
+static int test_axisAngle()
+{
+ int Error = 0;
+
+ glm::mat4 m1(-0.9946f, 0.0f, -0.104531f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.104531f, 0.0f, -0.9946f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+ glm::mat4 m2(-0.992624f, 0.0f, -0.121874f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.121874f, 0.0f, -0.992624f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+
+ glm::mat4 const m1rot = glm::extractMatrixRotation(m1);
+ glm::mat4 const dltRotation = m2 * glm::transpose(m1rot);
+
+ glm::vec3 dltAxis(0.0f);
+ float dltAngle = 0.0f;
+ glm::axisAngle(dltRotation, dltAxis, dltAngle);
+
+ std::cout << "dltAxis: (" << dltAxis.x << ", " << dltAxis.y << ", " << dltAxis.z << "), dltAngle: " << dltAngle << std::endl;
+
+ glm::quat q = glm::quat_cast(dltRotation);
+ std::cout << "q: (" << q.x << ", " << q.y << ", " << q.z << ", " << q.w << ")" << std::endl;
+ float yaw = glm::yaw(q);
+ std::cout << "Yaw: " << yaw << std::endl;
+
+ return Error;
+}
+
+template <class T>
+int testForAxisAngle(glm::vec<3, T, glm::defaultp> const axisTrue, T const angleTrue)
+{
+ T const eps = std::sqrt(std::numeric_limits<T>::epsilon());
+
+ glm::mat<4, 4, T, glm::defaultp> const matTrue = glm::axisAngleMatrix(axisTrue, angleTrue);
+
+ glm::vec<3, T, glm::defaultp> axis;
+ T angle;
+ glm::axisAngle(matTrue, axis, angle);
+ glm::mat<4, 4, T, glm::defaultp> const matRebuilt = glm::axisAngleMatrix(axis, angle);
+
+ glm::mat<4, 4, T, glm::defaultp> const errMat = matTrue - matRebuilt;
+ T const maxErr = glm::compMax(glm::vec<4, T, glm::defaultp>(
+ glm::compMax(glm::abs(errMat[0])),
+ glm::compMax(glm::abs(errMat[1])),
+ glm::compMax(glm::abs(errMat[2])),
+ glm::compMax(glm::abs(errMat[3]))
+ ));
+
+ return maxErr < eps ? 0 : 1;
+}
+
+static int test_axisAngle2()
+{
+ int Error = 0;
+
+ Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.0f);
+ Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.00001f);
+ Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), 0.0001f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.005f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.005f);
+ Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.03f);
+ Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.0003f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.01f);
+ Error += testForAxisAngle(glm::dvec3(0.0f, 1.0f, 0.0f), 0.00005);
+ Error += testForAxisAngle(glm::dvec3(-1.0f, 0.0f, 0.0f), 0.000001);
+ Error += testForAxisAngle(glm::dvec3(0.7071f, 0.7071f, 0.0f), 0.5);
+ Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0002);
+ Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.00002);
+ Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.000002);
+ Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0000002);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 1.3f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 6.3f);
+ Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), -0.23456f);
+ Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi<float>());
+ Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi<float>());
+ Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi<float>());
+ Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi<float>() + 2e-6f);
+ Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi<float>() + 1e-4f);
+ Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi<float>() + 1e-3f);
+ Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi<float>() + 5e-3f);
+
+ return Error;
+}
+
+static int test_rotate()
+{
+ glm::mat4 m2(1.0);
+ float myAngle = 1.0f;
+ m2 = glm::rotate(m2, myAngle, glm::vec3(1.0f, 0.0f, 0.0f));
+ glm::vec3 m2Axis;
+ float m2Angle;
+ glm::axisAngle(m2, m2Axis, m2Angle);
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_axisAngle();
+ Error += test_axisAngle2();
+ Error += test_rotate();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp
new file mode 100644
index 0000000..21de7f7
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_major_storage.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp
new file mode 100644
index 0000000..79c95c5
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp
@@ -0,0 +1,86 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/matrix_operation.hpp>
+#include <limits>
+
+int test_adjugate()
+{
+ int Error = 0;
+
+ const float epsilon = std::numeric_limits<float>::epsilon();
+
+ // mat2
+ const glm::mat2 m2(
+ 2, 3,
+ 1, 5
+ );
+
+ const glm::mat2 eam2(
+ 5, -3,
+ -1, 2
+ );
+
+ const glm::mat2 am2 = glm::adjugate(m2);
+
+ Error += glm::all(glm::bvec2(
+ glm::all(glm::epsilonEqual(am2[0], eam2[0], epsilon)),
+ glm::all(glm::epsilonEqual(am2[1], eam2[1], epsilon))
+ )) ? 0 : 1;
+
+ // mat3
+ const glm::mat3 m3(
+ 2, 3, 3,
+ 1, 5, 4,
+ 4, 6, 8
+ );
+
+ const glm::mat3 eam3(
+ 16, -6, -3,
+ 8, 4, -5,
+ -14, 0, 7
+ );
+
+ const glm::mat3 am3 = glm::adjugate(m3);
+
+ Error += glm::all(glm::bvec3(
+ glm::all(glm::epsilonEqual(am3[0], eam3[0], epsilon)),
+ glm::all(glm::epsilonEqual(am3[1], eam3[1], epsilon)),
+ glm::all(glm::epsilonEqual(am3[2], eam3[2], epsilon))
+ )) ? 0 : 1;
+
+ // mat4
+ const glm::mat4 m4(
+ 2, 3, 3, 1,
+ 1, 5, 4, 3,
+ 4, 6, 8, 5,
+ -2, -3, -3, 4
+ );
+
+ const glm::mat4 eam4(
+ 97, -30, -15, 17,
+ 45, 20, -25, 5,
+ -91, 0, 35, -21,
+ 14, 0, 0, 14
+ );
+
+ const glm::mat4 am4 = glm::adjugate(m4);
+
+ Error += glm::all(glm::bvec4(
+ glm::all(glm::epsilonEqual(am4[0], eam4[0], epsilon)),
+ glm::all(glm::epsilonEqual(am4[1], eam4[1], epsilon)),
+ glm::all(glm::epsilonEqual(am4[2], eam4[2], epsilon)),
+ glm::all(glm::epsilonEqual(am4[3], eam4[3], epsilon))
+ )) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_adjugate();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp
new file mode 100644
index 0000000..0dda1f0
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp
@@ -0,0 +1,66 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_query.hpp>
+
+int test_isNull()
+{
+ int Error(0);
+
+ bool TestA = glm::isNull(glm::mat4(0), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int test_isIdentity()
+{
+ int Error(0);
+
+ {
+ bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+ {
+ bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+ {
+ bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_isNormalized()
+{
+ int Error(0);
+
+ bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int test_isOrthogonal()
+{
+ int Error(0);
+
+ bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_isNull();
+ Error += test_isIdentity();
+ Error += test_isNormalized();
+ Error += test_isOrthogonal();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp
new file mode 100644
index 0000000..f80d263
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/matrix_transform_2d.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp b/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp
new file mode 100644
index 0000000..ab59bb2
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp
@@ -0,0 +1,18 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2013-10-25
+// Updated : 2013-10-25
+// Licence : This source is under MIT licence
+// File : test/gtx/associated_min_max.cpp
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/gtc/type_precision.hpp>
+#include <glm/gtx/associated_min_max.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_norm.cpp b/3rdparty/glm/source/test/gtx/gtx_norm.cpp
new file mode 100644
index 0000000..e82102a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_norm.cpp
@@ -0,0 +1,81 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/norm.hpp>
+
+
+int test_lMaxNorm()
+{
+ int Error(0);
+
+ {
+ float norm = glm::lMaxNorm(glm::vec3(-1, -2, -3));
+ Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ float norm = glm::lMaxNorm(glm::vec3(2, 3, 1));
+ Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_lxNorm()
+{
+ int Error(0);
+
+ {
+ unsigned int depth_1 = 1;
+ float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_1);
+ float normB = glm::l1Norm(glm::vec3(2, 3, 1));
+ Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
+ Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ unsigned int depth_1 = 1;
+ float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_1);
+ float normB = glm::l1Norm(glm::vec3(-1, -2, -3));
+ Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
+ Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ unsigned int depth_2 = 2;
+ float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_2);
+ float normB = glm::l2Norm(glm::vec3(2, 3, 1));
+ Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
+ Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ unsigned int depth_2 = 2;
+ float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_2);
+ float normB = glm::l2Norm(glm::vec3(-1, -2, -3));
+ Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1;
+ Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ unsigned int oddDepth = 3;
+ float norm = glm::lxNorm(glm::vec3(2, 3, 1), oddDepth);
+ Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1;
+ }
+
+ {
+ unsigned int oddDepth = 3;
+ float norm = glm::lxNorm(glm::vec3(-1, -2, -3), oddDepth);
+ Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_lMaxNorm();
+ Error += test_lxNorm();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_normal.cpp b/3rdparty/glm/source/test/gtx/gtx_normal.cpp
new file mode 100644
index 0000000..7a01ec0
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_normal.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/normal.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp b/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp
new file mode 100644
index 0000000..9605863
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/normalize_dot.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp b/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp
new file mode 100644
index 0000000..a5a3ef2
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/number_precision.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp b/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp
new file mode 100644
index 0000000..c0a3fd4
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/optimum_pow.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp b/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp
new file mode 100644
index 0000000..0e7a8c8
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/orthonormalize.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_pca.cpp b/3rdparty/glm/source/test/gtx/gtx_pca.cpp
new file mode 100644
index 0000000..120e277
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_pca.cpp
@@ -0,0 +1,724 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#include <glm/gtx/pca.hpp>
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtx/string_cast.hpp>
+
+#include <cstdio>
+#include <vector>
+#if GLM_HAS_CXX11_STL == 1
+#include <random>
+#endif
+
+template<typename T>
+T myEpsilon();
+template<>
+GLM_INLINE GLM_CONSTEXPR float myEpsilon<float>() { return 0.00001f; }
+template<>
+GLM_INLINE GLM_CONSTEXPR double myEpsilon<double>() { return 0.000001; }
+
+template<glm::length_t D, typename T, glm::qualifier Q>
+bool vectorEpsilonEqual(glm::vec<D, T, Q> const& a, glm::vec<D, T, Q> const& b, T epsilon)
+{
+ for (int c = 0; c < D; ++c)
+ if (!glm::epsilonEqual(a[c], b[c], epsilon))
+ {
+ fprintf(stderr, "failing vectorEpsilonEqual: [%d] %lf != %lf (~%lf)\n",
+ c,
+ static_cast<double>(a[c]),
+ static_cast<double>(b[c]),
+ static_cast<double>(epsilon)
+ );
+ return false;
+ }
+ return true;
+}
+
+template<glm::length_t D, typename T, glm::qualifier Q>
+bool matrixEpsilonEqual(glm::mat<D, D, T, Q> const& a, glm::mat<D, D, T, Q> const& b, T epsilon)
+{
+ for (int c = 0; c < D; ++c)
+ for (int r = 0; r < D; ++r)
+ if (!glm::epsilonEqual(a[c][r], b[c][r], epsilon))
+ {
+ fprintf(stderr, "failing vectorEpsilonEqual: [%d][%d] %lf != %lf (~%lf)\n",
+ c, r,
+ static_cast<double>(a[c][r]),
+ static_cast<double>(b[c][r]),
+ static_cast<double>(epsilon)
+ );
+ return false;
+ }
+ return true;
+}
+
+template<typename T>
+GLM_INLINE bool sameSign(T const& a, T const& b)
+{
+ return ((a >= 0) && (b >= 0)) || ((a < 0) && (b < 0));
+}
+
+template<typename T>
+T failReport(T line)
+{
+ fprintf(stderr, "Failed in line %d\n", static_cast<int>(line));
+ return line;
+}
+
+// Test data: 1AGA 'agarose double helix'
+// https://www.rcsb.org/structure/1aga
+// The fourth coordinate is randomized
+namespace _1aga
+{
+
+ // Fills `outTestData` with hard-coded atom positions from 1AGA
+ // The fourth coordinate is randomized
+ template<typename vec>
+ void fillTestData(std::vector<vec>& outTestData)
+ {
+ // x,y,z coordinates copied from RCSB PDB file of 1AGA
+ // w coordinate randomized with standard normal distribution
+ static const double _1aga[] = {
+ 3.219, -0.637, 19.462, 2.286,
+ 4.519, 0.024, 18.980, -0.828,
+ 4.163, 1.425, 18.481, -0.810,
+ 3.190, 1.341, 17.330, -0.170,
+ 1.962, 0.991, 18.165, 0.816,
+ 2.093, 1.952, 19.331, 0.276,
+ 5.119, -0.701, 17.908, -0.490,
+ 3.517, 2.147, 19.514, -0.207,
+ 2.970, 2.609, 16.719, 0.552,
+ 2.107, -0.398, 18.564, 0.403,
+ 2.847, 2.618, 15.335, 0.315,
+ 1.457, 3.124, 14.979, 0.683,
+ 1.316, 3.291, 13.473, 0.446,
+ 2.447, 4.155, 12.931, 1.324,
+ 3.795, 3.614, 13.394, 0.112,
+ 4.956, 4.494, 12.982, 0.253,
+ 0.483, 2.217, 15.479, 1.316,
+ 0.021, 3.962, 13.166, 1.522,
+ 2.311, 5.497, 13.395, 0.248,
+ 3.830, 3.522, 14.827, 0.591,
+ 5.150, 4.461, 11.576, 0.635,
+ -1.057, 3.106, 13.132, 0.191,
+ -2.280, 3.902, 12.650, 1.135,
+ -3.316, 2.893, 12.151, 0.794,
+ -2.756, 2.092, 11.000, 0.720,
+ -1.839, 1.204, 11.835, -1.172,
+ -2.737, 0.837, 13.001, -0.313,
+ -1.952, 4.784, 11.578, 2.082,
+ -3.617, 1.972, 13.184, 0.653,
+ -3.744, 1.267, 10.389, -0.413,
+ -0.709, 2.024, 12.234, -1.747,
+ -3.690, 1.156, 9.005, -1.275,
+ -3.434, -0.300, 8.649, 0.441,
+ -3.508, -0.506, 7.143, 0.237,
+ -4.822, 0.042, 6.601, -2.856,
+ -5.027, 1.480, 7.064, 0.985,
+ -6.370, 2.045, 6.652, 0.915,
+ -2.162, -0.690, 9.149, 1.100,
+ -3.442, -1.963, 6.836, -0.081,
+ -5.916, -0.747, 7.065, -2.345,
+ -4.965, 1.556, 8.497, 0.504,
+ -6.439, 2.230, 5.246, 1.451,
+ -2.161, -2.469, 6.802, -1.171,
+ -2.239, -3.925, 6.320, -1.434,
+ -0.847, -4.318, 5.821, 0.098,
+ -0.434, -3.433, 4.670, -1.446,
+ -0.123, -2.195, 5.505, 0.182,
+ 0.644, -2.789, 6.671, 0.865,
+ -3.167, -4.083, 5.248, -0.098,
+ 0.101, -4.119, 6.854, -0.001,
+ 0.775, -3.876, 4.059, 1.061,
+ -1.398, -1.625, 5.904, 0.230,
+ 0.844, -3.774, 2.675, 1.313,
+ 1.977, -2.824, 2.319, -0.112,
+ 2.192, -2.785, 0.813, -0.981,
+ 2.375, -4.197, 0.271, -0.355,
+ 1.232, -5.093, 0.734, 0.632,
+ 1.414, -6.539, 0.322, 0.576,
+ 1.678, -1.527, 2.819, -1.187,
+ 3.421, -1.999, 0.496, -1.770,
+ 3.605, -4.750, 0.735, 1.099,
+ 1.135, -5.078, 2.167, 0.854,
+ 1.289, -6.691, -1.084, -0.487,
+ -1.057, 3.106, 22.602, -1.297,
+ -2.280, 3.902, 22.120, 0.376,
+ -3.316, 2.893, 21.621, 0.932,
+ -2.756, 2.092, 20.470, 1.680,
+ -1.839, 1.204, 21.305, 0.615,
+ -2.737, 0.837, 22.471, 0.899,
+ -1.952, 4.784, 21.048, -0.521,
+ -3.617, 1.972, 22.654, 0.133,
+ -3.744, 1.267, 19.859, 0.081,
+ -0.709, 2.024, 21.704, 1.420,
+ -3.690, 1.156, 18.475, -0.850,
+ -3.434, -0.300, 18.119, -0.249,
+ -3.508, -0.506, 16.613, 1.434,
+ -4.822, 0.042, 16.071, -2.466,
+ -5.027, 1.480, 16.534, -1.045,
+ -6.370, 2.045, 16.122, 1.707,
+ -2.162, -0.690, 18.619, -2.023,
+ -3.442, -1.963, 16.336, -0.304,
+ -5.916, -0.747, 16.535, 0.979,
+ -4.965, 1.556, 17.967, -1.165,
+ -6.439, 2.230, 14.716, 0.929,
+ -2.161, -2.469, 16.302, -0.234,
+ -2.239, -3.925, 15.820, -0.228,
+ -0.847, -4.318, 15.321, 1.844,
+ -0.434, -3.433, 14.170, 1.132,
+ -0.123, -2.195, 15.005, 0.211,
+ 0.644, -2.789, 16.171, -0.632,
+ -3.167, -4.083, 14.748, -0.519,
+ 0.101, -4.119, 16.354, 0.173,
+ 0.775, -3.876, 13.559, 1.243,
+ -1.398, -1.625, 15.404, -0.187,
+ 0.844, -3.774, 12.175, -1.332,
+ 1.977, -2.824, 11.819, -1.616,
+ 2.192, -2.785, 10.313, 1.320,
+ 2.375, -4.197, 9.771, 0.237,
+ 1.232, -5.093, 10.234, 0.851,
+ 1.414, -6.539, 9.822, 1.816,
+ 1.678, -1.527, 12.319, -1.657,
+ 3.421, -1.999, 10.036, 1.559,
+ 3.605, -4.750, 10.235, 0.831,
+ 1.135, -5.078, 11.667, 0.060,
+ 1.289, -6.691, 8.416, 1.066,
+ 3.219, -0.637, 10.002, 2.111,
+ 4.519, 0.024, 9.520, -0.874,
+ 4.163, 1.425, 9.021, -1.012,
+ 3.190, 1.341, 7.870, -0.250,
+ 1.962, 0.991, 8.705, -1.359,
+ 2.093, 1.952, 9.871, -0.126,
+ 5.119, -0.701, 8.448, 0.995,
+ 3.517, 2.147, 10.054, 0.941,
+ 2.970, 2.609, 7.259, -0.562,
+ 2.107, -0.398, 9.104, -0.038,
+ 2.847, 2.618, 5.875, 0.398,
+ 1.457, 3.124, 5.519, 0.481,
+ 1.316, 3.291, 4.013, -0.187,
+ 2.447, 4.155, 3.471, -0.429,
+ 3.795, 3.614, 3.934, -0.432,
+ 4.956, 4.494, 3.522, -0.788,
+ 0.483, 2.217, 6.019, -0.923,
+ 0.021, 3.962, 3.636, -0.316,
+ 2.311, 5.497, 3.935, -1.917,
+ 3.830, 3.522, 5.367, -0.302,
+ 5.150, 4.461, 2.116, -1.615
+ };
+ static const glm::length_t _1agaSize = sizeof(_1aga) / (4 * sizeof(double));
+
+ outTestData.resize(_1agaSize);
+ for(glm::length_t i = 0; i < _1agaSize; ++i)
+ for(glm::length_t d = 0; d < static_cast<glm::length_t>(vec::length()); ++d)
+ outTestData[i][d] = static_cast<typename vec::value_type>(_1aga[i * 4 + d]);
+ }
+
+ // All reference values computed separately using symbolic precision
+ // https://github.com/sgrottel/exp-pca-precision
+ // This applies to all functions named: `_1aga::expected*()`
+
+ GLM_INLINE glm::dmat4 const& expectedCovarData()
+ {
+ static const glm::dmat4 covar4x4d(
+ 9.62434068027210898322, -0.00006657369614512471, -4.29321376568405099761, 0.01879374187452758846,
+ -0.00006657369614512471, 9.62443937868480681175, 5.35113872637944076871, -0.11569259145880574080,
+ -4.29321376568405099761, 5.35113872637944076871, 35.62848549634668415820, 0.90874239254220201545,
+ 0.01879374187452758846, -0.11569259145880574080, 0.90874239254220201545, 1.09705971856890904803
+ );
+ return covar4x4d;
+ }
+
+ template<glm::length_t D>
+ GLM_INLINE glm::vec<D, double, glm::defaultp> const& expectedEigenvalues();
+ template<>
+ GLM_INLINE glm::dvec2 const& expectedEigenvalues<2>()
+ {
+ static const glm::dvec2 evals2(
+ 9.62447289926297399961763301774251330057894539467032275382255,
+ 9.62430715969394210015560961264297422776572580714373620309355
+ );
+ return evals2;
+ }
+ template<>
+ GLM_INLINE glm::dvec3 const& expectedEigenvalues<3>()
+ {
+ static const glm::dvec3 evals3(
+ 37.3274494274683425233695502581182052836449738530676689472257,
+ 9.62431434161498823505729817436585077939509766554969096873168,
+ 7.92550178622027216422369326567668971675332732240052872097887
+ );
+ return evals3;
+ }
+ template<>
+ GLM_INLINE glm::dvec4 const& expectedEigenvalues<4>()
+ {
+ static const glm::dvec4 evals4(
+ 37.3477389918792213596879452204499702406947817221901007885630,
+ 9.62470688921105696017807313860277172063600080413412567999700,
+ 7.94017075281634999342344275928070533134615133171969063657713,
+ 1.06170863996588365446060186982477896078741484440002343404155
+ );
+ return evals4;
+ }
+
+ template<glm::length_t D>
+ GLM_INLINE glm::mat<D, D, double, glm::defaultp> const& expectedEigenvectors();
+ template<>
+ GLM_INLINE glm::dmat2 const& expectedEigenvectors<2>()
+ {
+ static const glm::dmat2 evecs2(
+ glm::dvec2(
+ -0.503510847492551904906870957742619139443409162857537237123308,
+ 1
+ ),
+ glm::dvec2(
+ 1.98605453086051402895741763848787613048533838388005162794043,
+ 1
+ )
+ );
+ return evecs2;
+ }
+ template<>
+ GLM_INLINE glm::dmat3 const& expectedEigenvectors<3>()
+ {
+ static const glm::dmat3 evecs3(
+ glm::dvec3(
+ -0.154972738414395866005286433008304444294405085038689821864654,
+ 0.193161285869815165989799191097521722568079378840201629578695,
+ 1
+ ),
+ glm::dvec3(
+ -158565.112775416943154745839952575022429933119522746586149868,
+ -127221.506282351944358932458687410410814983610301927832439675,
+ 1
+ ),
+ glm::dvec3(
+ 2.52702248596556806145700361724323960543858113426446460406536,
+ -3.14959802931313870497377546974185300816008580801457419079412,
+ 1
+ )
+ );
+ return evecs3;
+ }
+ template<>
+ GLM_INLINE glm::dmat4 const& expectedEigenvectors<4>()
+ {
+ static const glm::dmat4 evecs4(
+ glm::dvec4(
+ -6.35322390281037045217295803597357821705371650876122113027264,
+ 7.91546394153385394517767054617789939529794642646629201212056,
+ 41.0301543819240679808549819457450130787045236815736490549663,
+ 1
+ ),
+ glm::dvec4(
+ -114.622418941087829756565311692197154422302604224781253861297,
+ -92.2070185807065289900871215218752013659402949497379896153118,
+ 0.0155846091025912430932734548933329458404665760587569100867246,
+ 1
+ ),
+ glm::dvec4(
+ 13.1771887761559019483954743159026938257325190511642952175789,
+ -16.3688257459634877666638419310116970616615816436949741766895,
+ 5.17386502341472097227408249233288958059579189051394773143190,
+ 1
+ ),
+ glm::dvec4(
+ -0.0192777078948229800494895064532553117703859768210647632969276,
+ 0.0348034950916108873629241563077465542944938906271231198634442,
+ -0.0340715609308469289267379681032545422644143611273049912226126,
+ 1
+ )
+ );
+ return evecs4;
+ }
+
+} // namespace _1aga
+
+// Compute center of gravity
+template<typename vec>
+vec computeCenter(const std::vector<vec>& testData)
+{
+ double c[4];
+ std::fill(c, c + vec::length(), 0.0);
+
+ typename std::vector<vec>::const_iterator e = testData.end();
+ for(typename std::vector<vec>::const_iterator i = testData.begin(); i != e; ++i)
+ for(glm::length_t d = 0; d < static_cast<glm::length_t>(vec::length()); ++d)
+ c[d] += static_cast<double>((*i)[d]);
+
+ vec cVec(0);
+ for(glm::length_t d = 0; d < static_cast<glm::length_t>(vec::length()); ++d)
+ cVec[d] = static_cast<typename vec::value_type>(c[d] / static_cast<double>(testData.size()));
+ return cVec;
+}
+
+// Test sorting of Eigenvalue&Eigenvector lists. Use exhaustive search.
+template<glm::length_t D, typename T, glm::qualifier Q>
+int testEigenvalueSort()
+{
+ // Test input data: four arbitrary values
+ static const glm::vec<D, T, Q> refVal(
+ glm::vec<4, T, Q>(
+ 10, 8, 6, 4
+ )
+ );
+ // Test input data: four arbitrary vectors, which can be matched to the above values
+ static const glm::mat<D, D, T, Q> refVec(
+ glm::mat<4, 4, T, Q>(
+ 10, 20, 5, 40,
+ 8, 16, 4, 32,
+ 6, 12, 3, 24,
+ 4, 8, 2, 16
+ )
+ );
+ // Permutations of test input data for exhaustive check, based on `D` (1 <= D <= 4)
+ static const int permutationCount[] = {
+ 0,
+ 1,
+ 2,
+ 6,
+ 24
+ };
+ // The permutations t perform, based on `D` (1 <= D <= 4)
+ static const glm::ivec4 permutation[] = {
+ glm::ivec4(0, 1, 2, 3),
+ glm::ivec4(1, 0, 2, 3), // last for D = 2
+ glm::ivec4(0, 2, 1, 3),
+ glm::ivec4(1, 2, 0, 3),
+ glm::ivec4(2, 0, 1, 3),
+ glm::ivec4(2, 1, 0, 3), // last for D = 3
+ glm::ivec4(0, 1, 3, 2),
+ glm::ivec4(1, 0, 3, 2),
+ glm::ivec4(0, 2, 3, 1),
+ glm::ivec4(1, 2, 3, 0),
+ glm::ivec4(2, 0, 3, 1),
+ glm::ivec4(2, 1, 3, 0),
+ glm::ivec4(0, 3, 1, 2),
+ glm::ivec4(1, 3, 0, 2),
+ glm::ivec4(0, 3, 2, 1),
+ glm::ivec4(1, 3, 2, 0),
+ glm::ivec4(2, 3, 0, 1),
+ glm::ivec4(2, 3, 1, 0),
+ glm::ivec4(3, 0, 1, 2),
+ glm::ivec4(3, 1, 0, 2),
+ glm::ivec4(3, 0, 2, 1),
+ glm::ivec4(3, 1, 2, 0),
+ glm::ivec4(3, 2, 0, 1),
+ glm::ivec4(3, 2, 1, 0) // last for D = 4
+ };
+
+ // initial sanity check
+ if(!vectorEpsilonEqual(refVal, refVal, myEpsilon<T>()))
+ return failReport(__LINE__);
+ if(!matrixEpsilonEqual(refVec, refVec, myEpsilon<T>()))
+ return failReport(__LINE__);
+
+ // Exhaustive search through all permutations
+ for(int p = 0; p < permutationCount[D]; ++p)
+ {
+ glm::vec<D, T, Q> testVal;
+ glm::mat<D, D, T, Q> testVec;
+ for(int i = 0; i < D; ++i)
+ {
+ testVal[i] = refVal[permutation[p][i]];
+ testVec[i] = refVec[permutation[p][i]];
+ }
+
+ glm::sortEigenvalues(testVal, testVec);
+
+ if (!vectorEpsilonEqual(testVal, refVal, myEpsilon<T>()))
+ return failReport(__LINE__);
+ if (!matrixEpsilonEqual(testVec, refVec, myEpsilon<T>()))
+ return failReport(__LINE__);
+ }
+
+ return 0;
+}
+
+// Test covariance matrix creation functions
+template<glm::length_t D, typename T, glm::qualifier Q>
+int testCovar(
+#if GLM_HAS_CXX11_STL == 1
+ glm::length_t dataSize, unsigned int randomEngineSeed
+#else // GLM_HAS_CXX11_STL == 1
+ glm::length_t, unsigned int
+#endif // GLM_HAS_CXX11_STL == 1
+)
+{
+ typedef glm::vec<D, T, Q> vec;
+ typedef glm::mat<D, D, T, Q> mat;
+
+ // #1: test expected result with fixed data set
+ std::vector<vec> testData;
+ _1aga::fillTestData(testData);
+
+ // compute center of gravity
+ vec center = computeCenter(testData);
+
+ mat covarMat = glm::computeCovarianceMatrix(testData.data(), testData.size(), center);
+ if(!matrixEpsilonEqual(covarMat, mat(_1aga::expectedCovarData()), myEpsilon<T>()))
+ {
+ fprintf(stderr, "Reconstructed covarMat:\n%s\n", glm::to_string(covarMat).c_str());
+ return failReport(__LINE__);
+ }
+
+ // #2: test function variant consitency with random data
+#if GLM_HAS_CXX11_STL == 1
+ std::default_random_engine rndEng(randomEngineSeed);
+ std::normal_distribution<T> normalDist;
+ testData.resize(dataSize);
+ // some common offset of all data
+ T offset[D];
+ for(glm::length_t d = 0; d < D; ++d)
+ offset[d] = normalDist(rndEng);
+ // init data
+ for(glm::length_t i = 0; i < dataSize; ++i)
+ for(glm::length_t d = 0; d < D; ++d)
+ testData[i][d] = offset[d] + normalDist(rndEng);
+ center = computeCenter(testData);
+
+ std::vector<vec> centeredTestData;
+ centeredTestData.reserve(testData.size());
+ typename std::vector<vec>::const_iterator e = testData.end();
+ for(typename std::vector<vec>::const_iterator i = testData.begin(); i != e; ++i)
+ centeredTestData.push_back((*i) - center);
+
+ mat c1 = glm::computeCovarianceMatrix(centeredTestData.data(), centeredTestData.size());
+ mat c2 = glm::computeCovarianceMatrix<D, T, Q>(centeredTestData.begin(), centeredTestData.end());
+ mat c3 = glm::computeCovarianceMatrix(testData.data(), testData.size(), center);
+ mat c4 = glm::computeCovarianceMatrix<D, T, Q>(testData.rbegin(), testData.rend(), center);
+
+ if(!matrixEpsilonEqual(c1, c2, myEpsilon<T>()))
+ return failReport(__LINE__);
+ if(!matrixEpsilonEqual(c1, c3, myEpsilon<T>()))
+ return failReport(__LINE__);
+ if(!matrixEpsilonEqual(c1, c4, myEpsilon<T>()))
+ return failReport(__LINE__);
+#endif // GLM_HAS_CXX11_STL == 1
+ return 0;
+}
+
+// Computes eigenvalues and eigenvectors from well-known covariance matrix
+template<glm::length_t D, typename T, glm::qualifier Q>
+int testEigenvectors(T epsilon)
+{
+ typedef glm::vec<D, T, Q> vec;
+ typedef glm::mat<D, D, T, Q> mat;
+
+ // test expected result with fixed data set
+ std::vector<vec> testData;
+ mat covarMat(_1aga::expectedCovarData());
+
+ vec eigenvalues;
+ mat eigenvectors;
+ unsigned int c = glm::findEigenvaluesSymReal(covarMat, eigenvalues, eigenvectors);
+ if(c != D)
+ return failReport(__LINE__);
+ glm::sortEigenvalues(eigenvalues, eigenvectors);
+
+ if (!vectorEpsilonEqual(eigenvalues, vec(_1aga::expectedEigenvalues<D>()), epsilon))
+ return failReport(__LINE__);
+
+ for (int i = 0; i < D; ++i)
+ {
+ vec act = glm::normalize(eigenvectors[i]);
+ vec exp = glm::normalize(_1aga::expectedEigenvectors<D>()[i]);
+ if (!sameSign(act[0], exp[0])) exp = -exp;
+ if (!vectorEpsilonEqual(act, exp, epsilon))
+ return failReport(__LINE__);
+ }
+
+ return 0;
+}
+
+// A simple small smoke test:
+// - a uniformly sampled block
+// - reconstruct main axes
+// - check order of eigenvalues equals order of extends of block in direction of main axes
+int smokeTest()
+{
+ using glm::vec3;
+ using glm::mat3;
+ std::vector<vec3> pts;
+ pts.reserve(11 * 15 * 7);
+
+ for(int x = -5; x <= 5; ++x)
+ for(int y = -7; y <= 7; ++y)
+ for(int z = -3; z <= 3; ++z)
+ pts.push_back(vec3(x, y, z));
+
+ mat3 covar = glm::computeCovarianceMatrix(pts.data(), pts.size());
+ mat3 eVec;
+ vec3 eVal;
+ int eCnt = glm::findEigenvaluesSymReal(covar, eVal, eVec);
+ if(eCnt != 3)
+ return failReport(__LINE__);
+
+ // sort eVec by decending eVal
+ if(eVal[0] < eVal[1])
+ {
+ std::swap(eVal[0], eVal[1]);
+ std::swap(eVec[0], eVec[1]);
+ }
+ if(eVal[0] < eVal[2])
+ {
+ std::swap(eVal[0], eVal[2]);
+ std::swap(eVec[0], eVec[2]);
+ }
+ if(eVal[1] < eVal[2])
+ {
+ std::swap(eVal[1], eVal[2]);
+ std::swap(eVec[1], eVec[2]);
+ }
+
+ if(!vectorEpsilonEqual(glm::abs(eVec[0]), vec3(0, 1, 0), myEpsilon<float>()))
+ return failReport(__LINE__);
+ if(!vectorEpsilonEqual(glm::abs(eVec[1]), vec3(1, 0, 0), myEpsilon<float>()))
+ return failReport(__LINE__);
+ if(!vectorEpsilonEqual(glm::abs(eVec[2]), vec3(0, 0, 1), myEpsilon<float>()))
+ return failReport(__LINE__);
+
+ return 0;
+}
+
+#if GLM_HAS_CXX11_STL == 1
+int rndTest(unsigned int randomEngineSeed)
+{
+ std::default_random_engine rndEng(randomEngineSeed);
+ std::normal_distribution<double> normalDist;
+
+ // construct orthonormal system
+ glm::dvec3 x(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ double l = glm::length(x);
+ while(l < myEpsilon<double>())
+ x = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ x = glm::normalize(x);
+ glm::dvec3 y(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ l = glm::length(y);
+ while(l < myEpsilon<double>())
+ y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ while(glm::abs(glm::dot(x, y)) < myEpsilon<double>())
+ {
+ y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ while(l < myEpsilon<double>())
+ y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ }
+ y = glm::normalize(y);
+ glm::dvec3 z = glm::normalize(glm::cross(x, y));
+ y = glm::normalize(glm::cross(z, x));
+
+ // generate input point data
+ std::vector<glm::dvec3> ptData;
+ static const int pattern[] = {
+ 8, 0, 0,
+ 4, 1, 2,
+ 0, 2, 0,
+ 0, 0, 4
+ };
+ glm::dvec3 offset(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng));
+ for(int p = 0; p < 4; ++p)
+ for(int xs = 1; xs >= -1; xs -= 2)
+ for(int ys = 1; ys >= -1; ys -= 2)
+ for(int zs = 1; zs >= -1; zs -= 2)
+ ptData.push_back(
+ offset
+ + x * static_cast<double>(pattern[p * 3 + 0] * xs)
+ + y * static_cast<double>(pattern[p * 3 + 1] * ys)
+ + z * static_cast<double>(pattern[p * 3 + 2] * zs));
+
+ // perform PCA:
+ glm::dvec3 center = computeCenter(ptData);
+ glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center);
+ glm::dvec3 evals;
+ glm::dmat3 evecs;
+ int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs);
+ if(evcnt != 3)
+ return failReport(__LINE__);
+ glm::sortEigenvalues(evals, evecs);
+
+ if (!sameSign(evecs[0][0], x[0])) evecs[0] = -evecs[0];
+ if(!vectorEpsilonEqual(x, evecs[0], myEpsilon<double>()))
+ return failReport(__LINE__);
+ if (!sameSign(evecs[2][0], y[0])) evecs[2] = -evecs[2];
+ if (!vectorEpsilonEqual(y, evecs[2], myEpsilon<double>()))
+ return failReport(__LINE__);
+ if (!sameSign(evecs[1][0], z[0])) evecs[1] = -evecs[1];
+ if (!vectorEpsilonEqual(z, evecs[1], myEpsilon<double>()))
+ return failReport(__LINE__);
+
+ return 0;
+}
+#endif // GLM_HAS_CXX11_STL == 1
+
+int main()
+{
+ int error(0);
+
+ // A small smoke test to fail early with most problems
+ if(smokeTest())
+ return failReport(__LINE__);
+
+ // test sorting utility.
+ if(testEigenvalueSort<2, float, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if(testEigenvalueSort<2, double, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if(testEigenvalueSort<3, float, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if(testEigenvalueSort<3, double, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if(testEigenvalueSort<4, float, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if(testEigenvalueSort<4, double, glm::defaultp>() != 0)
+ error = failReport(__LINE__);
+ if (error != 0)
+ return error;
+
+ // Note: the random engine uses a fixed seed to create consistent and reproducible test data
+ // test covariance matrix computation from different data sources
+ if(testCovar<2, float, glm::defaultp>(100, 12345) != 0)
+ error = failReport(__LINE__);
+ if(testCovar<2, double, glm::defaultp>(100, 42) != 0)
+ error = failReport(__LINE__);
+ if(testCovar<3, float, glm::defaultp>(100, 2021) != 0)
+ error = failReport(__LINE__);
+ if(testCovar<3, double, glm::defaultp>(100, 815) != 0)
+ error = failReport(__LINE__);
+ if(testCovar<4, float, glm::defaultp>(100, 3141) != 0)
+ error = failReport(__LINE__);
+ if(testCovar<4, double, glm::defaultp>(100, 174) != 0)
+ error = failReport(__LINE__);
+ if (error != 0)
+ return error;
+
+ // test PCA eigen vector reconstruction
+ // Expected epsilon precision evaluated separately:
+ // https://github.com/sgrottel/exp-pca-precision
+ if(testEigenvectors<2, float, glm::defaultp>(0.002f) != 0)
+ error = failReport(__LINE__);
+ if(testEigenvectors<2, double, glm::defaultp>(0.00000000001) != 0)
+ error = failReport(__LINE__);
+ if(testEigenvectors<3, float, glm::defaultp>(0.00001f) != 0)
+ error = failReport(__LINE__);
+ if(testEigenvectors<3, double, glm::defaultp>(0.0000000001) != 0)
+ error = failReport(__LINE__);
+ if(testEigenvectors<4, float, glm::defaultp>(0.0001f) != 0)
+ error = failReport(__LINE__);
+ if(testEigenvectors<4, double, glm::defaultp>(0.0000001) != 0)
+ error = failReport(__LINE__);
+ if(error != 0)
+ return error;
+
+ // Final tests with randomized data
+#if GLM_HAS_CXX11_STL == 1
+ if(rndTest(12345) != 0)
+ error = failReport(__LINE__);
+ if(rndTest(42) != 0)
+ error = failReport(__LINE__);
+ if (error != 0)
+ return error;
+#endif // GLM_HAS_CXX11_STL == 1
+
+ return error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp b/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp
new file mode 100644
index 0000000..d14cfee
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/perpendicular.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp b/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp
new file mode 100644
index 0000000..da2fe53
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/polar_coordinates.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_projection.cpp b/3rdparty/glm/source/test/gtx/gtx_projection.cpp
new file mode 100644
index 0000000..8f9f772
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_projection.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/projection.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp b/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp
new file mode 100644
index 0000000..80cbbac
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp
@@ -0,0 +1,107 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/epsilon.hpp>
+#include <glm/gtc/type_ptr.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtx/transform.hpp>
+#include <glm/gtx/quaternion.hpp>
+#include <glm/gtx/compatibility.hpp>
+#include <glm/ext.hpp>
+
+int test_quat_fastMix()
+{
+ int Error = 0;
+
+ glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1));
+ glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::quat C = glm::fastMix(A, B, 0.5f);
+ glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+
+ Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_quat_shortMix()
+{
+ int Error(0);
+
+ glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1));
+ glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::quat C = glm::shortMix(A, B, 0.5f);
+ glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
+
+ Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1;
+ Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_orientation()
+{
+ int Error = 0;
+
+ {
+ glm::quat q(1.0f, 0.0f, 0.0f, 1.0f);
+ float p = glm::roll(q);
+ Error += glm::epsilonEqual(p, glm::pi<float>() * 0.5f, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::quat q(1.0f, 0.0f, 0.0f, 1.0f);
+ float p = glm::pitch(q);
+ Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1;
+ }
+
+ {
+ glm::quat q(1.0f, 0.0f, 0.0f, 1.0f);
+ float p = glm::yaw(q);
+ Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_rotation()
+{
+ int Error(0);
+
+ glm::vec3 v(1, 0, 0);
+ glm::vec3 u(0, 1, 0);
+
+ glm::quat Rotation = glm::rotation(v, u);
+
+ float Angle = glm::angle(Rotation);
+
+ Error += glm::abs(Angle - glm::pi<float>() * 0.5f) < glm::epsilon<float>() ? 0 : 1;
+
+ return Error;
+}
+
+int test_log()
+{
+ int Error(0);
+
+ glm::quat q;
+ glm::quat p = glm::log(q);
+ glm::quat r = glm::exp(p);
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_log();
+ Error += test_rotation();
+ Error += test_orientation();
+ Error += test_quat_fastMix();
+ Error += test_quat_shortMix();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_random.cpp b/3rdparty/glm/source/test/gtx/gtx_random.cpp
new file mode 100644
index 0000000..e562c31
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_random.cpp
@@ -0,0 +1,99 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2011-05-31
+// Updated : 2011-05-31
+// Licence : This source is under MIT licence
+// File : test/gtx/random.cpp
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/glm.hpp>
+#include <glm/gtx/random.hpp>
+#include <glm/gtx/epsilon.hpp>
+#include <iostream>
+
+int test_signedRand1()
+{
+ int Error = 0;
+
+ {
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0f;
+ for(std::size_t i = 0; i < 100000; ++i)
+ {
+ ResultFloat += glm::signedRand1<float>();
+ ResultDouble += glm::signedRand1<double>();
+ }
+
+ Error += glm::equalEpsilon(ResultFloat, 0.0f, 0.0001f);
+ Error += glm::equalEpsilon(ResultDouble, 0.0, 0.0001);
+ }
+
+ return Error;
+}
+
+int test_normalizedRand2()
+{
+ int Error = 0;
+
+ {
+ std::size_t Max = 100000;
+ float ResultFloat = 0.0f;
+ double ResultDouble = 0.0f;
+ for(std::size_t i = 0; i < Max; ++i)
+ {
+ ResultFloat += glm::length(glm::normalizedRand2<float>());
+ ResultDouble += glm::length(glm::normalizedRand2<double>());
+ }
+
+ Error += glm::equalEpsilon(ResultFloat, float(Max), 0.000001f) ? 0 : 1;
+ Error += glm::equalEpsilon(ResultDouble, double(Max), 0.000001) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int test_normalizedRand3()
+{
+ int Error = 0;
+
+ {
+ std::size_t Max = 100000;
+ float ResultFloatA = 0.0f;
+ float ResultFloatB = 0.0f;
+ float ResultFloatC = 0.0f;
+ double ResultDoubleA = 0.0f;
+ double ResultDoubleB = 0.0f;
+ double ResultDoubleC = 0.0f;
+ for(std::size_t i = 0; i < Max; ++i)
+ {
+ ResultFloatA += glm::length(glm::normalizedRand3<float>());
+ ResultDoubleA += glm::length(glm::normalizedRand3<double>());
+ ResultFloatB += glm::length(glm::normalizedRand3(2.0f, 2.0f));
+ ResultDoubleB += glm::length(glm::normalizedRand3(2.0, 2.0));
+ ResultFloatC += glm::length(glm::normalizedRand3(1.0f, 3.0f));
+ ResultDoubleC += glm::length(glm::normalizedRand3(1.0, 3.0));
+ }
+
+ Error += glm::equalEpsilon(ResultFloatA, float(Max), 0.0001f) ? 0 : 1;
+ Error += glm::equalEpsilon(ResultDoubleA, double(Max), 0.0001) ? 0 : 1;
+ Error += glm::equalEpsilon(ResultFloatB, float(Max * 2), 0.0001f) ? 0 : 1;
+ Error += glm::equalEpsilon(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1;
+ Error += (ResultFloatC >= float(Max) && ResultFloatC <= float(Max * 3)) ? 0 : 1;
+ Error += (ResultDoubleC >= double(Max) && ResultDoubleC <= double(Max * 3)) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_signedRand1();
+ Error += test_normalizedRand2();
+ Error += test_normalizedRand3();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_range.cpp b/3rdparty/glm/source/test/gtx/gtx_range.cpp
new file mode 100644
index 0000000..434731b
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_range.cpp
@@ -0,0 +1,83 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/glm.hpp>
+
+#if GLM_HAS_RANGE_FOR
+
+#include <glm/gtx/range.hpp>
+
+int test_vec()
+{
+ int Error = 0;
+
+ {
+ glm::ivec3 const v(1, 2, 3);
+
+ int count = 0;
+ glm::ivec3 Result(0);
+ for(int x : v)
+ {
+ Result[count] = x;
+ count++;
+ }
+ Error += count == 3 ? 0 : 1;
+ Error += v == Result ? 0 : 1;
+ }
+
+ {
+ glm::ivec3 v(1, 2, 3);
+ for(int& x : v)
+ x = 0;
+ Error += glm::all(glm::equal(v, glm::ivec3(0))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_mat()
+{
+ int Error = 0;
+
+ {
+ glm::mat4x3 m(1.0f);
+
+ int count = 0;
+ float Sum = 0.0f;
+ for(float x : m)
+ {
+ count++;
+ Sum += x;
+ }
+ Error += count == 12 ? 0 : 1;
+ Error += glm::equal(Sum, 3.0f, 0.001f) ? 0 : 1;
+ }
+
+ {
+ glm::mat4x3 m(1.0f);
+
+ for (float& x : m) { x = 0; }
+ glm::vec4 v(1, 1, 1, 1);
+ Error += glm::all(glm::equal(m*v, glm::vec3(0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+ Error += test_vec();
+ Error += test_mat();
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif//GLM_HAS_RANGE_FOR
diff --git a/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp b/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp
new file mode 100644
index 0000000..d4eecdf
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp
@@ -0,0 +1,9 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/rotate_normalized_axis.hpp>
+
+int main()
+{
+ int Error(0);
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp b/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp
new file mode 100644
index 0000000..becd63f
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp
@@ -0,0 +1,77 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/rotate_vector.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+
+int test_rotate()
+{
+ int Error = 0;
+
+ glm::vec2 A = glm::rotate(glm::vec2(1, 0), glm::pi<float>() * 0.5f);
+ glm::vec3 B = glm::rotate(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::vec4 C = glm::rotate(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
+ glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
+ glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
+ glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi<float>() * 0.5f);
+ glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1));
+
+ return Error;
+}
+
+int test_rotateX()
+{
+ int Error = 0;
+
+ glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
+
+ return Error;
+}
+
+int test_rotateY()
+{
+ int Error = 0;
+
+ glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
+
+ return Error;
+}
+
+
+int test_rotateZ()
+{
+ int Error = 0;
+
+ glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
+ glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi<float>() * 0.5f);
+
+ return Error;
+}
+
+int test_orientation()
+{
+ int Error = 0;
+
+ glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1));
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_rotate();
+ Error += test_rotateX();
+ Error += test_rotateY();
+ Error += test_rotateZ();
+ Error += test_orientation();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp b/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp
new file mode 100644
index 0000000..4aa96d6
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp
@@ -0,0 +1,37 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/glm.hpp>
+
+#if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC)
+#include <glm/gtx/scalar_multiplication.hpp>
+
+int main()
+{
+ int Error(0);
+ glm::vec3 v(0.5, 3.1, -9.1);
+
+ Error += glm::all(glm::equal(v, 1.0 * v, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v, 1 * v, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(v, 1u * v, glm::epsilon<float>())) ? 0 : 1;
+
+ glm::mat3 m(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ glm::vec3 w = 0.5f * m * v;
+
+ Error += glm::all(glm::equal((m*v)/2, w, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(m*(v/2), w, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal((m/2)*v, w, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal((0.5*m)*v, w, glm::epsilon<float>())) ? 0 : 1;
+ Error += glm::all(glm::equal(0.5*(m*v), w, glm::epsilon<float>())) ? 0 : 1;
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp b/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp
new file mode 100644
index 0000000..fc6a09a
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp
@@ -0,0 +1,174 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/scalar_relational.hpp>
+#include <glm/gtc/constants.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/glm.hpp>
+
+static int test_lessThan()
+{
+ int Error = 0;
+
+ Error += glm::lessThan(0, 1) ? 0 : 1;
+ Error += glm::lessThan(1, 0) ? 1 : 0;
+ Error += glm::lessThan(0, 0) ? 1 : 0;
+ Error += glm::lessThan(1, 1) ? 1 : 0;
+ Error += glm::lessThan(0.0f, 1.0f) ? 0 : 1;
+ Error += glm::lessThan(1.0f, 0.0f) ? 1 : 0;
+ Error += glm::lessThan(0.0f, 0.0f) ? 1 : 0;
+ Error += glm::lessThan(1.0f, 1.0f) ? 1 : 0;
+ Error += glm::lessThan(0.0, 1.0) ? 0 : 1;
+ Error += glm::lessThan(1.0, 0.0) ? 1 : 0;
+ Error += glm::lessThan(0.0, 0.0) ? 1 : 0;
+ Error += glm::lessThan(1.0, 1.0) ? 1 : 0;
+
+ return Error;
+}
+
+static int test_lessThanEqual()
+{
+ int Error = 0;
+
+ Error += glm::lessThanEqual(0, 1) ? 0 : 1;
+ Error += glm::lessThanEqual(1, 0) ? 1 : 0;
+ Error += glm::lessThanEqual(0, 0) ? 0 : 1;
+ Error += glm::lessThanEqual(1, 1) ? 0 : 1;
+ Error += glm::lessThanEqual(0.0f, 1.0f) ? 0 : 1;
+ Error += glm::lessThanEqual(1.0f, 0.0f) ? 1 : 0;
+ Error += glm::lessThanEqual(0.0f, 0.0f) ? 0 : 1;
+ Error += glm::lessThanEqual(1.0f, 1.0f) ? 0 : 1;
+ Error += glm::lessThanEqual(0.0, 1.0) ? 0 : 1;
+ Error += glm::lessThanEqual(1.0, 0.0) ? 1 : 0;
+ Error += glm::lessThanEqual(0.0, 0.0) ? 0 : 1;
+ Error += glm::lessThanEqual(1.0, 1.0) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_greaterThan()
+{
+ int Error = 0;
+
+ Error += glm::greaterThan(0, 1) ? 1 : 0;
+ Error += glm::greaterThan(1, 0) ? 0 : 1;
+ Error += glm::greaterThan(0, 0) ? 1 : 0;
+ Error += glm::greaterThan(1, 1) ? 1 : 0;
+ Error += glm::greaterThan(0.0f, 1.0f) ? 1 : 0;
+ Error += glm::greaterThan(1.0f, 0.0f) ? 0 : 1;
+ Error += glm::greaterThan(0.0f, 0.0f) ? 1 : 0;
+ Error += glm::greaterThan(1.0f, 1.0f) ? 1 : 0;
+ Error += glm::greaterThan(0.0, 1.0) ? 1 : 0;
+ Error += glm::greaterThan(1.0, 0.0) ? 0 : 1;
+ Error += glm::greaterThan(0.0, 0.0) ? 1 : 0;
+ Error += glm::greaterThan(1.0, 1.0) ? 1 : 0;
+
+ return Error;
+}
+
+static int test_greaterThanEqual()
+{
+ int Error = 0;
+
+ Error += glm::greaterThanEqual(0, 1) ? 1 : 0;
+ Error += glm::greaterThanEqual(1, 0) ? 0 : 1;
+ Error += glm::greaterThanEqual(0, 0) ? 0 : 1;
+ Error += glm::greaterThanEqual(1, 1) ? 0 : 1;
+ Error += glm::greaterThanEqual(0.0f, 1.0f) ? 1 : 0;
+ Error += glm::greaterThanEqual(1.0f, 0.0f) ? 0 : 1;
+ Error += glm::greaterThanEqual(0.0f, 0.0f) ? 0 : 1;
+ Error += glm::greaterThanEqual(1.0f, 1.0f) ? 0 : 1;
+ Error += glm::greaterThanEqual(0.0, 1.0) ? 1 : 0;
+ Error += glm::greaterThanEqual(1.0, 0.0) ? 0 : 1;
+ Error += glm::greaterThanEqual(0.0, 0.0) ? 0 : 1;
+ Error += glm::greaterThanEqual(1.0, 1.0) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_equal()
+{
+ int Error = 0;
+
+ Error += glm::equal(0, 1) ? 1 : 0;
+ Error += glm::equal(1, 0) ? 1 : 0;
+ Error += glm::equal(0, 0) ? 0 : 1;
+ Error += glm::equal(1, 1) ? 0 : 1;
+ Error += glm::equal(0.0f, 1.0f, glm::epsilon<float>()) ? 1 : 0;
+ Error += glm::equal(1.0f, 0.0f, glm::epsilon<float>()) ? 1 : 0;
+ Error += glm::equal(0.0f, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(1.0f, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::equal(0.0, 1.0, glm::epsilon<double>()) ? 1 : 0;
+ Error += glm::equal(1.0, 0.0, glm::epsilon<double>()) ? 1 : 0;
+ Error += glm::equal(0.0, 0.0, glm::epsilon<double>()) ? 0 : 1;
+ Error += glm::equal(1.0, 1.0, glm::epsilon<double>()) ? 0 : 1;
+
+ return Error;
+}
+
+static int test_notEqual()
+{
+ int Error = 0;
+
+ Error += glm::notEqual(0, 1) ? 0 : 1;
+ Error += glm::notEqual(1, 0) ? 0 : 1;
+ Error += glm::notEqual(0, 0) ? 1 : 0;
+ Error += glm::notEqual(1, 1) ? 1 : 0;
+ Error += glm::notEqual(0.0f, 1.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::notEqual(1.0f, 0.0f, glm::epsilon<float>()) ? 0 : 1;
+ Error += glm::notEqual(0.0f, 0.0f, glm::epsilon<float>()) ? 1 : 0;
+ Error += glm::notEqual(1.0f, 1.0f, glm::epsilon<float>()) ? 1 : 0;
+ Error += glm::notEqual(0.0, 1.0, glm::epsilon<double>()) ? 0 : 1;
+ Error += glm::notEqual(1.0, 0.0, glm::epsilon<double>()) ? 0 : 1;
+ Error += glm::notEqual(0.0, 0.0, glm::epsilon<double>()) ? 1 : 0;
+ Error += glm::notEqual(1.0, 1.0, glm::epsilon<double>()) ? 1 : 0;
+
+ return Error;
+}
+
+static int test_any()
+{
+ int Error = 0;
+
+ Error += glm::any(true) ? 0 : 1;
+ Error += glm::any(false) ? 1 : 0;
+
+ return Error;
+}
+
+static int test_all()
+{
+ int Error = 0;
+
+ Error += glm::all(true) ? 0 : 1;
+ Error += glm::all(false) ? 1 : 0;
+
+ return Error;
+}
+
+static int test_not()
+{
+ int Error = 0;
+
+ Error += glm::not_(true) ? 1 : 0;
+ Error += glm::not_(false) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_lessThan();
+ Error += test_lessThanEqual();
+ Error += test_greaterThan();
+ Error += test_greaterThanEqual();
+ Error += test_equal();
+ Error += test_notEqual();
+ Error += test_any();
+ Error += test_all();
+ Error += test_not();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp b/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp
new file mode 100644
index 0000000..28d7ec5
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp
@@ -0,0 +1,324 @@
+///////////////////////////////////////////////////////////////////////////////////
+/// OpenGL Mathematics (glm.g-truc.net)
+///
+/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
+/// Permission is hereby granted, free of charge, to any person obtaining a copy
+/// of this software and associated documentation files (the "Software"), to deal
+/// in the Software without restriction, including without limitation the rights
+/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+/// copies of the Software, and to permit persons to whom the Software is
+/// furnished to do so, subject to the following conditions:
+///
+/// The above copyright notice and this permission notice shall be included in
+/// all copies or substantial portions of the Software.
+///
+/// Restrictions:
+/// By making use of the Software for military purposes, you choose to make
+/// a Bunny unhappy.
+///
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+/// THE SOFTWARE.
+///
+/// @file test/gtx/gtx_simd_mat4.cpp
+/// @date 2010-09-16 / 2014-11-25
+/// @author Christophe Riccio
+///////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/glm.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtc/quaternion.hpp>
+#include <glm/gtc/random.hpp>
+#include <glm/gtx/simd_vec4.hpp>
+#include <glm/gtx/simd_mat4.hpp>
+#include <cstdio>
+#include <ctime>
+#include <vector>
+
+#if(GLM_ARCH != GLM_ARCH_PURE)
+
+std::vector<float> test_detA(std::vector<glm::mat4> const & Data)
+{
+ std::vector<float> Test(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Test.size() - 1; ++i)
+ Test[i] = glm::determinant(Data[i]);
+
+ std::clock_t TimeEnd = clock();
+ printf("Det A: %ld\n", TimeEnd - TimeStart);
+
+ return Test;
+}
+
+std::vector<float> test_detB(std::vector<glm::mat4> const & Data)
+{
+ std::vector<float> Test(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Test.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdVec4 d(glm::detail::sse_slow_det_ps((__m128 const * const)&m));
+ glm::vec4 v;//(d);
+ Test[i] = v.x;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Det B: %ld\n", TimeEnd - TimeStart);
+
+ return Test;
+}
+
+std::vector<float> test_detC(std::vector<glm::mat4> const & Data)
+{
+ std::vector<float> Test(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Test.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdVec4 d(glm::detail::sse_det_ps((__m128 const * const)&m));
+ glm::vec4 v;//(d);
+ Test[i] = v.x;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Det C: %ld\n", TimeEnd - TimeStart);
+
+ return Test;
+}
+
+std::vector<float> test_detD(std::vector<glm::mat4> const & Data)
+{
+ std::vector<float> Test(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Test.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdVec4 d(glm::detail::sse_detd_ps((__m128 const * const)&m));
+ glm::vec4 v;//(d);
+ Test[i] = v.x;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Det D: %ld\n", TimeEnd - TimeStart);
+
+ return Test;
+}
+
+void test_invA(std::vector<glm::mat4> const & Data, std::vector<glm::mat4> & Out)
+{
+ //std::vector<float> Test(Data.size());
+ Out.resize(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Out.size() - 1; ++i)
+ {
+ Out[i] = glm::inverse(Data[i]);
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Inv A: %ld\n", TimeEnd - TimeStart);
+}
+
+void test_invC(std::vector<glm::mat4> const & Data, std::vector<glm::mat4> & Out)
+{
+ //std::vector<float> Test(Data.size());
+ Out.resize(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Out.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdMat4 o;
+ glm::detail::sse_inverse_fast_ps((__m128 const * const)&m, (__m128 *)&o);
+ Out[i] = *(glm::mat4*)&o;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Inv C: %ld\n", TimeEnd - TimeStart);
+}
+
+void test_invD(std::vector<glm::mat4> const & Data, std::vector<glm::mat4> & Out)
+{
+ //std::vector<float> Test(Data.size());
+ Out.resize(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Out.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdMat4 o;
+ glm::detail::sse_inverse_ps((__m128 const * const)&m, (__m128 *)&o);
+ Out[i] = *(glm::mat4*)&o;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Inv D: %ld\n", TimeEnd - TimeStart);
+}
+
+void test_mulA(std::vector<glm::mat4> const & Data, std::vector<glm::mat4> & Out)
+{
+ //std::vector<float> Test(Data.size());
+ Out.resize(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Out.size() - 1; ++i)
+ {
+ Out[i] = Data[i] * Data[i];
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Mul A: %ld\n", TimeEnd - TimeStart);
+}
+
+void test_mulD(std::vector<glm::mat4> const & Data, std::vector<glm::mat4> & Out)
+{
+ //std::vector<float> Test(Data.size());
+ Out.resize(Data.size());
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t i = 0; i < Out.size() - 1; ++i)
+ {
+ _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0);
+ glm::simdMat4 m(Data[i]);
+ glm::simdMat4 o;
+ glm::detail::sse_mul_ps((__m128 const * const)&m, (__m128 const * const)&m, (__m128*)&o);
+ Out[i] = *(glm::mat4*)&o;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("Mul D: %ld\n", TimeEnd - TimeStart);
+}
+
+int test_compute_glm()
+{
+ return 0;
+}
+
+int test_compute_gtx()
+{
+ std::vector<glm::vec4> Output(1000000);
+
+ std::clock_t TimeStart = clock();
+
+ for(std::size_t k = 0; k < Output.size(); ++k)
+ {
+ float i = float(k) / 1000.f + 0.001f;
+ glm::vec3 A = glm::normalize(glm::vec3(i));
+ glm::vec3 B = glm::cross(A, glm::normalize(glm::vec3(1, 1, 2)));
+ glm::mat4 C = glm::rotate(glm::mat4(1.0f), i, B);
+ glm::mat4 D = glm::scale(C, glm::vec3(0.8f, 1.0f, 1.2f));
+ glm::mat4 E = glm::translate(D, glm::vec3(1.4f, 1.2f, 1.1f));
+ glm::mat4 F = glm::perspective(i, 1.5f, 0.1f, 1000.f);
+ glm::mat4 G = glm::inverse(F * E);
+ glm::vec3 H = glm::unProject(glm::vec3(i), G, F, E[3]);
+ glm::vec3 I = glm::any(glm::isnan(glm::project(H, G, F, E[3]))) ? glm::vec3(2) : glm::vec3(1);
+ glm::mat4 J = glm::lookAt(glm::normalize(glm::max(B, glm::vec3(0.001f))), H, I);
+ glm::mat4 K = glm::transpose(J);
+ glm::quat L = glm::normalize(glm::quat_cast(K));
+ glm::vec4 M = L * glm::smoothstep(K[3], J[3], glm::vec4(i));
+ glm::mat4 N = glm::mat4(glm::normalize(glm::max(M, glm::vec4(0.001f))), K[3], J[3], glm::vec4(i));
+ glm::mat4 O = N * glm::inverse(N);
+ glm::vec4 P = O * glm::reflect(N[3], glm::vec4(A, 1.0f));
+ glm::vec4 Q = glm::vec4(glm::dot(M, P));
+ glm::vec4 R = glm::quat(Q.w, glm::vec3(Q)) * P;
+ Output[k] = R;
+ }
+
+ std::clock_t TimeEnd = clock();
+ printf("test_compute_gtx: %ld\n", TimeEnd - TimeStart);
+
+ return 0;
+}
+
+int main()
+{
+ int Error = 0;
+
+ std::vector<glm::mat4> Data(64 * 64 * 1);
+ for(std::size_t i = 0; i < Data.size(); ++i)
+ Data[i] = glm::mat4(
+ glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))),
+ glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))),
+ glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))),
+ glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))));
+
+ {
+ std::vector<glm::mat4> TestInvA;
+ test_invA(Data, TestInvA);
+ }
+ {
+ std::vector<glm::mat4> TestInvC;
+ test_invC(Data, TestInvC);
+ }
+ {
+ std::vector<glm::mat4> TestInvD;
+ test_invD(Data, TestInvD);
+ }
+
+ {
+ std::vector<glm::mat4> TestA;
+ test_mulA(Data, TestA);
+ }
+ {
+ std::vector<glm::mat4> TestD;
+ test_mulD(Data, TestD);
+ }
+
+ {
+ std::vector<float> TestDetA = test_detA(Data);
+ std::vector<float> TestDetB = test_detB(Data);
+ std::vector<float> TestDetD = test_detD(Data);
+ std::vector<float> TestDetC = test_detC(Data);
+
+ for(std::size_t i = 0; i < TestDetA.size(); ++i)
+ if(TestDetA[i] != TestDetB[i] && TestDetC[i] != TestDetB[i] && TestDetC[i] != TestDetD[i])
+ return 1;
+ }
+
+ // shuffle test
+ glm::simdVec4 A(1.0f, 2.0f, 3.0f, 4.0f);
+ glm::simdVec4 B(5.0f, 6.0f, 7.0f, 8.0f);
+ //__m128 C = _mm_shuffle_ps(A.Data, B.Data, _MM_SHUFFLE(1, 0, 1, 0));
+
+ Error += test_compute_glm();
+ Error += test_compute_gtx();
+ float Det = glm::determinant(glm::simdMat4(1.0));
+ Error += Det == 1.0f ? 0 : 1;
+
+ glm::simdMat4 D = glm::matrixCompMult(glm::simdMat4(1.0), glm::simdMat4(1.0));
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
+#endif//(GLM_ARCH != GLM_ARCH_PURE)
diff --git a/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp b/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp
new file mode 100644
index 0000000..e71a60b
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////////////
+/// OpenGL Mathematics (glm.g-truc.net)
+///
+/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
+/// Permission is hereby granted, free of charge, to any person obtaining a copy
+/// of this software and associated documentation files (the "Software"), to deal
+/// in the Software without restriction, including without limitation the rights
+/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+/// copies of the Software, and to permit persons to whom the Software is
+/// furnished to do so, subject to the following conditions:
+///
+/// The above copyright notice and this permission notice shall be included in
+/// all copies or substantial portions of the Software.
+///
+/// Restrictions:
+/// By making use of the Software for military purposes, you choose to make
+/// a Bunny unhappy.
+///
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+/// THE SOFTWARE.
+///
+/// @file test/gtx/gtx_simd_vec4.cpp
+/// @date 2010-09-16 / 2014-11-25
+/// @author Christophe Riccio
+///////////////////////////////////////////////////////////////////////////////////
+
+#include <glm/glm.hpp>
+#include <glm/gtx/simd_vec4.hpp>
+#include <cstdio>
+
+#if(GLM_ARCH != GLM_ARCH_PURE)
+
+int main()
+{
+ glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
+ glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
+ glm::simdVec4 C1 = A1 + B1;
+ glm::simdVec4 D1 = A1.swizzle<glm::X, glm::Z, glm::Y, glm::W>();
+ glm::simdVec4 E1(glm::vec4(1.0f));
+ glm::vec4 F1 = glm::vec4_cast(E1);
+ //glm::vec4 G1(E1);
+
+ //printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w);
+ //printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w);
+ //printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w);
+ //printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w);
+
+ __m128 value = _mm_set1_ps(0.0f);
+ __m128 data = _mm_cmpeq_ps(value, value);
+ __m128 add0 = _mm_add_ps(data, data);
+
+ glm::simdVec4 GNI(add0);
+
+ return 0;
+}
+
+#else
+
+int main()
+{
+ int Error = 0;
+
+ return Error;
+}
+
+#endif//(GLM_ARCH != GLM_ARCH_PURE)
diff --git a/3rdparty/glm/source/test/gtx/gtx_spline.cpp b/3rdparty/glm/source/test/gtx/gtx_spline.cpp
new file mode 100644
index 0000000..c93ee17
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_spline.cpp
@@ -0,0 +1,100 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <glm/gtx/spline.hpp>
+
+namespace catmullRom
+{
+ int test()
+ {
+ int Error(0);
+
+ glm::vec2 Result2 = glm::catmullRom(
+ glm::vec2(0.0f, 0.0f),
+ glm::vec2(1.0f, 0.0f),
+ glm::vec2(1.0f, 1.0f),
+ glm::vec2(0.0f, 1.0f), 0.5f);
+
+ glm::vec3 Result3 = glm::catmullRom(
+ glm::vec3(0.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 1.0f, 0.0f),
+ glm::vec3(0.0f, 1.0f, 0.0f), 0.5f);
+
+ glm::vec4 Result4 = glm::catmullRom(
+ glm::vec4(0.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 1.0f, 0.0f, 1.0f),
+ glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f);
+
+ return Error;
+ }
+}//catmullRom
+
+namespace hermite
+{
+ int test()
+ {
+ int Error(0);
+
+ glm::vec2 Result2 = glm::hermite(
+ glm::vec2(0.0f, 0.0f),
+ glm::vec2(1.0f, 0.0f),
+ glm::vec2(1.0f, 1.0f),
+ glm::vec2(0.0f, 1.0f), 0.5f);
+
+ glm::vec3 Result3 = glm::hermite(
+ glm::vec3(0.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 1.0f, 0.0f),
+ glm::vec3(0.0f, 1.0f, 0.0f), 0.5f);
+
+ glm::vec4 Result4 = glm::hermite(
+ glm::vec4(0.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 1.0f, 0.0f, 1.0f),
+ glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f);
+
+ return Error;
+ }
+}//catmullRom
+
+namespace cubic
+{
+ int test()
+ {
+ int Error(0);
+
+ glm::vec2 Result2 = glm::cubic(
+ glm::vec2(0.0f, 0.0f),
+ glm::vec2(1.0f, 0.0f),
+ glm::vec2(1.0f, 1.0f),
+ glm::vec2(0.0f, 1.0f), 0.5f);
+
+ glm::vec3 Result3 = glm::cubic(
+ glm::vec3(0.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 0.0f, 0.0f),
+ glm::vec3(1.0f, 1.0f, 0.0f),
+ glm::vec3(0.0f, 1.0f, 0.0f), 0.5f);
+
+ glm::vec4 Result = glm::cubic(
+ glm::vec4(0.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 0.0f, 0.0f, 1.0f),
+ glm::vec4(1.0f, 1.0f, 0.0f, 1.0f),
+ glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f);
+
+ return Error;
+ }
+}//catmullRom
+
+int main()
+{
+ int Error(0);
+
+ Error += catmullRom::test();
+ Error += hermite::test();
+ Error += cubic::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp b/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp
new file mode 100644
index 0000000..b04c870
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp
@@ -0,0 +1,155 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/glm.hpp>
+#include <glm/gtx/string_cast.hpp>
+#include <limits>
+
+int test_string_cast_vector()
+{
+ int Error = 0;
+
+ {
+ glm::vec2 A1(1, 2);
+ std::string A2 = glm::to_string(A1);
+ Error += A2 != std::string("vec2(1.000000, 2.000000)") ? 1 : 0;
+
+ glm::vec3 B1(1, 2, 3);
+ std::string B2 = glm::to_string(B1);
+ Error += B2 != std::string("vec3(1.000000, 2.000000, 3.000000)") ? 1 : 0;
+
+ glm::vec4 C1(1, 2, 3, 4);
+ std::string C2 = glm::to_string(C1);
+ Error += C2 != std::string("vec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0;
+
+ glm::dvec2 J1(1, 2);
+ std::string J2 = glm::to_string(J1);
+ Error += J2 != std::string("dvec2(1.000000, 2.000000)") ? 1 : 0;
+
+ glm::dvec3 K1(1, 2, 3);
+ std::string K2 = glm::to_string(K1);
+ Error += K2 != std::string("dvec3(1.000000, 2.000000, 3.000000)") ? 1 : 0;
+
+ glm::dvec4 L1(1, 2, 3, 4);
+ std::string L2 = glm::to_string(L1);
+ Error += L2 != std::string("dvec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0;
+ }
+
+ {
+ glm::bvec2 M1(false, true);
+ std::string M2 = glm::to_string(M1);
+ Error += M2 != std::string("bvec2(false, true)") ? 1 : 0;
+
+ glm::bvec3 O1(false, true, false);
+ std::string O2 = glm::to_string(O1);
+ Error += O2 != std::string("bvec3(false, true, false)") ? 1 : 0;
+
+ glm::bvec4 P1(false, true, false, true);
+ std::string P2 = glm::to_string(P1);
+ Error += P2 != std::string("bvec4(false, true, false, true)") ? 1 : 0;
+ }
+
+ {
+ glm::ivec2 D1(1, 2);
+ std::string D2 = glm::to_string(D1);
+ Error += D2 != std::string("ivec2(1, 2)") ? 1 : 0;
+
+ glm::ivec3 E1(1, 2, 3);
+ std::string E2 = glm::to_string(E1);
+ Error += E2 != std::string("ivec3(1, 2, 3)") ? 1 : 0;
+
+ glm::ivec4 F1(1, 2, 3, 4);
+ std::string F2 = glm::to_string(F1);
+ Error += F2 != std::string("ivec4(1, 2, 3, 4)") ? 1 : 0;
+ }
+
+ {
+ glm::i8vec2 D1(1, 2);
+ std::string D2 = glm::to_string(D1);
+ Error += D2 != std::string("i8vec2(1, 2)") ? 1 : 0;
+
+ glm::i8vec3 E1(1, 2, 3);
+ std::string E2 = glm::to_string(E1);
+ Error += E2 != std::string("i8vec3(1, 2, 3)") ? 1 : 0;
+
+ glm::i8vec4 F1(1, 2, 3, 4);
+ std::string F2 = glm::to_string(F1);
+ Error += F2 != std::string("i8vec4(1, 2, 3, 4)") ? 1 : 0;
+ }
+
+ {
+ glm::i16vec2 D1(1, 2);
+ std::string D2 = glm::to_string(D1);
+ Error += D2 != std::string("i16vec2(1, 2)") ? 1 : 0;
+
+ glm::i16vec3 E1(1, 2, 3);
+ std::string E2 = glm::to_string(E1);
+ Error += E2 != std::string("i16vec3(1, 2, 3)") ? 1 : 0;
+
+ glm::i16vec4 F1(1, 2, 3, 4);
+ std::string F2 = glm::to_string(F1);
+ Error += F2 != std::string("i16vec4(1, 2, 3, 4)") ? 1 : 0;
+ }
+
+ {
+ glm::i64vec2 D1(1, 2);
+ std::string D2 = glm::to_string(D1);
+ Error += D2 != std::string("i64vec2(1, 2)") ? 1 : 0;
+
+ glm::i64vec3 E1(1, 2, 3);
+ std::string E2 = glm::to_string(E1);
+ Error += E2 != std::string("i64vec3(1, 2, 3)") ? 1 : 0;
+
+ glm::i64vec4 F1(1, 2, 3, 4);
+ std::string F2 = glm::to_string(F1);
+ Error += F2 != std::string("i64vec4(1, 2, 3, 4)") ? 1 : 0;
+ }
+
+ return Error;
+}
+
+int test_string_cast_matrix()
+{
+ int Error = 0;
+
+ glm::mat2x2 A1(1.000000, 2.000000, 3.000000, 4.000000);
+ std::string A2 = glm::to_string(A1);
+ Error += A2 != std::string("mat2x2((1.000000, 2.000000), (3.000000, 4.000000))") ? 1 : 0;
+
+ return Error;
+}
+
+int test_string_cast_quaternion()
+{
+ int Error = 0;
+
+ glm::quat Q0 = glm::quat(1.0f, 2.0f, 3.0f, 4.0f);
+ std::string S0 = glm::to_string(Q0);
+ Error += S0 != std::string("quat(1.000000, {2.000000, 3.000000, 4.000000})") ? 1 : 0;
+
+ return Error;
+
+}
+
+int test_string_cast_dual_quaternion()
+{
+ int Error = 0;
+
+ glm::dualquat Q0 = glm::dualquat(glm::quat(1.0f, 2.0f, 3.0f, 4.0f), glm::quat(5.0f, 6.0f, 7.0f, 8.0f));
+ std::string S0 = glm::to_string(Q0);
+ Error += S0 != std::string("dualquat((1.000000, {2.000000, 3.000000, 4.000000}), (5.000000, {6.000000, 7.000000, 8.000000}))") ? 1 : 0;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_string_cast_vector();
+ Error += test_string_cast_matrix();
+ Error += test_string_cast_quaternion();
+ Error += test_string_cast_dual_quaternion();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_texture.cpp b/3rdparty/glm/source/test/gtx/gtx_texture.cpp
new file mode 100644
index 0000000..0b98ed7
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_texture.cpp
@@ -0,0 +1,22 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/vec2.hpp>
+#include <glm/gtx/texture.hpp>
+
+int test_levels()
+{
+ int Error = 0;
+
+ int const Levels = glm::levels(glm::ivec2(3, 2));
+ Error += Levels == 2 ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error = 0;
+
+ Error += test_levels();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp b/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp
new file mode 100644
index 0000000..8d045c0
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp
@@ -0,0 +1,114 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/type_aligned.hpp>
+#include <cstdio>
+
+int test_decl()
+{
+ int Error(0);
+
+ {
+ struct S1
+ {
+ glm::aligned_vec4 B;
+ };
+
+ struct S2
+ {
+ glm::vec4 B;
+ };
+
+ std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast<int>(sizeof(S1)), static_cast<int>(sizeof(S2)));
+
+ Error += sizeof(S1) >= sizeof(S2) ? 0 : 1;
+ }
+
+ {
+ struct S1
+ {
+ bool A;
+ glm::vec3 B;
+ };
+
+ struct S2
+ {
+ bool A;
+ glm::aligned_vec3 B;
+ };
+
+ std::printf("vec3 - Aligned: %d, unaligned: %d\n", static_cast<int>(sizeof(S1)), static_cast<int>(sizeof(S2)));
+
+ Error += sizeof(S1) <= sizeof(S2) ? 0 : 1;
+ }
+
+ {
+ struct S1
+ {
+ bool A;
+ glm::aligned_vec4 B;
+ };
+
+ struct S2
+ {
+ bool A;
+ glm::vec4 B;
+ };
+
+ std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast<int>(sizeof(S1)), static_cast<int>(sizeof(S2)));
+
+ Error += sizeof(S1) >= sizeof(S2) ? 0 : 1;
+ }
+
+ {
+ struct S1
+ {
+ bool A;
+ glm::aligned_dvec4 B;
+ };
+
+ struct S2
+ {
+ bool A;
+ glm::dvec4 B;
+ };
+
+ std::printf("dvec4 - Aligned: %d, unaligned: %d\n", static_cast<int>(sizeof(S1)), static_cast<int>(sizeof(S2)));
+
+ Error += sizeof(S1) >= sizeof(S2) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template<typename genType>
+void print(genType const& Mat0)
+{
+ std::printf("mat4(\n");
+ std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast<double>(Mat0[0][0]), static_cast<double>(Mat0[0][1]), static_cast<double>(Mat0[0][2]), static_cast<double>(Mat0[0][3]));
+ std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast<double>(Mat0[1][0]), static_cast<double>(Mat0[1][1]), static_cast<double>(Mat0[1][2]), static_cast<double>(Mat0[1][3]));
+ std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast<double>(Mat0[2][0]), static_cast<double>(Mat0[2][1]), static_cast<double>(Mat0[2][2]), static_cast<double>(Mat0[2][3]));
+ std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f))\n\n", static_cast<double>(Mat0[3][0]), static_cast<double>(Mat0[3][1]), static_cast<double>(Mat0[3][2]), static_cast<double>(Mat0[3][3]));
+}
+
+int perf_mul()
+{
+ int Error = 0;
+
+ glm::mat4 A(1.0f);
+ glm::mat4 B(1.0f);
+
+ glm::mat4 C = A * B;
+
+ print(C);
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_decl();
+ Error += perf_mul();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp b/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp
new file mode 100644
index 0000000..9b96a36
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp
@@ -0,0 +1,13 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/vec4.hpp>
+#include <glm/gtx/type_trait.hpp>
+
+int main()
+{
+ int Error = 0;
+
+
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp b/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp
new file mode 100644
index 0000000..0b0c8b8
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp
@@ -0,0 +1,11 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/vec_swizzle.hpp>
+
+int main()
+{
+ int Error = 0;
+
+
+ return Error;
+}
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp b/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp
new file mode 100644
index 0000000..4e8172b
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp
@@ -0,0 +1,59 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtc/constants.hpp>
+#include <glm/gtx/vector_angle.hpp>
+#include <limits>
+
+int test_angle()
+{
+ int Error = 0;
+
+ float AngleA = glm::angle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1)));
+ Error += glm::epsilonEqual(AngleA, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleB = glm::angle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)));
+ Error += glm::epsilonEqual(AngleB, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleC = glm::angle(glm::vec4(1, 0, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0)));
+ Error += glm::epsilonEqual(AngleC, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_orientedAngle_vec2()
+{
+ int Error = 0;
+
+ float AngleA = glm::orientedAngle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1)));
+ Error += glm::epsilonEqual(AngleA, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleB = glm::orientedAngle(glm::vec2(0, 1), glm::normalize(glm::vec2(1, 1)));
+ Error += glm::epsilonEqual(AngleB, -glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleC = glm::orientedAngle(glm::normalize(glm::vec2(1, 1)), glm::vec2(0, 1));
+ Error += glm::epsilonEqual(AngleC, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int test_orientedAngle_vec3()
+{
+ int Error = 0;
+
+ float AngleA = glm::orientedAngle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1));
+ Error += glm::epsilonEqual(AngleA, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleB = glm::orientedAngle(glm::vec3(0, 1, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1));
+ Error += glm::epsilonEqual(AngleB, -glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+ float AngleC = glm::orientedAngle(glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 1, 0), glm::vec3(0, 0, 1));
+ Error += glm::epsilonEqual(AngleC, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_angle();
+ Error += test_orientedAngle_vec2();
+ Error += test_orientedAngle_vec3();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp b/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp
new file mode 100644
index 0000000..729f9e1
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp
@@ -0,0 +1,82 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/vec2.hpp>
+#include <glm/vec3.hpp>
+#include <glm/vec4.hpp>
+#include <glm/gtx/vector_query.hpp>
+
+int test_areCollinear()
+{
+ int Error(0);
+
+ {
+ bool TestA = glm::areCollinear(glm::vec2(-1), glm::vec2(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+
+ {
+ bool TestA = glm::areCollinear(glm::vec3(-1), glm::vec3(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+
+ {
+ bool TestA = glm::areCollinear(glm::vec4(-1), glm::vec4(1), 0.00001f);
+ Error += TestA ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int test_areOrthogonal()
+{
+ int Error(0);
+
+ bool TestA = glm::areOrthogonal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int test_isNormalized()
+{
+ int Error(0);
+
+ bool TestA = glm::isNormalized(glm::vec4(1, 0, 0, 0), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int test_isNull()
+{
+ int Error(0);
+
+ bool TestA = glm::isNull(glm::vec4(0), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int test_areOrthonormal()
+{
+ int Error(0);
+
+ bool TestA = glm::areOrthonormal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f);
+ Error += TestA ? 0 : 1;
+
+ return Error;
+}
+
+int main()
+{
+ int Error(0);
+
+ Error += test_areCollinear();
+ Error += test_areOrthogonal();
+ Error += test_isNormalized();
+ Error += test_isNull();
+ Error += test_areOrthonormal();
+
+ return Error;
+}
+
+
diff --git a/3rdparty/glm/source/test/gtx/gtx_wrap.cpp b/3rdparty/glm/source/test/gtx/gtx_wrap.cpp
new file mode 100644
index 0000000..2354cc8
--- /dev/null
+++ b/3rdparty/glm/source/test/gtx/gtx_wrap.cpp
@@ -0,0 +1,191 @@
+#define GLM_ENABLE_EXPERIMENTAL
+#include <glm/gtx/wrap.hpp>
+#include <glm/ext/scalar_relational.hpp>
+#include <glm/ext/vector_relational.hpp>
+
+namespace clamp
+{
+ int test()
+ {
+ int Error(0);
+
+ float A = glm::clamp(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::clamp(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::clamp(1.0f);
+ Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::clamp(-0.5f);
+ Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1;
+
+ float E = glm::clamp(1.5f);
+ Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1;
+
+ glm::vec2 K = glm::clamp(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::clamp(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::clamp(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::clamp(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace clamp
+
+namespace repeat
+{
+ int test()
+ {
+ int Error(0);
+
+ float A = glm::repeat(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::repeat(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::repeat(1.0f);
+ Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::repeat(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::repeat(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::repeat(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ glm::vec2 K = glm::repeat(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::repeat(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::repeat(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::repeat(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace repeat
+
+namespace mirrorClamp
+{
+ int test()
+ {
+ int Error(0);
+
+ float A = glm::mirrorClamp(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::mirrorClamp(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::mirrorClamp(1.1f);
+ Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1;
+
+ float D = glm::mirrorClamp(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::mirrorClamp(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::mirrorClamp(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ float G = glm::mirrorClamp(3.1f);
+ Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1;
+
+ float H = glm::mirrorClamp(-3.1f);
+ Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1;
+
+ float I = glm::mirrorClamp(-0.9f);
+ Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1;
+
+ glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace mirrorClamp
+
+namespace mirrorRepeat
+{
+ int test()
+ {
+ int Error(0);
+
+ float A = glm::mirrorRepeat(0.5f);
+ Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1;
+
+ float B = glm::mirrorRepeat(0.0f);
+ Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1;
+
+ float C = glm::mirrorRepeat(1.0f);
+ Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1;
+
+ float D = glm::mirrorRepeat(-0.5f);
+ Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1;
+
+ float E = glm::mirrorRepeat(1.5f);
+ Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1;
+
+ float F = glm::mirrorRepeat(0.9f);
+ Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1;
+
+ float G = glm::mirrorRepeat(3.0f);
+ Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1;
+
+ float H = glm::mirrorRepeat(-3.0f);
+ Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1;
+
+ float I = glm::mirrorRepeat(-1.0f);
+ Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1;
+
+ glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f));
+ Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1;
+
+ glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f));
+ Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1;
+
+ glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f));
+ Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1;
+
+ glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f));
+ Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1;
+
+ return Error;
+ }
+}//namespace mirrorRepeat
+
+int main()
+{
+ int Error(0);
+
+ Error += clamp::test();
+ Error += repeat::test();
+ Error += mirrorClamp::test();
+ Error += mirrorRepeat::test();
+
+ return Error;
+}
diff --git a/3rdparty/glm/source/test/perf/CMakeLists.txt b/3rdparty/glm/source/test/perf/CMakeLists.txt
new file mode 100644
index 0000000..19c7050
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/CMakeLists.txt
@@ -0,0 +1,6 @@
+glmCreateTestGTC(perf_matrix_div)
+glmCreateTestGTC(perf_matrix_inverse)
+glmCreateTestGTC(perf_matrix_mul)
+glmCreateTestGTC(perf_matrix_mul_vector)
+glmCreateTestGTC(perf_matrix_transpose)
+glmCreateTestGTC(perf_vector_mul_matrix)
diff --git a/3rdparty/glm/source/test/perf/perf_matrix_div.cpp b/3rdparty/glm/source/test/perf/perf_matrix_div.cpp
new file mode 100644
index 0000000..630188d
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_matrix_div.cpp
@@ -0,0 +1,153 @@
+#define GLM_FORCE_INLINE
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType>
+static void test_mat_div_mat(matType const& M, std::vector<matType> const& I, std::vector<matType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = M / I[i];
+}
+
+template <typename matType>
+static int launch_mat_div_mat(std::vector<matType>& O, matType const& Transform, matType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<matType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i) + Scale;
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_mat_div_mat<matType>(Transform, I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat2_div_mat2(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4);
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_div_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_div_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat3_div_mat3(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_div_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_div_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat4_div_mat4(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_div_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_div_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("mat2 / mat2:\n");
+ Error += comp_mat2_div_mat2<glm::mat2, glm::aligned_mat2>(Samples);
+
+ std::printf("dmat2 / dmat2:\n");
+ Error += comp_mat2_div_mat2<glm::dmat2, glm::aligned_dmat2>(Samples);
+
+ std::printf("mat3 / mat3:\n");
+ Error += comp_mat3_div_mat3<glm::mat3, glm::aligned_mat3>(Samples);
+
+ std::printf("dmat3 / dmat3:\n");
+ Error += comp_mat3_div_mat3<glm::dmat3, glm::aligned_dmat3>(Samples);
+
+ std::printf("mat4 / mat4:\n");
+ Error += comp_mat4_div_mat4<glm::mat4, glm::aligned_mat4>(Samples);
+
+ std::printf("dmat4 / dmat4:\n");
+ Error += comp_mat4_div_mat4<glm::dmat4, glm::aligned_dmat4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp b/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp
new file mode 100644
index 0000000..1a989ae
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp
@@ -0,0 +1,150 @@
+#define GLM_FORCE_INLINE
+#include <glm/matrix.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType>
+static void test_mat_inverse(std::vector<matType> const& I, std::vector<matType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = glm::inverse(I[i]);
+}
+
+template <typename matType>
+static int launch_mat_inverse(std::vector<matType>& O, matType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<matType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i) + Scale;
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_mat_inverse<matType>(I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat2_inverse(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_inverse<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_inverse<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat3_inverse(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_inverse<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_inverse<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat4_inverse(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_inverse<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_inverse<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("glm::inverse(mat2):\n");
+ Error += comp_mat2_inverse<glm::mat2, glm::aligned_mat2>(Samples);
+
+ std::printf("glm::inverse(dmat2):\n");
+ Error += comp_mat2_inverse<glm::dmat2, glm::aligned_dmat2>(Samples);
+
+ std::printf("glm::inverse(mat3):\n");
+ Error += comp_mat3_inverse<glm::mat3, glm::aligned_mat3>(Samples);
+
+ std::printf("glm::inverse(dmat3):\n");
+ Error += comp_mat3_inverse<glm::dmat3, glm::aligned_dmat3>(Samples);
+
+ std::printf("glm::inverse(mat4):\n");
+ Error += comp_mat4_inverse<glm::mat4, glm::aligned_mat4>(Samples);
+
+ std::printf("glm::inverse(dmat4):\n");
+ Error += comp_mat4_inverse<glm::dmat4, glm::aligned_dmat4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp b/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp
new file mode 100644
index 0000000..d6b1f10
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp
@@ -0,0 +1,154 @@
+#define GLM_FORCE_INLINE
+#include <glm/ext/matrix_float2x2.hpp>
+#include <glm/ext/matrix_double2x2.hpp>
+#include <glm/ext/matrix_float3x3.hpp>
+#include <glm/ext/matrix_double3x3.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType>
+static void test_mat_mul_mat(matType const& M, std::vector<matType> const& I, std::vector<matType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = M * I[i];
+}
+
+template <typename matType>
+static int launch_mat_mul_mat(std::vector<matType>& O, matType const& Transform, matType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<matType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i);
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_mat_mul_mat<matType>(Transform, I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat2_mul_mat2(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4);
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat3_mul_mat3(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat4_mul_mat4(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_mat<packedMatType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_mat<alignedMatType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("mat2 * mat2:\n");
+ Error += comp_mat2_mul_mat2<glm::mat2, glm::aligned_mat2>(Samples);
+
+ std::printf("dmat2 * dmat2:\n");
+ Error += comp_mat2_mul_mat2<glm::dmat2, glm::aligned_dmat2>(Samples);
+
+ std::printf("mat3 * mat3:\n");
+ Error += comp_mat3_mul_mat3<glm::mat3, glm::aligned_mat3>(Samples);
+
+ std::printf("dmat3 * dmat3:\n");
+ Error += comp_mat3_mul_mat3<glm::dmat3, glm::aligned_dmat3>(Samples);
+
+ std::printf("mat4 * mat4:\n");
+ Error += comp_mat4_mul_mat4<glm::mat4, glm::aligned_mat4>(Samples);
+
+ std::printf("dmat4 * dmat4:\n");
+ Error += comp_mat4_mul_mat4<glm::dmat4, glm::aligned_dmat4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp b/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp
new file mode 100644
index 0000000..8e555f8
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp
@@ -0,0 +1,154 @@
+#define GLM_FORCE_INLINE
+#include <glm/ext/matrix_float2x2.hpp>
+#include <glm/ext/matrix_double2x2.hpp>
+#include <glm/ext/matrix_float3x3.hpp>
+#include <glm/ext/matrix_double3x3.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType, typename vecType>
+static void test_mat_mul_vec(matType const& M, std::vector<vecType> const& I, std::vector<vecType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = M * I[i];
+}
+
+template <typename matType, typename vecType>
+static int launch_mat_mul_vec(std::vector<vecType>& O, matType const& Transform, vecType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<vecType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i);
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_mat_mul_vec<matType, vecType>(Transform, I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_mat2_mul_vec2(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4);
+ packedVecType const Scale(0.01, 0.02);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = packedVecType(SIMD[i]);
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_mat3_mul_vec3(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ packedVecType const Scale(0.01, 0.02, 0.05);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_mat4_mul_vec4(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ packedVecType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("mat2 * vec2:\n");
+ Error += comp_mat2_mul_vec2<glm::mat2, glm::vec2, glm::aligned_mat2, glm::aligned_vec2>(Samples);
+
+ std::printf("dmat2 * dvec2:\n");
+ Error += comp_mat2_mul_vec2<glm::dmat2, glm::dvec2,glm::aligned_dmat2, glm::aligned_dvec2>(Samples);
+
+ std::printf("mat3 * vec3:\n");
+ Error += comp_mat3_mul_vec3<glm::mat3, glm::vec3, glm::aligned_mat3, glm::aligned_vec3>(Samples);
+
+ std::printf("dmat3 * dvec3:\n");
+ Error += comp_mat3_mul_vec3<glm::dmat3, glm::dvec3, glm::aligned_dmat3, glm::aligned_dvec3>(Samples);
+
+ std::printf("mat4 * vec4:\n");
+ Error += comp_mat4_mul_vec4<glm::mat4, glm::vec4, glm::aligned_mat4, glm::aligned_vec4>(Samples);
+
+ std::printf("dmat4 * dvec4:\n");
+ Error += comp_mat4_mul_vec4<glm::dmat4, glm::dvec4, glm::aligned_dmat4, glm::aligned_dvec4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp b/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp
new file mode 100644
index 0000000..2fdc782
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp
@@ -0,0 +1,150 @@
+#define GLM_FORCE_INLINE
+#include <glm/matrix.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType>
+static void test_mat_transpose(std::vector<matType> const& I, std::vector<matType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = glm::transpose(I[i]);
+}
+
+template <typename matType>
+static int launch_mat_transpose(std::vector<matType>& O, matType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<matType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i) + Scale;
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_mat_transpose<matType>(I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat2_transpose(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_transpose<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_transpose<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat3_transpose(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_transpose<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_transpose<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename alignedMatType>
+static int comp_mat4_transpose(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05);
+
+ std::vector<packedMatType> SISD;
+ std::printf("- SISD: %d us\n", launch_mat_transpose<packedMatType>(SISD, Scale, Samples));
+
+ std::vector<alignedMatType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_mat_transpose<alignedMatType>(SIMD, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedMatType const A = SISD[i];
+ packedMatType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ assert(!Error);
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("glm::transpose(mat2):\n");
+ Error += comp_mat2_transpose<glm::mat2, glm::aligned_mat2>(Samples);
+
+ std::printf("glm::transpose(dmat2):\n");
+ Error += comp_mat2_transpose<glm::dmat2, glm::aligned_dmat2>(Samples);
+
+ std::printf("glm::transpose(mat3):\n");
+ Error += comp_mat3_transpose<glm::mat3, glm::aligned_mat3>(Samples);
+
+ std::printf("glm::transpose(dmat3):\n");
+ Error += comp_mat3_transpose<glm::dmat3, glm::aligned_dmat3>(Samples);
+
+ std::printf("glm::transpose(mat4):\n");
+ Error += comp_mat4_transpose<glm::mat4, glm::aligned_mat4>(Samples);
+
+ std::printf("glm::transpose(dmat4):\n");
+ Error += comp_mat4_transpose<glm::dmat4, glm::aligned_dmat4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif
diff --git a/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp b/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp
new file mode 100644
index 0000000..20991df
--- /dev/null
+++ b/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp
@@ -0,0 +1,154 @@
+#define GLM_FORCE_INLINE
+#include <glm/ext/matrix_float2x2.hpp>
+#include <glm/ext/matrix_double2x2.hpp>
+#include <glm/ext/matrix_float3x3.hpp>
+#include <glm/ext/matrix_double3x3.hpp>
+#include <glm/ext/matrix_float4x4.hpp>
+#include <glm/ext/matrix_double4x4.hpp>
+#include <glm/ext/matrix_transform.hpp>
+#include <glm/ext/matrix_relational.hpp>
+#include <glm/ext/vector_float4.hpp>
+#if GLM_CONFIG_SIMD == GLM_ENABLE
+#include <glm/gtc/type_aligned.hpp>
+#include <vector>
+#include <chrono>
+#include <cstdio>
+
+template <typename matType, typename vecType>
+static void test_vec_mul_mat(matType const& M, std::vector<vecType> const& I, std::vector<vecType>& O)
+{
+ for (std::size_t i = 0, n = I.size(); i < n; ++i)
+ O[i] = I[i] * M;
+}
+
+template <typename matType, typename vecType>
+static int launch_vec_mul_mat(std::vector<vecType>& O, matType const& Transform, vecType const& Scale, std::size_t Samples)
+{
+ typedef typename matType::value_type T;
+
+ std::vector<vecType> I(Samples);
+ O.resize(Samples);
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ I[i] = Scale * static_cast<T>(i);
+
+ std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
+ test_vec_mul_mat<matType, vecType>(Transform, I, O);
+ std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
+
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count());
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_vec2_mul_mat2(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4);
+ packedVecType const Scale(0.01, 0.02);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_vec_mul_mat<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_vec_mul_mat<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = packedVecType(SIMD[i]);
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_vec3_mul_mat3(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ packedVecType const Scale(0.01, 0.02, 0.05);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_vec_mul_mat<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_vec_mul_mat<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType>
+static int comp_vec4_mul_mat4(std::size_t Samples)
+{
+ typedef typename packedMatType::value_type T;
+
+ int Error = 0;
+
+ packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ packedVecType const Scale(0.01, 0.02, 0.03, 0.05);
+
+ std::vector<packedVecType> SISD;
+ std::printf("- SISD: %d us\n", launch_vec_mul_mat<packedMatType, packedVecType>(SISD, Transform, Scale, Samples));
+
+ std::vector<alignedVecType> SIMD;
+ std::printf("- SIMD: %d us\n", launch_vec_mul_mat<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples));
+
+ for(std::size_t i = 0; i < Samples; ++i)
+ {
+ packedVecType const A = SISD[i];
+ packedVecType const B = SIMD[i];
+ Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1;
+ }
+
+ return Error;
+}
+
+int main()
+{
+ std::size_t const Samples = 100000;
+
+ int Error = 0;
+
+ std::printf("vec2 * mat2:\n");
+ Error += comp_vec2_mul_mat2<glm::mat2, glm::vec2, glm::aligned_mat2, glm::aligned_vec2>(Samples);
+
+ std::printf("dvec2 * dmat2:\n");
+ Error += comp_vec2_mul_mat2<glm::dmat2, glm::dvec2,glm::aligned_dmat2, glm::aligned_dvec2>(Samples);
+
+ std::printf("vec3 * mat3:\n");
+ Error += comp_vec3_mul_mat3<glm::mat3, glm::vec3, glm::aligned_mat3, glm::aligned_vec3>(Samples);
+
+ std::printf("dvec3 * dmat3:\n");
+ Error += comp_vec3_mul_mat3<glm::dmat3, glm::dvec3, glm::aligned_dmat3, glm::aligned_dvec3>(Samples);
+
+ std::printf("vec4 * mat4:\n");
+ Error += comp_vec4_mul_mat4<glm::mat4, glm::vec4, glm::aligned_mat4, glm::aligned_vec4>(Samples);
+
+ std::printf("dvec4 * dmat4:\n");
+ Error += comp_vec4_mul_mat4<glm::dmat4, glm::dvec4, glm::aligned_dmat4, glm::aligned_dvec4>(Samples);
+
+ return Error;
+}
+
+#else
+
+int main()
+{
+ return 0;
+}
+
+#endif