mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[util] Mark clamp & align as constexpr
This commit is contained in:
parent
a3f74b5eda
commit
d44707e349
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user