mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 10:24:10 +01:00
[util] Add alignDown helper
This commit is contained in:
parent
57b2c02528
commit
16dd1249b7
@ -18,6 +18,11 @@ namespace dxvk {
|
||||
return (what + to - 1) & ~(to - 1);
|
||||
}
|
||||
|
||||
template<typename T, typename U = T>
|
||||
constexpr T alignDown(T what, U to) {
|
||||
return (what / to) * to;
|
||||
}
|
||||
|
||||
// Equivalent of std::clamp for use with floating point numbers
|
||||
// Handles (-){INFINITY,NAN} cases.
|
||||
// Will return min in cases of NAN, etc.
|
||||
|
Loading…
Reference in New Issue
Block a user