1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-09 04:46:07 +01:00
dxvk/src/util/util_math.h
2018-05-09 20:37:49 +02:00

19 lines
318 B
C++

#pragma once
namespace dxvk {
constexpr size_t CACHE_LINE_SIZE = 64;
template<typename T>
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) {
return (what + to - 1) & ~(to - 1);
}
}