rsx: Improve MTRSX synchronization

- Properly synchronize DMA transfers when handling RSX pipeline
barriers. Texture read barrier is used to signify completion of DMA
routines and is often used to signal that Cell can overwrite vertex
data!
This commit is contained in:
kd-11 2020-01-02 18:02:26 +03:00 committed by kd-11
parent 02ca8f0002
commit 7786681954
2 changed files with 5 additions and 0 deletions

View File

@ -2876,6 +2876,8 @@ void VKGSRender::close_and_submit_command_buffer(vk::fence* pFence, VkSemaphore
// NOTE: There is no need to wait for dma sync. When MTRSX is enabled, the commands are submitted in order anyway due to CSMT
if (vk::test_status_interrupt(vk::heap_dirty))
{
rsx::g_dma_manager.sync();
if (m_attrib_ring_info.dirty() ||
m_fragment_env_ring_info.dirty() ||
m_vertex_env_ring_info.dirty() ||

View File

@ -203,6 +203,8 @@ namespace rsx
void texture_read_semaphore_release(thread* rsx, u32 _reg, u32 arg)
{
// Pipeline barrier seems to be equivalent to a SHADER_READ stage barrier
rsx::g_dma_manager.sync();
// lle-gcm likes to inject system reserved semaphores, presumably for system/vsh usage
// Avoid calling render to avoid any havoc(flickering) they may cause from invalid flush/write
const u32 offset = method_registers.semaphore_offset_4097() & -16;
@ -217,6 +219,7 @@ namespace rsx
void back_end_write_semaphore_release(thread* rsx, u32 _reg, u32 arg)
{
// Full pipeline barrier
rsx::g_dma_manager.sync();
rsx->sync();
const u32 offset = method_registers.semaphore_offset_4097() & -16;