-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
this.targets[i].destroyTextureBuffers(); | ||
this.targets[i].destroy(); | ||
} | ||
} |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
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.