1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Optimize RenderForwardClustered::_setup_render_pass_uniform_set by reducing Vector allocations during push_back operations

This commit is contained in:
CrazyRoka
2024-07-14 22:13:57 +01:00
committed by Rémi Verschelde
parent 893bbdfde8
commit d9ef826c54
14 changed files with 53 additions and 36 deletions

View File

@@ -37,7 +37,8 @@ void UniformSetCacheRD::_bind_methods() {
}
RID UniformSetCacheRD::get_cache_array(RID p_shader, uint32_t p_set, const TypedArray<RDUniform> &p_uniforms) {
Vector<RD::Uniform> uniforms;
thread_local LocalVector<RD::Uniform> uniforms;
uniforms.clear();
for (int i = 0; i < p_uniforms.size(); i++) {
Ref<RDUniform> uniform = p_uniforms[i];