Merge pull request #92258 from DarioSamo/render_list_pass_alloc
Reduce allocations each time a render pass begins in RenderingDevice.
This commit is contained in:
commit
abfe8ba7d6
|
@ -3332,12 +3332,15 @@ Error RenderingDevice::_draw_list_setup_framebuffer(Framebuffer *p_framebuffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
Error RenderingDevice::_draw_list_render_pass_begin(Framebuffer *p_framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i p_viewport_offset, Point2i p_viewport_size, RDD::FramebufferID p_framebuffer_driver_id, RDD::RenderPassID p_render_pass) {
|
Error RenderingDevice::_draw_list_render_pass_begin(Framebuffer *p_framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i p_viewport_offset, Point2i p_viewport_size, RDD::FramebufferID p_framebuffer_driver_id, RDD::RenderPassID p_render_pass) {
|
||||||
LocalVector<RDD::RenderPassClearValue> clear_values;
|
thread_local LocalVector<RDD::RenderPassClearValue> clear_values;
|
||||||
LocalVector<RDG::ResourceTracker *> resource_trackers;
|
thread_local LocalVector<RDG::ResourceTracker *> resource_trackers;
|
||||||
LocalVector<RDG::ResourceUsage> resource_usages;
|
thread_local LocalVector<RDG::ResourceUsage> resource_usages;
|
||||||
bool uses_color = false;
|
bool uses_color = false;
|
||||||
bool uses_depth = false;
|
bool uses_depth = false;
|
||||||
|
clear_values.clear();
|
||||||
clear_values.resize(p_framebuffer->texture_ids.size());
|
clear_values.resize(p_framebuffer->texture_ids.size());
|
||||||
|
resource_trackers.clear();
|
||||||
|
resource_usages.clear();
|
||||||
int clear_values_count = 0;
|
int clear_values_count = 0;
|
||||||
{
|
{
|
||||||
int color_index = 0;
|
int color_index = 0;
|
||||||
|
|
Loading…
Reference in New Issue