mirror of https://github.com/godotengine/godot
[GLES3] Avoid freeing proxy textures clearing onwer's data
This commit is contained in:
parent
7e67b496ff
commit
a67559931b
|
|
@ -713,18 +713,20 @@ void TextureStorage::texture_free(RID p_texture) {
|
||||||
memdelete(t->canvas_texture);
|
memdelete(t->canvas_texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t->tex_id != 0) {
|
bool must_free_data = false;
|
||||||
if (!t->is_external) {
|
if (t->is_proxy) {
|
||||||
GLES3::Utilities::get_singleton()->texture_free_data(t->tex_id);
|
if (t->proxy_to.is_valid()) {
|
||||||
|
Texture *proxy_to = texture_owner.get_or_null(t->proxy_to);
|
||||||
|
if (proxy_to) {
|
||||||
|
proxy_to->proxies.erase(p_texture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
t->tex_id = 0;
|
} else {
|
||||||
|
must_free_data = t->tex_id != 0 && !t->is_external;
|
||||||
}
|
}
|
||||||
|
if (must_free_data) {
|
||||||
if (t->is_proxy && t->proxy_to.is_valid()) {
|
GLES3::Utilities::get_singleton()->texture_free_data(t->tex_id);
|
||||||
Texture *proxy_to = texture_owner.get_or_null(t->proxy_to);
|
t->tex_id = 0;
|
||||||
if (proxy_to) {
|
|
||||||
proxy_to->proxies.erase(p_texture);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
texture_atlas_remove_texture(p_texture);
|
texture_atlas_remove_texture(p_texture);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue