rpcsx/rpcs3/Emu/RSX/VK/VKCommandStream.cpp
kd-11 a51395370e vk: Implement multithreaded command submission
- A few nagging issues remain, specifically that partial command stream
  largely caused by poor synchronization structures for partial CS flush
  and also the fact that occlusion map entries wait on a command buffer
  and not an EID!
2019-12-29 13:49:46 +03:00

37 lines
754 B
C++

#include "stdafx.h"
#include "VKCommandStream.h"
namespace vk
{
// global submit guard to prevent race condition on queue submit
shared_mutex g_submit_mutex;
void acquire_global_submit_lock()
{
g_submit_mutex.lock();
}
void release_global_submit_lock()
{
g_submit_mutex.unlock();
}
void queue_submit(VkQueue queue, const VkSubmitInfo* info, fence* pfence, VkBool32 flush)
{
if (!flush && g_cfg.video.multithreaded_rsx)
{
auto packet = new submit_packet(queue, pfence, info);
rsx::g_dma_manager.backend_ctrl(rctrl_queue_submit, packet);
}
else
{
acquire_global_submit_lock();
vkQueueSubmit(queue, 1, info, pfence->handle);
release_global_submit_lock();
// Signal fence
pfence->flushed = true;
}
}
}