Fixed blur leaking its textures on every resolution change - #6626
Open
dekrom wants to merge 1 commit into
Open
Conversation
crosby-moe
approved these changes
Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
Blur#createFbowraps a fresh texture in a view and only keeps the view:The
ResolutionChangedEventlistener closes that view and builds a new one, but closing a viewdoes not free the texture behind it.
GlTextureView#closecallsGlTexture#removeViews, whichonly destroys when
closedis already true, and the only thing that setsclosedisGlTexture#close. Nothing else holds the texture, so the GL name is orphaned with no way to getit back.
Six mips at roughly 1.33x the framebuffer means about 11 MB of VRAM per event at 1080p and 20 MB
at 1440p.
Minecraft#resizeGuifires the event on every step of a window drag, and the listeneris subscribed from the constructor whether or not Blur is enabled, so a couple of seconds of
resizing the window throws away a few hundred MB for every user, Blur on or off.
Grabbing the texture off the view before closing it and closing that too is enough. Order
matters: the view has to go first so the reference count is already 0 when the texture is
closed, otherwise
destroyImmediatelydoes not run.Related issues
None that I found.
How Has This Been Tested?
Not measured with a VRAM monitor yet. The leak is visible in
GlTexture:removeViews()onlydestroys when
closedis already set, and nothing callsGlTexture#closehere. Builds cleanagainst current master.
Checklist: