mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12: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 "stdafx.h"
|
||||||
#include "../Common/BufferUtils.h"
|
#include "../Common/BufferUtils.h"
|
||||||
#include "../rsx_methods.h"
|
#include "../rsx_methods.h"
|
||||||
|
|
||||||
|
#include "VKAsyncScheduler.h"
|
||||||
#include "VKGSRender.h"
|
#include "VKGSRender.h"
|
||||||
#include "vkutils/buffer_object.h"
|
#include "vkutils/buffer_object.h"
|
||||||
|
|
||||||
|
@ -960,6 +962,12 @@ void VKGSRender::end()
|
||||||
load_program_env();
|
load_program_env();
|
||||||
m_frame_stats.setup_time += m_profiler.duration();
|
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]]
|
if (!m_shader_interpreter.is_interpreter(m_program)) [[likely]]
|
||||||
{
|
{
|
||||||
bind_texture_env();
|
bind_texture_env();
|
||||||
|
|
|
@ -122,6 +122,12 @@ namespace vk
|
||||||
vkSetEvent(m_device, m_vk_event);
|
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
|
void event::reset() const
|
||||||
{
|
{
|
||||||
if (m_vk_event) [[likely]]
|
if (m_vk_event) [[likely]]
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace vk
|
||||||
|
|
||||||
void signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access);
|
void signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access);
|
||||||
void host_signal() const;
|
void host_signal() const;
|
||||||
|
void gpu_wait(const command_buffer& cmd) const;
|
||||||
VkResult status() const;
|
VkResult status() const;
|
||||||
void reset() const;
|
void reset() const;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue