From d44707e349e06cdceeb7b4a281bf2a67b8ca1b50 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 24 Mar 2019 20:38:39 +0000 Subject: [PATCH] [util] Mark clamp & align as constexpr --- src/util/util_math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/util_math.h b/src/util/util_math.h index e2ad44a59..806a563ba 100644 --- a/src/util/util_math.h +++ b/src/util/util_math.h @@ -5,14 +5,14 @@ namespace dxvk { constexpr size_t CACHE_LINE_SIZE = 64; template - T clamp(T n, T lo, T hi) { + constexpr T clamp(T n, T lo, T hi) { if (n < lo) return lo; if (n > hi) return hi; return n; } template - T align(T what, U to) { + constexpr T align(T what, U to) { return (what + to - 1) & ~(to - 1); }