Fix issue with external textures being freed by Godot
This commit is contained in:
parent
f2ddafd860
commit
5fbc24f3e0
2 changed files with 4 additions and 0 deletions
|
@ -5264,6 +5264,7 @@ void RasterizerStorageGLES2::_render_target_clear(RenderTarget *rt) {
|
||||||
|
|
||||||
// clean up our texture
|
// clean up our texture
|
||||||
Texture *t = texture_owner.get(rt->external.texture);
|
Texture *t = texture_owner.get(rt->external.texture);
|
||||||
|
t->tex_id = 0;
|
||||||
t->alloc_height = 0;
|
t->alloc_height = 0;
|
||||||
t->alloc_width = 0;
|
t->alloc_width = 0;
|
||||||
t->width = 0;
|
t->width = 0;
|
||||||
|
@ -5428,6 +5429,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
|
||||||
|
|
||||||
// clean up our texture
|
// clean up our texture
|
||||||
Texture *t = texture_owner.get(rt->external.texture);
|
Texture *t = texture_owner.get(rt->external.texture);
|
||||||
|
t->tex_id = 0;
|
||||||
t->alloc_height = 0;
|
t->alloc_height = 0;
|
||||||
t->alloc_width = 0;
|
t->alloc_width = 0;
|
||||||
t->width = 0;
|
t->width = 0;
|
||||||
|
|
|
@ -6850,6 +6850,7 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
|
||||||
|
|
||||||
// clean up our texture
|
// clean up our texture
|
||||||
Texture *t = texture_owner.get(rt->external.texture);
|
Texture *t = texture_owner.get(rt->external.texture);
|
||||||
|
t->tex_id = 0;
|
||||||
t->alloc_height = 0;
|
t->alloc_height = 0;
|
||||||
t->alloc_width = 0;
|
t->alloc_width = 0;
|
||||||
t->width = 0;
|
t->width = 0;
|
||||||
|
@ -7359,6 +7360,7 @@ void RasterizerStorageGLES3::render_target_set_external_texture(RID p_render_tar
|
||||||
|
|
||||||
// clean up our texture
|
// clean up our texture
|
||||||
Texture *t = texture_owner.get(rt->external.texture);
|
Texture *t = texture_owner.get(rt->external.texture);
|
||||||
|
t->tex_id = 0;
|
||||||
t->alloc_height = 0;
|
t->alloc_height = 0;
|
||||||
t->alloc_width = 0;
|
t->alloc_width = 0;
|
||||||
t->width = 0;
|
t->width = 0;
|
||||||
|
|
Loading…
Reference in a new issue