mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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);
|
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
|
// Equivalent of std::clamp for use with floating point numbers
|
||||||
// Handles (-){INFINITY,NAN} cases.
|
// Handles (-){INFINITY,NAN} cases.
|
||||||
// Will return min in cases of NAN, etc.
|
// Will return min in cases of NAN, etc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user