Skip to content

Commit f3f1a2b

Browse files
committed
rsx: Cache draw subranges storage
1 parent b2feff7 commit f3f1a2b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

rpcs3/Emu/RSX/NV47/FW/draw_call.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,16 @@ namespace rsx
138138
is_disjoint_primitive = is_primitive_disjointed(primitive);
139139
}
140140

141-
simple_array<draw_range_t> draw_clause::get_subranges() const
141+
const simple_array<draw_range_t>& draw_clause::get_subranges() const
142142
{
143143
ensure(!is_single_draw());
144144

145145
const auto range = get_range();
146146
const auto limit = range.first + range.count;
147147
const auto _pass_count = pass_count();
148148

149-
simple_array<draw_range_t> ret;
149+
auto &ret = subranges_store;
150+
ret.clear();
150151
ret.reserve(_pass_count);
151152

152153
u32 previous_barrier = range.first;

rpcs3/Emu/RSX/NV47/FW/draw_call.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ namespace rsx
3535
// Draw-time iterator to the draw_command_barriers struct
3636
mutable simple_array<barrier_t>::iterator current_barrier_it;
3737

38+
// Subranges memory cache
39+
mutable rsx::simple_array<draw_range_t> subranges_store;
40+
3841
// Helper functions
3942
// Add a new draw command
4043
void append_draw_command(const draw_range_t& range)
@@ -298,6 +301,6 @@ namespace rsx
298301
* Returns a compiled list of all subdraws.
299302
* NOTE: This is a non-trivial operation as it takes disjoint primitive boundaries into account.
300303
*/
301-
simple_array<draw_range_t> get_subranges() const;
304+
const simple_array<draw_range_t>& get_subranges() const;
302305
};
303306
}

0 commit comments

Comments
 (0)