Skip to content

Commit

Permalink
Fix _free_render_buffer_data freeing shared half_texture and half_fb
Browse files Browse the repository at this point in the history
  • Loading branch information
SaracenOne committed Feb 10, 2022
1 parent 79077e6 commit 71eb3f6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,11 +1818,14 @@ void RendererSceneRenderRD::_free_render_buffer_data(RenderBuffers *rb) {
if (rb->blur[i].mipmaps[m].fb.is_valid()) {
RD::get_singleton()->free(rb->blur[i].mipmaps[m].fb);
}
if (rb->blur[i].mipmaps[m].half_fb.is_valid()) {
RD::get_singleton()->free(rb->blur[i].mipmaps[m].half_fb);
}
if (rb->blur[i].mipmaps[m].half_texture.is_valid()) {
RD::get_singleton()->free(rb->blur[i].mipmaps[m].half_texture);
// texture and framebuffer in both blur mipmaps are shared, so only free from the first one
if (i == 0) {
if (rb->blur[i].mipmaps[m].half_fb.is_valid()) {
RD::get_singleton()->free(rb->blur[i].mipmaps[m].half_fb);
}
if (rb->blur[i].mipmaps[m].half_texture.is_valid()) {
RD::get_singleton()->free(rb->blur[i].mipmaps[m].half_texture);
}
}
}
rb->blur[i].mipmaps.clear();
Expand Down

0 comments on commit 71eb3f6

Please sign in to comment.