diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-21 17:40:38 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-21 17:40:38 +0200 |
commit | 2877f4eda3d1b0c7431039e3142ecf1a282a34b1 (patch) | |
tree | 58ad35e27ab2a3b8955f5adbf28f296670681ffc /external/include/glm/gtc/integer.inl | |
parent | Smooth sun movement (diff) | |
download | AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.gz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.bz2 AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.lz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.xz AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.tar.zst AltCraft-2877f4eda3d1b0c7431039e3142ecf1a282a34b1.zip |
Diffstat (limited to 'external/include/glm/gtc/integer.inl')
-rw-r--r-- | external/include/glm/gtc/integer.inl | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/external/include/glm/gtc/integer.inl b/external/include/glm/gtc/integer.inl index 7ce2918..9d4b618 100644 --- a/external/include/glm/gtc/integer.inl +++ b/external/include/glm/gtc/integer.inl @@ -4,36 +4,34 @@ namespace glm{ namespace detail { - template <typename T, precision P, template <typename, precision> class vecType, bool Aligned> - struct compute_log2<T, P, vecType, false, Aligned> + template<length_t L, typename T, qualifier Q, bool Aligned> + struct compute_log2<L, T, Q, false, Aligned> { - GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) + GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v) { //Equivalent to return findMSB(vec); but save one function call in ASM with VC //return findMSB(vec); - return vecType<T, P>(detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(vec)); + return vec<L, T, Q>(detail::compute_findMSB_vec<L, T, Q, sizeof(T) * 8>::call(v)); } }; # if GLM_HAS_BITSCAN_WINDOWS - template <precision P, bool Aligned> - struct compute_log2<int, P, tvec4, false, Aligned> + template<qualifier Q, bool Aligned> + struct compute_log2<4, int, Q, false, Aligned> { - GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) { - tvec4<int, P> Result(glm::uninitialize); - - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), vec.x); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), vec.y); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), vec.z); - _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.w), vec.w); - + vec<4, int, Q> Result; + _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), v.x); + _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), v.y); + _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), v.z); + _BitScanReverse(reinterpret_cast<unsigned long*>(&Result.w), v.w); return Result; } }; # endif//GLM_HAS_BITSCAN_WINDOWS }//namespace detail - template <typename genType> + template<typename genType> GLM_FUNC_QUALIFIER int iround(genType x) { GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'iround' only accept floating-point inputs"); @@ -42,16 +40,16 @@ namespace detail return static_cast<int>(x + static_cast<genType>(0.5)); } - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<int, P> iround(vecType<T, P> const& x) + template<length_t L, typename T, qualifier Q> + GLM_FUNC_QUALIFIER vec<L, int, Q> iround(vec<L, T, Q> const& x) { GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs"); - assert(all(lessThanEqual(vecType<T, P>(0), x))); + assert(all(lessThanEqual(vec<L, T, Q>(0), x))); - return vecType<int, P>(x + static_cast<T>(0.5)); + return vec<L, int, Q>(x + static_cast<T>(0.5)); } - template <typename genType> + template<typename genType> GLM_FUNC_QUALIFIER uint uround(genType x) { GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'uround' only accept floating-point inputs"); @@ -60,12 +58,12 @@ namespace detail return static_cast<uint>(x + static_cast<genType>(0.5)); } - template <typename T, precision P, template <typename, precision> class vecType> - GLM_FUNC_QUALIFIER vecType<uint, P> uround(vecType<T, P> const& x) + template<length_t L, typename T, qualifier Q> + GLM_FUNC_QUALIFIER vec<L, uint, Q> uround(vec<L, T, Q> const& x) { GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs"); - assert(all(lessThanEqual(vecType<T, P>(0), x))); + assert(all(lessThanEqual(vec<L, T, Q>(0), x))); - return vecType<uint, P>(x + static_cast<T>(0.5)); + return vec<L, uint, Q>(x + static_cast<T>(0.5)); } }//namespace glm |