From 8125d53e58f0c08394e2e730bc88cbc57234a147 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 18 Apr 2018 17:49:11 +0200 Subject: [PATCH] [dxvk] Remove std::clamp usage Breaks outdated compilers. --- src/dxvk/hud/dxvk_hud_fps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dxvk/hud/dxvk_hud_fps.cpp b/src/dxvk/hud/dxvk_hud_fps.cpp index d497cf35..d01a8ba4 100644 --- a/src/dxvk/hud/dxvk_hud_fps.cpp +++ b/src/dxvk/hud/dxvk_hud_fps.cpp @@ -96,8 +96,8 @@ namespace dxvk::hud { minMs = std::min(minMs, uint32_t(us / 100.0f)); maxMs = std::max(maxMs, uint32_t(us / 100.0f)); - float r = std::clamp(-1.0f + us / targetUs, 0.0f, 1.0f); - float g = std::clamp( 3.0f - us / targetUs, 0.0f, 1.0f); + float r = std::min(std::max(-1.0f + us / targetUs, 0.0f), 1.0f); + float g = std::min(std::max( 3.0f - us / targetUs, 0.0f), 1.0f); float l = std::sqrt(r * r + g * g); HudTexCoord tc = { 0u, 0u }; @@ -108,7 +108,7 @@ namespace dxvk::hud { float hVal = std::log2(std::max((us - minUs) / targetUs + 1.0f, 1.0f)) / std::log2((maxUs - minUs) / targetUs); - float h = std::clamp(40.0f * hVal, 2.0f, 40.0f); + float h = std::min(std::max(40.0f * hVal, 2.0f), 40.0f); vData[2 * i + 0] = HudVertex { { x, y }, tc, color }; vData[2 * i + 1] = HudVertex { { x, y - h }, tc, color };