summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage/texture_storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r--drivers/gles3/storage/texture_storage.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index f362a21d8c..59a483da39 100644
--- a/drivers/gles3/storage/texture_storage.cpp
+++ b/drivers/gles3/storage/texture_storage.cpp
@@ -1744,7 +1744,12 @@ void TextureStorage::_update_render_target(RenderTarget *rt) {
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
glDeleteFramebuffers(1, &rt->fbo);
- GLES3::Utilities::get_singleton()->texture_free_data(rt->color);
+ if (rt->overridden.color.is_null()) {
+ GLES3::Utilities::get_singleton()->texture_free_data(rt->color);
+ }
+ if (rt->overridden.depth.is_null()) {
+ GLES3::Utilities::get_singleton()->texture_free_data(rt->depth);
+ }
rt->fbo = 0;
rt->size.x = 0;
rt->size.y = 0;