From da3c9948e668ae2e6dbcb91183dae88272172e8a Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 4 Aug 2021 20:05:56 +0300 Subject: [PATCH] rsx: Revert use of std::has_single_bit - Zero is not a power of 2 in this situation, and we do not want to treat it as such --- rpcs3/Emu/RSX/Common/TextureUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index 5a313eadb6..97ff4ae802 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -14,10 +14,10 @@ namespace utils return std::span(bless(span.data()), sizeof(U) * span.size() / sizeof(T)); } - template + template requires(std::is_integral_v && std::is_unsigned_v) bool is_power_of_2(T value) { - return std::has_single_bit(value); + return !(value & (value - 1)); } }