rsx: Cache draw subranges storage

This commit is contained in:
kd-11 2025-04-23 03:17:39 +03:00
parent 5ca5b54bf6
commit 6a3e08383d
2 changed files with 7 additions and 3 deletions

View file

@ -138,7 +138,7 @@ namespace rsx
is_disjoint_primitive = is_primitive_disjointed(primitive);
}
simple_array<draw_range_t> draw_clause::get_subranges() const
const simple_array<draw_range_t>& draw_clause::get_subranges() const
{
ensure(!is_single_draw());
@ -146,7 +146,8 @@ namespace rsx
const auto limit = range.first + range.count;
const auto _pass_count = pass_count();
simple_array<draw_range_t> ret;
auto &ret = subranges_store;
ret.clear();
ret.reserve(_pass_count);
u32 previous_barrier = range.first;

View file

@ -35,6 +35,9 @@ namespace rsx
// Draw-time iterator to the draw_command_barriers struct
mutable simple_array<barrier_t>::iterator current_barrier_it;
// Subranges memory cache
mutable rsx::simple_array<draw_range_t> subranges_store;
// Helper functions
// Add a new draw command
void append_draw_command(const draw_range_t& range)
@ -298,6 +301,6 @@ namespace rsx
* Returns a compiled list of all subdraws.
* NOTE: This is a non-trivial operation as it takes disjoint primitive boundaries into account.
*/
simple_array<draw_range_t> get_subranges() const;
const simple_array<draw_range_t>& get_subranges() const;
};
}