diff options
author | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
commit | 047f294de1b4d385b811ac9f5afc393d81cc4ae9 (patch) | |
tree | f96100a813a4ffb28dcd074455d3a2f8ee426430 /3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp | |
parent | 488fb8b4b9da7f99a5cc37e39fff9f1cb700f2a8 (diff) |
Copy changes from the no-history fork, generated back in 2023
Original commit message:
> commit f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73
> Author: rtk0c <[email protected]>
> Date: Wed Sep 20 23:58:58 2023 -0700
>
> Copy from the PlasticSCM repo, replace vendored glm wtih conan
In reality, this also introduced a few uncommitted changes in the
original PlasticSCM repo. See the modified and new files in this patch.
Diffstat (limited to '3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp')
-rw-r--r-- | 3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp deleted file mode 100644 index 3d20f10..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#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; -} |