mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12:00
vk: Add an alternate async queue scheduler
- This version violates spec but does not rely on CPU threads to keep the GPU from hanging. It's ironically much safer to use.
This commit is contained in:
parent
bd6c187fcd
commit
48d0f80a86
1 changed files with 16 additions and 2 deletions
|
@ -8,10 +8,15 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#define WITH_CPU_SCHEDULER 1
|
||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
void AsyncTaskScheduler::operator()()
|
void AsyncTaskScheduler::operator()()
|
||||||
{
|
{
|
||||||
|
#if WITH_CPU_SCHEDULER
|
||||||
|
thread_ctrl::set_native_priority(1);
|
||||||
|
|
||||||
add_ref();
|
add_ref();
|
||||||
|
|
||||||
while (thread_ctrl::state() != thread_state::aborting)
|
while (thread_ctrl::state() != thread_state::aborting)
|
||||||
|
@ -24,6 +29,7 @@ namespace vk
|
||||||
}
|
}
|
||||||
|
|
||||||
release();
|
release();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsyncTaskScheduler::delayed_init()
|
void AsyncTaskScheduler::delayed_init()
|
||||||
|
@ -61,8 +67,16 @@ namespace vk
|
||||||
|
|
||||||
sync_label->queue1_signal->signal(*m_current_cb, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0);
|
sync_label->queue1_signal->signal(*m_current_cb, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0);
|
||||||
|
|
||||||
m_event_queue.push(sync_label);
|
#if WITH_CPU_SCHEDULER
|
||||||
m_sync_label = sync_label->queue2_signal.get();
|
{
|
||||||
|
m_event_queue.push(sync_label);
|
||||||
|
m_sync_label = sync_label->queue2_signal.get();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
m_sync_label = sync_label->queue1_signal.get();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncTaskScheduler::~AsyncTaskScheduler()
|
AsyncTaskScheduler::~AsyncTaskScheduler()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue