mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-23 04:55:22 +00:00
vk: Sync main pipe with async jobs if any
This commit is contained in:
parent
d2993474fb
commit
41f5158247
3 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
#include "stdafx.h"
|
||||
#include "../Common/BufferUtils.h"
|
||||
#include "../rsx_methods.h"
|
||||
|
||||
#include "VKAsyncScheduler.h"
|
||||
#include "VKGSRender.h"
|
||||
#include "vkutils/buffer_object.h"
|
||||
|
||||
|
@ -960,6 +962,12 @@ void VKGSRender::end()
|
|||
load_program_env();
|
||||
m_frame_stats.setup_time += m_profiler.duration();
|
||||
|
||||
// Sync any async scheduler tasks
|
||||
if (auto ev = g_fxo->get<vk::async_scheduler_thread>()->get_primary_sync_label())
|
||||
{
|
||||
ev->gpu_wait(*m_current_command_buffer);
|
||||
}
|
||||
|
||||
if (!m_shader_interpreter.is_interpreter(m_program)) [[likely]]
|
||||
{
|
||||
bind_texture_env();
|
||||
|
|
|
@ -122,6 +122,12 @@ namespace vk
|
|||
vkSetEvent(m_device, m_vk_event);
|
||||
}
|
||||
|
||||
void event::gpu_wait(const command_buffer& cmd) const
|
||||
{
|
||||
ensure(m_vk_event);
|
||||
vkCmdWaitEvents(cmd, 1, &m_vk_event, 0, 0, 0, nullptr, 0, nullptr, 0, nullptr);
|
||||
}
|
||||
|
||||
void event::reset() const
|
||||
{
|
||||
if (m_vk_event) [[likely]]
|
||||
|
|
|
@ -46,6 +46,7 @@ namespace vk
|
|||
|
||||
void signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access);
|
||||
void host_signal() const;
|
||||
void gpu_wait(const command_buffer& cmd) const;
|
||||
VkResult status() const;
|
||||
void reset() const;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue