From ce4f19a03496b7e23cf98ad9d50f7bc43ed365d8 Mon Sep 17 00:00:00 2001 From: Dario Date: Wed, 22 May 2024 12:23:47 -0300 Subject: [PATCH] Switch vectors in each render pass to use TLS. --- servers/rendering/rendering_device.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 15e1731823f3..149b151ee6c2 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -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 &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 clear_values; - LocalVector resource_trackers; - LocalVector resource_usages; + thread_local LocalVector clear_values; + thread_local LocalVector resource_trackers; + thread_local LocalVector resource_usages; bool uses_color = false; bool uses_depth = false; + clear_values.clear(); clear_values.resize(p_framebuffer->texture_ids.size()); + resource_trackers.clear(); + resource_usages.clear(); int clear_values_count = 0; { int color_index = 0;