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

17 lines
258 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>
T align(T what, T to) {
return (what + to - 1) & ~(to - 1);
}
2017-10-10 23:32:13 +02:00
}