0d9fcee763
- Update to version 0.9.9.8 Features: * Added GLM_EXT_vector_intX* and GLM_EXT_vector_uintX* extensions * Added GLM_EXT_matrix_intX* and GLM_EXT_matrix_uintX* extensions Improvements: * Added clamp, repeat, mirrorClamp and mirrorRepeat function to GLM_EXT_scalar_commond and GLM_EXT_vector_commond extensions with tests Fixes: * Fixed unnecessary warnings from matrix_projection.inl * Fixed quaternion slerp overload which interpolates with extra spins * Fixed for glm::length using arch64 * Fixed singularity check for quatLookAt version 0.9.9.7 Improvements: * Improved Neon support with more functions optimized * Added CMake GLM interface * Added fma implementation based on std::fma * Added missing quat constexpr * Added GLM_FORCE_QUAT_DATA_WXYZ to store quat data as w,x,y,z instead of x,y,z,w Fixes: * Fixed equal ULP variation when using negative sign * Fixed for intersection ray/plane and added related tests * Fixed ARM 64bit detection * Fixed GLM_EXT_matrix_clip_space warnings * Fixed Wimplicit-int-float-conversion warnings with clang 10+ * Fixed EXT_matrix_clip_space perspectiveFov version 0.9.9.6 Features: * Added Neon support to glm * Added SYCL support * Added EXT_scalar_integer extension with power of two and multiple scalar functions * Added EXT_vector_integer extension with power of two and multiple vector functions Improvements: * Added missing genType check for bitCount and bitfieldReverse Fixes: * Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 * Fixed hash hashes qua instead of tquat * Fixed .natvis as structs renamed * Fixed ldexp and frexp declaration * Fixed missing const to quaternion conversion operators * Fixed EXT_scalar_ulp and EXT_vector_ulp API coding style * Fixed quaternion componant order: w, {x, y, z} * Fixed GLM_HAS_CXX11_STL broken on Clang with Linux * Fixed Clang or GCC build due to wrong GLM_HAS_IF_CONSTEXPR definition * Fixed CUDA 9 build - Drop glm-cmake-config.patch (no longer applies) - Add glm-0.9.9.8-install.patch (courtesy of Fedora), glm-0.9.9.8-pkgconfig.patch and glm-0.9.9.8-fix_tests_big-endian.patch OBS-URL: https://build.opensuse.org/request/show/900879 OBS-URL: https://build.opensuse.org/package/show/science/glm?expand=0&rev=11
182 lines
3.2 KiB
Diff
182 lines
3.2 KiB
Diff
From 06ce42e72324b32b1f4c37c646e99950c2bd5f6b Mon Sep 17 00:00:00 2001
|
|
From: Max Rees <maxcrees@me.com>
|
|
Date: Sun, 15 Mar 2020 15:13:27 -0400
|
|
Subject: [PATCH] Fix test suite on big endian platforms
|
|
|
|
---
|
|
glm/gtc/packing.inl | 55 ++++++++++++++++++++++++++++++++++++++++
|
|
test/gtc/gtc_packing.cpp | 3 ++-
|
|
2 files changed, 57 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl
|
|
index 8c906e16c..b1c99a507 100644
|
|
--- a/glm/gtc/packing.inl
|
|
+++ b/glm/gtc/packing.inl
|
|
@@ -9,6 +9,9 @@
|
|
#include "../detail/type_half.hpp"
|
|
#include <cstring>
|
|
#include <limits>
|
|
+extern "C" {
|
|
+#include <endian.h>
|
|
+}
|
|
|
|
namespace glm{
|
|
namespace detail
|
|
@@ -183,9 +186,15 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 3;
|
|
uint y : 3;
|
|
uint z : 2;
|
|
+#else
|
|
+ uint z : 2;
|
|
+ uint y : 3;
|
|
+ uint x : 3;
|
|
+#endif
|
|
} data;
|
|
uint8 pack;
|
|
};
|
|
@@ -194,8 +203,13 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 4;
|
|
uint y : 4;
|
|
+#else
|
|
+ uint y : 4;
|
|
+ uint x : 4;
|
|
+#endif
|
|
} data;
|
|
uint8 pack;
|
|
};
|
|
@@ -204,10 +218,17 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 4;
|
|
uint y : 4;
|
|
uint z : 4;
|
|
uint w : 4;
|
|
+#else
|
|
+ uint w : 4;
|
|
+ uint z : 4;
|
|
+ uint y : 4;
|
|
+ uint x : 4;
|
|
+#endif
|
|
} data;
|
|
uint16 pack;
|
|
};
|
|
@@ -216,9 +237,15 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 5;
|
|
uint y : 6;
|
|
uint z : 5;
|
|
+#else
|
|
+ uint z : 5;
|
|
+ uint y : 6;
|
|
+ uint x : 5;
|
|
+#endif
|
|
} data;
|
|
uint16 pack;
|
|
};
|
|
@@ -227,10 +254,17 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 5;
|
|
uint y : 5;
|
|
uint z : 5;
|
|
uint w : 1;
|
|
+#else
|
|
+ uint w : 1;
|
|
+ uint z : 5;
|
|
+ uint y : 5;
|
|
+ uint x : 5;
|
|
+#endif
|
|
} data;
|
|
uint16 pack;
|
|
};
|
|
@@ -239,10 +273,17 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 10;
|
|
uint y : 10;
|
|
uint z : 10;
|
|
uint w : 2;
|
|
+#else
|
|
+ uint w : 2;
|
|
+ uint z : 10;
|
|
+ uint y : 10;
|
|
+ uint x : 10;
|
|
+#endif
|
|
} data;
|
|
uint32 pack;
|
|
};
|
|
@@ -251,10 +292,17 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
int x : 10;
|
|
int y : 10;
|
|
int z : 10;
|
|
int w : 2;
|
|
+#else
|
|
+ int w : 2;
|
|
+ int z : 10;
|
|
+ int y : 10;
|
|
+ int x : 10;
|
|
+#endif
|
|
} data;
|
|
uint32 pack;
|
|
};
|
|
@@ -263,10 +311,17 @@ namespace detail
|
|
{
|
|
struct
|
|
{
|
|
+#if BYTE_ORDER == LITTLE_ENDIAN
|
|
uint x : 9;
|
|
uint y : 9;
|
|
uint z : 9;
|
|
uint w : 5;
|
|
+#else
|
|
+ uint w : 5;
|
|
+ uint z : 9;
|
|
+ uint y : 9;
|
|
+ uint x : 9;
|
|
+#endif
|
|
} data;
|
|
uint32 pack;
|
|
};
|
|
diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp
|
|
index df5b3bb1a..fbaaa5bcc 100644
|
|
--- a/test/gtc/gtc_packing.cpp
|
|
+++ b/test/gtc/gtc_packing.cpp
|
|
@@ -4,6 +4,7 @@
|
|
#include <glm/ext/vector_relational.hpp>
|
|
#include <cstdio>
|
|
#include <vector>
|
|
+#include <arpa/inet.h>
|
|
|
|
void print_bits(float const& s)
|
|
{
|
|
@@ -156,7 +157,7 @@ int test_U3x10_1x2()
|
|
|
|
glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
|
|
glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
|
|
- glm::uint32 const r0 = 0x330077ff;
|
|
+ glm::uint32 const r0 = htonl(0xff770033);
|
|
|
|
Error += p0 == r0 ? 0 : 1;
|
|
|