VideoBackends:Metal: Use standardized C++ features over clang builtins

This commit is contained in:
TellowKrinkle 2024-09-30 23:35:27 -05:00
parent 32fd10bd08
commit 1454934a07
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ public:
id<MTLSamplerState> GetSampler(SamplerSelector sel)
{
if (__builtin_expect(!m_samplers[sel.value], false))
if (!m_samplers[sel.value]) [[unlikely]]
m_samplers[sel.value] = CreateSampler(sel);
return m_samplers[sel.value];
}

View File

@ -144,7 +144,7 @@ Metal::StateTracker::Map Metal::StateTracker::AllocateForTextureUpload(size_t am
CPUBuffer& buffer = m_texture_upload_buffer;
u64 last_draw = m_last_finished_draw.load(std::memory_order_acquire);
bool needs_new = buffer.usage.PrepareForAllocation(last_draw, amt);
if (__builtin_expect(needs_new, false))
if (needs_new) [[unlikely]]
{
// Orphan buffer
size_t newsize = std::max<size_t>(buffer.usage.Size() * 2, 4096);
@ -187,7 +187,7 @@ std::pair<void*, size_t> Metal::StateTracker::Preallocate(UploadBuffer buffer_id
}
buffer.last_upload = 0;
}
if (__builtin_expect(needs_new, false))
if (needs_new) [[unlikely]]
{
// Orphan buffer
size_t newsize = std::max<size_t>(buffer.usage.Size() * 2, 4096);