[GPU] Another attempt to fix memleaks caused by depth_bias_slope_scaled

This commit is contained in:
Gliniak
2024-03-16 19:31:00 +01:00
parent 3d4bdc9023
commit 8c44649f01
2 changed files with 15 additions and 0 deletions

View File

@@ -597,6 +597,19 @@ inline T sat_sub(T a, T b) {
}
return T(result);
}
template <typename T>
inline T roundToNearestOrderOfMagnitude(T value) {
if (!value) {
return value;
}
const double order = std::pow(10, std::floor(std::log10(std::fabs(value))));
const double rounded = std::round(value / order) * order;
return static_cast<T>(rounded);
}
namespace divisors {
union IDivExtraInfo {
uint32_t value_;