1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[util] Mark clamp & align as constexpr

This commit is contained in:
Joshua Ashton 2019-03-24 20:38:39 +00:00 committed by Philip Rebohle
parent a3f74b5eda
commit d44707e349

View File

@ -5,14 +5,14 @@ namespace dxvk {
constexpr size_t CACHE_LINE_SIZE = 64;
template<typename T>
T clamp(T n, T lo, T hi) {
constexpr T clamp(T n, T lo, T hi) {
if (n < lo) return lo;
if (n > hi) return hi;
return n;
}
template<typename T, typename U = T>
T align(T what, U to) {
constexpr T align(T what, U to) {
return (what + to - 1) & ~(to - 1);
}