summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorMinty-Meeo <45425365+Minty-Meeo@users.noreply.github.com>2022-10-10 04:03:15 -0500
committerMinty-Meeo <45425365+Minty-Meeo@users.noreply.github.com>2022-12-21 04:17:00 -0600
commit05bebee802c62ff114c53bc9f365f62113c9982e (patch)
tree512f904bbd0a32d5a08ee7440d69e0d6543a8220 /Source/Core/VideoBackends
parentd853da3b0b6546650d030daa706ba5a68057ad19 (diff)
Replace BitUtils with C++20: Counting Zeroes
With the upgrade to C++20, std::countl_zero and std::countr_zero can replace these home-spun implementations from the BitUtil.h library.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/Metal/MTLStateTracker.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm
index b3a8251100..a2e2a2a8f3 100644
--- a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm
+++ b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm
@@ -4,10 +4,10 @@
#include "VideoBackends/Metal/MTLStateTracker.h"
#include <algorithm>
+#include <bit>
#include <mutex>
#include "Common/Assert.h"
-#include "Common/BitUtils.h"
#include "VideoBackends/Metal/MTLObjectCache.h"
#include "VideoBackends/Metal/MTLPerfQuery.h"
@@ -713,8 +713,8 @@ static constexpr NSString* LABEL_UTIL = @"Utility Draw";
static NSRange RangeOfBits(u32 value)
{
ASSERT(value && "Value must be nonzero");
- u32 low = Common::CountTrailingZeros(value);
- u32 high = 31 - Common::CountLeadingZeros(value);
+ int low = std::countr_zero(value);
+ int high = 31 - std::countl_zero(value);
return NSMakeRange(low, high + 1 - low);
}