mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-16 02:49:48 +12:00
Use inline rotl
/ror
Fixes apple-clang builds, which do not implement a lot of the `bit` header.
This commit is contained in:
parent
c778c34433
commit
cb64c52d2f
1 changed files with 5 additions and 2 deletions
|
@ -25,11 +25,14 @@ static s32 findQueueFamily(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static u32 rotl32(u32 x, u32 n) { return (x << n) | (x >> (32 - n)); }
|
||||||
|
static u32 ror32(u32 x, u32 n) { return (x >> n) | (x << (32 - n)); }
|
||||||
|
|
||||||
u32 RendererVK::colorBufferHash(u32 loc, u32 size, PICA::ColorFmt format) {
|
u32 RendererVK::colorBufferHash(u32 loc, u32 size, PICA::ColorFmt format) {
|
||||||
return std::rotl<u32>(loc, 17) ^ std::rotr(size, 23) ^ (static_cast<u64>(format) << 60);
|
return rotl32(loc, 17) ^ ror32(size, 23) ^ (static_cast<u64>(format) << 60);
|
||||||
}
|
}
|
||||||
u32 RendererVK::depthBufferHash(u32 loc, u32 size, PICA::DepthFmt format) {
|
u32 RendererVK::depthBufferHash(u32 loc, u32 size, PICA::DepthFmt format) {
|
||||||
return std::rotl<u32>(loc, 17) ^ std::rotr(size, 29) ^ (static_cast<u64>(format) << 60);
|
return rotl32(loc, 17) ^ ror32(size, 29) ^ (static_cast<u64>(format) << 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
RendererVK::Texture& RendererVK::getColorRenderTexture() {
|
RendererVK::Texture& RendererVK::getColorRenderTexture() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue