Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deallocate internal resources for post effects #4398

Merged
merged 4 commits into from
Jul 4, 2022

Conversation

GSterbrant
Copy link
Contributor

Description

Moves the deallocation of the internal render targets for bloom and SSAO to its own function such that we can deallocate said buffers when we disable the effects.

this.targets[i].destroyTextureBuffers();
this.targets[i].destroy();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after the loop also do this.targets.length = 0; to avoid dangling pointers to destroyed objects.
which is a faster alternative of this.targets = [];

this.target.destroy();
this.target = null;

this.blurTarget.destroyTextureBuffers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe do a separate if (this.blurTarget) here?

Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving with two small comments

Name render targets and buffers.
Add check for blur target in SSAO.
@GSterbrant GSterbrant merged commit 55ca49c into main Jul 4, 2022
@GSterbrant GSterbrant deleted the gsterbrant_posteffect_cleanup branch July 4, 2022 13:57
@GSterbrant GSterbrant self-assigned this Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants