diff options
| author | untodesu <kirill@untode.su> | 2025-03-15 16:22:09 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-15 16:22:09 +0500 |
| commit | 3bf42c6ff3805a0d42bbc661794a95ff31bedc26 (patch) | |
| tree | 05049955847504808d6bed2bb7b155f8b03807bb /deps/include/glm/gtc/integer.inl | |
| parent | 02294547dcde0d4ad76e229106702261e9f10a51 (diff) | |
| download | voxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.tar.bz2 voxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.zip | |
Add whatever I was working on for the last month
Diffstat (limited to 'deps/include/glm/gtc/integer.inl')
| -rw-r--r-- | deps/include/glm/gtc/integer.inl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/include/glm/gtc/integer.inl b/deps/include/glm/gtc/integer.inl new file mode 100644 index 0000000..5f66dfe --- /dev/null +++ b/deps/include/glm/gtc/integer.inl @@ -0,0 +1,33 @@ +/// @ref gtc_integer + +namespace glm{ +namespace detail +{ + template<length_t L, typename T, qualifier Q, bool Aligned> + struct compute_log2<L, T, Q, false, Aligned> + { + 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 vec<L, T, Q>(detail::compute_findMSB_vec<L, T, Q, sizeof(T) * 8>::call(v)); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template<qualifier Q, bool Aligned> + struct compute_log2<4, int, Q, false, Aligned> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) + { + 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 +}//namespace glm |
