diff options
author | reduz <reduzio@gmail.com> | 2022-05-19 17:00:06 +0200 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-05-20 22:40:38 +0200 |
commit | 45af29da8095af16729955117a165d23e77cd740 (patch) | |
tree | 0436c59187702466a73d05caf9688a58e5935afd /servers/rendering/renderer_rd | |
parent | 410893ad0fb6f0d7d774b6529581d886defd6cf0 (diff) |
Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
Diffstat (limited to 'servers/rendering/renderer_rd')
7 files changed, 8 insertions, 8 deletions
diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h index c22b2f243d..a4eb0656b7 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h @@ -239,7 +239,7 @@ public: ShaderData *overdraw_material_shader_ptr = nullptr; Vector<RD::PipelineSpecializationConstant> default_specialization_constants; - RBSet<uint32_t> valid_color_pass_pipelines; + HashSet<uint32_t> valid_color_pass_pipelines; SceneShaderForwardClustered(); ~SceneShaderForwardClustered(); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h index 4daee17525..a384f216cd 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -387,7 +387,7 @@ private: Rect2 directional_rect; - RBSet<RID> shadow_atlases; //shadow atlases where this light is registered + HashSet<RID> shadow_atlases; //shadow atlases where this light is registered ForwardID forward_id = -1; diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp index 93f1f4e0d9..de9913be3f 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp @@ -2267,7 +2267,7 @@ void MaterialStorage::shader_free(RID p_rid) { //make material unreference this while (shader->owners.size()) { - material_set_shader(shader->owners.front()->get()->self, RID()); + material_set_shader((*shader->owners.begin())->self, RID()); } //clear data if exists diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.h b/servers/rendering/renderer_rd/storage_rd/material_storage.h index 7d4db49f78..f83df05355 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.h @@ -77,7 +77,7 @@ struct Shader { String code; ShaderType type; HashMap<StringName, HashMap<int, RID>> default_texture_parameter; - RBSet<Material *> owners; + HashSet<Material *> owners; }; /* Material structs */ @@ -137,7 +137,7 @@ struct GlobalVariables { BUFFER_DIRTY_REGION_SIZE = 1024 }; struct Variable { - RBSet<RID> texture_materials; // materials using this + HashSet<RID> texture_materials; // materials using this RS::GlobalVariableType type; Variant value; diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index d90bb2f128..7ce019cf98 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -141,7 +141,7 @@ struct Mesh { List<MeshInstance *> instances; RID shadow_mesh; - RBSet<Mesh *> shadow_owners; + HashSet<Mesh *> shadow_owners; RendererStorage::Dependency dependency; }; diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.h b/servers/rendering/renderer_rd/storage_rd/particles_storage.h index eb55db19fb..115633d17a 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.h @@ -224,7 +224,7 @@ struct Particles { ParticleEmissionBuffer *emission_buffer = nullptr; RID emission_storage_buffer; - RBSet<RID> collisions; + HashSet<RID> collisions; RendererStorage::Dependency dependency; diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.h b/servers/rendering/renderer_rd/storage_rd/texture_storage.h index 029816cbda..418eb82808 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.h @@ -124,7 +124,7 @@ public: RID proxy_to; Vector<RID> proxies; - RBSet<RID> lightmap_users; + HashSet<RID> lightmap_users; RS::TextureDetectCallback detect_3d_callback = nullptr; void *detect_3d_callback_ud = nullptr; |