diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 135b7c31b0..dfb0418627 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -188,6 +188,7 @@ void GLGSRender::end() if (skip_frame || !framebuffer_status_valid || (conditional_render_enabled && conditional_render_test_failed)) { + execute_nop_draw(); rsx::thread::end(); return; } @@ -386,6 +387,7 @@ void GLGSRender::end() { // Program is not ready, skip drawing this std::this_thread::yield(); + execute_nop_draw(); rsx::thread::end(); return; } @@ -482,6 +484,14 @@ void GLGSRender::end() m_vertex_layout = analyse_inputs_interleaved(); if (!m_vertex_layout.validate()) { + // Execute remainining pipeline barriers with NOP draw + do + { + rsx::method_registers.current_draw_clause.execute_pipeline_dependencies(); + } + while (rsx::method_registers.current_draw_clause.next()); + + rsx::method_registers.current_draw_clause.end(); break; } } @@ -623,8 +633,6 @@ void GLGSRender::end() } } while (rsx::method_registers.current_draw_clause.next()); - rsx::method_registers.current_draw_clause.post_execute_cleanup(); - m_rtts.on_write(); m_attrib_ring_buffer->notify(); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index af60eb96ee..a02dedb14d 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -469,6 +469,8 @@ namespace rsx in_begin_end = false; m_draw_calls++; + method_registers.current_draw_clause.post_execute_cleanup(); + m_graphics_state |= rsx::pipeline_state::framebuffer_reads_dirty; ROP_sync_timestamp = get_system_time(); @@ -492,6 +494,16 @@ namespace rsx } } + void thread::execute_nop_draw() + { + method_registers.current_draw_clause.begin(); + do + { + method_registers.current_draw_clause.execute_pipeline_dependencies(); + } + while (method_registers.current_draw_clause.next()); + } + void thread::operator()() { try diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index a34833fcd7..db70157154 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -544,6 +544,7 @@ namespace rsx public: virtual void begin(); virtual void end(); + virtual void execute_nop_draw(); virtual void on_init_rsx() = 0; virtual void on_init_thread() = 0; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 196317df65..232fe89636 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1179,6 +1179,13 @@ void VKGSRender::emit_geometry(u32 sub_index) if (!m_vertex_layout.validate()) { // No vertex inputs enabled + // Execute remainining pipeline barriers with NOP draw + do + { + draw_call.execute_pipeline_dependencies(); + } + while (draw_call.next()); + draw_call.end(); return; } @@ -1316,6 +1323,7 @@ void VKGSRender::end() if (skip_frame || !framebuffer_status_valid || renderer_unavailable || (conditional_render_enabled && conditional_render_test_failed)) { + execute_nop_draw(); rsx::thread::end(); return; } @@ -1556,6 +1564,7 @@ void VKGSRender::end() { // Program is not ready, skip drawing this std::this_thread::yield(); + execute_nop_draw(); rsx::thread::end(); return; } @@ -1682,8 +1691,6 @@ void VKGSRender::end() } while (rsx::method_registers.current_draw_clause.next()); - rsx::method_registers.current_draw_clause.post_execute_cleanup(); - close_render_pass(); vk::leave_uninterruptible();