Ver Fonte

free color and depth texture after check framebuffer complete failed

Qiqi Wu há 2 anos atrás
pai
commit
df740f6865
1 ficheiros alterados com 6 adições e 1 exclusões
  1. 6 1
      drivers/gles3/storage/texture_storage.cpp

+ 6 - 1
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;