mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
rsx: Minor rsx::ceil_log2 bugfix
This commit is contained in:
parent
995cb8125e
commit
853e2b90a3
@ -245,18 +245,17 @@ namespace rsx
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
static inline u32 floor_log2(u32 value)
|
||||
static constexpr u32 floor_log2(u32 value)
|
||||
{
|
||||
return value <= 1 ? 0 : std::countl_zero(value) ^ 31;
|
||||
}
|
||||
|
||||
static inline u32 ceil_log2(u32 value)
|
||||
static constexpr u32 ceil_log2(u32 value)
|
||||
{
|
||||
return value <= 1 ? 0 : std::countl_zero((value - 1) << 1) ^ 31;
|
||||
return floor_log2(value) + u32{!!(value & (value - 1))};
|
||||
}
|
||||
|
||||
static inline u32 next_pow2(u32 x)
|
||||
static constexpr u32 next_pow2(u32 x)
|
||||
{
|
||||
if (x <= 2) return x;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user