mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
vk: Optimization - avoid touching the mutex at all if possible even when there is no contention
This commit is contained in:
parent
c9e8b87c60
commit
589ac1c5d4
@ -118,10 +118,9 @@ namespace vk
|
||||
|
||||
event* AsyncTaskScheduler::get_primary_sync_label()
|
||||
{
|
||||
std::lock_guard lock(m_submit_mutex);
|
||||
|
||||
if (m_sync_required)
|
||||
if (m_sync_required) [[unlikely]]
|
||||
{
|
||||
std::lock_guard lock(m_submit_mutex); // For some reason this is inexplicably expensive. WTF!
|
||||
ensure(m_current_cb);
|
||||
insert_sync_event();
|
||||
m_sync_required = false;
|
||||
@ -132,13 +131,12 @@ namespace vk
|
||||
|
||||
void AsyncTaskScheduler::flush(VkSemaphore wait_semaphore, VkPipelineStageFlags wait_dst_stage_mask)
|
||||
{
|
||||
std::lock_guard lock(m_submit_mutex);
|
||||
|
||||
if (!m_current_cb)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard lock(m_submit_mutex);
|
||||
if (m_sync_required)
|
||||
{
|
||||
insert_sync_event();
|
||||
|
@ -29,7 +29,7 @@ namespace vk
|
||||
|
||||
// Sync
|
||||
event* m_sync_label = nullptr;
|
||||
bool m_sync_required = false;
|
||||
atomic_t<bool> m_sync_required = false;
|
||||
|
||||
static constexpr u32 events_pool_size = 16384;
|
||||
std::vector<xqueue_event> m_events_pool;
|
||||
|
Loading…
x
Reference in New Issue
Block a user