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 /drivers/gles3/storage | |
parent | 410893ad0fb6f0d7d774b6529581d886defd6cf0 (diff) |
Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
Diffstat (limited to 'drivers/gles3/storage')
-rw-r--r-- | drivers/gles3/storage/config.h | 4 | ||||
-rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 2 | ||||
-rw-r--r-- | drivers/gles3/storage/material_storage.h | 4 | ||||
-rw-r--r-- | drivers/gles3/storage/mesh_storage.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gles3/storage/config.h b/drivers/gles3/storage/config.h index 975508b555..c93c030498 100644 --- a/drivers/gles3/storage/config.h +++ b/drivers/gles3/storage/config.h @@ -34,7 +34,7 @@ #ifdef GLES3_ENABLED #include "core/string/ustring.h" -#include "core/templates/rb_set.h" +#include "core/templates/hash_set.h" // This must come first to avoid windows.h mess #include "platform_config.h" @@ -65,7 +65,7 @@ public: // TODO implement wireframe in OpenGL // bool generate_wireframes; - RBSet<String> extensions; + HashSet<String> extensions; bool float_texture_supported = false; bool s3tc_supported = false; diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 7b18376a2a..ca62b0ca1f 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -2381,7 +2381,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/drivers/gles3/storage/material_storage.h b/drivers/gles3/storage/material_storage.h index 6a11a10d76..053dbacc05 100644 --- a/drivers/gles3/storage/material_storage.h +++ b/drivers/gles3/storage/material_storage.h @@ -89,7 +89,7 @@ struct Shader { String code; RS::ShaderMode mode; HashMap<StringName, HashMap<int, RID>> default_texture_parameter; - RBSet<Material *> owners; + HashSet<Material *> owners; }; /* Material structs */ @@ -384,7 +384,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/drivers/gles3/storage/mesh_storage.h b/drivers/gles3/storage/mesh_storage.h index 856463d45e..991777842f 100644 --- a/drivers/gles3/storage/mesh_storage.h +++ b/drivers/gles3/storage/mesh_storage.h @@ -123,7 +123,7 @@ struct Mesh { List<MeshInstance *> instances; RID shadow_mesh; - RBSet<Mesh *> shadow_owners; + HashSet<Mesh *> shadow_owners; RendererStorage::Dependency dependency; }; |