OpenGL: Honor separate management of RT's backbuffer FBO and texture upon clear

This commit is contained in:
Pedro J. Estébanez 2024-04-18 11:16:13 +02:00
parent fc08eca524
commit 755c7494c2

View File

@ -2312,9 +2312,11 @@ void TextureStorage::_clear_render_target(RenderTarget *rt) {
if (rt->backbuffer_fbo != 0) {
glDeleteFramebuffers(1, &rt->backbuffer_fbo);
rt->backbuffer_fbo = 0;
}
if (rt->backbuffer != 0) {
GLES3::Utilities::get_singleton()->texture_free_data(rt->backbuffer);
rt->backbuffer = 0;
rt->backbuffer_fbo = 0;
}
if (rt->backbuffer_depth != 0) {
GLES3::Utilities::get_singleton()->texture_free_data(rt->backbuffer_depth);