1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-08 10:46:09 +01:00
dxvk/src/util/util_math.h

17 lines
274 B
C
Raw Normal View History

2017-10-10 23:32:13 +02:00
#pragma once
namespace dxvk {
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);
}
2017-10-10 23:32:13 +02:00
}