diff --git a/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp index 51a3e59979..07abb4f8f9 100644 --- a/rpcs3/Emu/RSX/RSXFIFO.cpp +++ b/rpcs3/Emu/RSX/RSXFIFO.cpp @@ -603,7 +603,7 @@ namespace rsx { m_internal_get = m_ctrl->get; read_ahead(m_fifo_info, m_queue, m_internal_get); - optimize(m_fifo_info, m_queue); + //optimize(m_fifo_info, m_queue); m_ctrl->get = m_internal_get; m_ctrl_tag++; @@ -854,6 +854,7 @@ namespace rsx if (command.value) { last_begin = &command; + command.reg = FIFO_DRAW_BARRIER; } else { diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 79289567ca..6f6ab7e0e5 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -1248,6 +1248,14 @@ namespace rsx { void draw_barrier(thread* rsx, u32, u32) { + if (rsx->in_begin_end) + { + if (!method_registers.current_draw_clause.is_disjoint_primitive) + { + // Enable primitive barrier request + method_registers.current_draw_clause.primitive_barrier_enable = true; + } + } } } @@ -2762,7 +2770,7 @@ namespace rsx bind(); // FIFO - bind(); + bind<(FIFO::FIFO_DRAW_BARRIER >> 2), fifo::draw_barrier>(); return true; }(); diff --git a/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h index f7f75502fd..26c6310ab1 100644 --- a/rpcs3/Emu/RSX/rsx_methods.h +++ b/rpcs3/Emu/RSX/rsx_methods.h @@ -115,8 +115,9 @@ namespace rsx primitive_type primitive; draw_command command; - bool is_immediate_draw; - bool is_disjoint_primitive; + bool is_immediate_draw; // Set if part of the draw is submitted via push registers + bool is_disjoint_primitive; // Set if primitive type does not rely on adjacency information + bool primitive_barrier_enable; // Set once to signal that a primitive restart barrier can be inserted simple_array inline_vertex_array; @@ -158,6 +159,9 @@ namespace rsx void append(u32 first, u32 count) { + const bool barrier_enable_flag = primitive_barrier_enable; + primitive_barrier_enable = false; + if (!draw_command_ranges.empty()) { auto& last = draw_command_ranges.back(); @@ -172,7 +176,7 @@ namespace rsx if (last.first + last.count == first) { - if (!is_disjoint_primitive) + if (!is_disjoint_primitive && barrier_enable_flag) { // Insert barrier insert_command_barrier(primitive_restart_barrier, 0); @@ -260,6 +264,7 @@ namespace rsx command = draw_command::none; primitive = type; + primitive_barrier_enable = false; draw_command_ranges.clear(); draw_command_barriers.clear();