1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

rsx: Fix disjoint draw range splitting

- Fixes flickering and missing draws in R&C and other games such as Motorstorm Apocalypse and Okami HD when strict mode is disabled
This commit is contained in:
kd-11 2018-02-08 21:44:34 +03:00
parent a64bea1286
commit a5500ebfa4
2 changed files with 9 additions and 7 deletions

View File

@ -444,24 +444,26 @@ namespace rsx
if (deferred_stack.size() > 0) if (deferred_stack.size() > 0)
{ {
//TODO: Verify this works correctly LOG_TRACE(RSX, "Disjoint draw range detected");
LOG_ERROR(RSX, "Disjoint draw range detected");
deferred_stack.push_back(num_draws - 1); //Append last pair deferred_stack.push_back(num_draws); //Append last pair
std::vector<std::pair<u32, u32>> temp_range = first_counts; std::vector<std::pair<u32, u32>> temp_range = first_counts;
auto current_command = rsx::method_registers.current_draw_clause.command;
u32 last_index = 0; u32 last_index = 0;
for (const u32 draw : deferred_stack) for (const u32 draw : deferred_stack)
{ {
first_counts.resize(draw - last_index);
std::copy(temp_range.begin() + last_index, temp_range.begin() + draw, first_counts.begin());
if (emit_begin) if (emit_begin)
methods[NV4097_SET_BEGIN_END](this, NV4097_SET_BEGIN_END, deferred_primitive_type); methods[NV4097_SET_BEGIN_END](this, NV4097_SET_BEGIN_END, deferred_primitive_type);
else else
emit_begin = true; emit_begin = true;
//NOTE: These values are reset if begin command is emitted
first_counts.resize(draw - last_index);
std::copy(temp_range.begin() + last_index, temp_range.begin() + draw, first_counts.begin());
rsx::method_registers.current_draw_clause.command = current_command;
methods[NV4097_SET_BEGIN_END](this, NV4097_SET_BEGIN_END, 0); methods[NV4097_SET_BEGIN_END](this, NV4097_SET_BEGIN_END, 0);
last_index = draw; last_index = draw;
} }

View File

@ -352,7 +352,7 @@ namespace rsx
{ {
rsx::method_registers.current_draw_clause.first_count_commands.resize(0); rsx::method_registers.current_draw_clause.first_count_commands.resize(0);
rsx::method_registers.current_draw_clause.command = draw_command::none; rsx::method_registers.current_draw_clause.command = draw_command::none;
rsx::method_registers.current_draw_clause.primitive = rsx::method_registers.primitive_mode(); rsx::method_registers.current_draw_clause.primitive = to_primitive_type(arg);
rsxthr->begin(); rsxthr->begin();
return; return;
} }