From 3c43d8fe05e13224315e5e63629d8582553da31b Mon Sep 17 00:00:00 2001 From: kd-11 Date: Thu, 3 Sep 2020 20:56:10 +0300 Subject: [PATCH] rsx: Fix execution barrier insertion - In case of element re-arrangement, the barrier should obey the current insertion pointer --- rpcs3/Emu/RSX/rsx_methods.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h index 4a045a7393..d0d8716daa 100644 --- a/rpcs3/Emu/RSX/rsx_methods.h +++ b/rpcs3/Emu/RSX/rsx_methods.h @@ -148,20 +148,18 @@ namespace rsx if (type == primitive_restart_barrier) { // Rasterization flow barrier - const auto& last = draw_command_ranges.back(); + const auto& last = draw_command_ranges[current_range_index]; const auto address = last.first + last.count; - const auto command_index = draw_command_ranges.size() - 1; - _do_barrier_insert({ command_index, 0, address, arg, 0, type }); + _do_barrier_insert({ current_range_index, 0, address, arg, 0, type }); } else { // Execution dependency barrier append_draw_command({}); - const auto command_index = draw_command_ranges.size() - 1; - _do_barrier_insert({ command_index, get_system_time(), ~0u, arg, 0, type }); - last_execution_barrier_index = command_index; + _do_barrier_insert({ current_range_index, get_system_time(), ~0u, arg, 0, type }); + last_execution_barrier_index = current_range_index; } }