diff --git a/glm/detail/_vectorize.hpp b/glm/detail/_vectorize.hpp index 4f067998..284ff1f0 100644 --- a/glm/detail/_vectorize.hpp +++ b/glm/detail/_vectorize.hpp @@ -86,7 +86,7 @@ GLM_FUNC_QUALIFIER detail::tvec1 func \ ( \ detail::tvec1 const & x, \ - T const & y \ + typename detail::tvec1::value_type const & y \ ) \ { \ return detail::tvec1( \ @@ -98,7 +98,7 @@ GLM_FUNC_QUALIFIER detail::tvec2 func \ ( \ detail::tvec2 const & x, \ - T const & y \ + typename detail::tvec2::value_type const & y \ ) \ { \ return detail::tvec2( \ @@ -111,7 +111,7 @@ GLM_FUNC_QUALIFIER detail::tvec3 func \ ( \ detail::tvec3 const & x, \ - T const & y \ + typename detail::tvec3::value_type const & y \ ) \ { \ return detail::tvec3( \ @@ -125,7 +125,7 @@ GLM_FUNC_QUALIFIER detail::tvec4 func \ ( \ detail::tvec4 const & x, \ - T const & y \ + typename detail::tvec4::value_type const & y \ ) \ { \ return detail::tvec4( \ diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 6c996861..b08da197 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -12,6 +12,7 @@ //#include #include #include +#include #include #include @@ -149,6 +150,61 @@ int test_floatBitsToUint() return Error; } +int test_min() +{ + int Error = 0; + + glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(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)); + 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)); + 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)); + Error += D2 ? 0 : 1; + + return Error; +} + +int test_max() +{ + int Error = 0; + + glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(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)); + 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)); + 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)); + Error += D2 ? 0 : 1; + + return Error; +} + +int test_clamp() +{ + int Error = 0; + + return Error; +} + namespace test_mix { template @@ -633,6 +689,8 @@ int main() Error += test_floatBitsToInt(); Error += test_floatBitsToUint(); Error += test_step::run(); + Error += test_max(); + Error += test_min(); Error += test_mix::run(); Error += test_round(); Error += test_roundEven();