Add a new HashSet template

* Intended to replace RBSet in most cases.
* Optimized for iteration speed
This commit is contained in:
reduz 2022-05-19 17:00:06 +02:00
parent 410893ad0f
commit 45af29da80
243 changed files with 1400 additions and 662 deletions

View file

@ -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

View file

@ -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;

View file

@ -141,7 +141,7 @@ struct Mesh {
List<MeshInstance *> instances;
RID shadow_mesh;
RBSet<Mesh *> shadow_owners;
HashSet<Mesh *> shadow_owners;
RendererStorage::Dependency dependency;
};

View file

@ -224,7 +224,7 @@ struct Particles {
ParticleEmissionBuffer *emission_buffer = nullptr;
RID emission_storage_buffer;
RBSet<RID> collisions;
HashSet<RID> collisions;
RendererStorage::Dependency dependency;

View file

@ -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;