mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
vk: Improve flush queue sync between cell threads
This commit is contained in:
parent
786bcb0d1b
commit
ccb23d70a5
@ -664,9 +664,12 @@ bool VKGSRender::on_access_violation(u32 address, bool is_writing)
|
||||
//Just stall and get what we have at this point
|
||||
if (std::this_thread::get_id() != rsx_thread)
|
||||
{
|
||||
//TODO: Guard this when the renderer is flushing the command queue, might deadlock otherwise
|
||||
m_flush_commands = true;
|
||||
m_queued_threads++;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_flush_queue_mutex);
|
||||
|
||||
m_flush_commands = true;
|
||||
m_queued_threads++;
|
||||
}
|
||||
|
||||
//This is awful!
|
||||
while (m_flush_commands) _mm_pause();
|
||||
@ -1200,6 +1203,8 @@ void VKGSRender::do_local_task()
|
||||
{
|
||||
if (m_flush_commands)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_flush_queue_mutex);
|
||||
|
||||
//TODO: Determine if a hard sync is necessary
|
||||
//Pipeline barriers later may do a better job synchronizing than wholly stalling the pipeline
|
||||
flush_command_queue();
|
||||
|
@ -164,8 +164,9 @@ private:
|
||||
bool m_flush_draw_buffers = false;
|
||||
s32 m_last_flushable_cb = -1;
|
||||
|
||||
std::mutex m_flush_queue_mutex;
|
||||
std::atomic<bool> m_flush_commands = false;
|
||||
std::atomic<int> m_queued_threads = 0;
|
||||
std::atomic<int> m_queued_threads = { 0 };
|
||||
|
||||
std::thread::id rsx_thread;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user