fix(gfx): generate cloud mipmaps after unbinding the render FBO#4344
Open
semeaj wants to merge 1 commit into
Open
fix(gfx): generate cloud mipmaps after unbinding the render FBO#4344semeaj wants to merge 1 commit into
semeaj wants to merge 1 commit into
Conversation
run_clouds called glGenerateMipmap on the cloud texture while it was still attached to the currently bound draw framebuffer. Every other site in this file (run_slime, opengl_upload_resize_texture) closes the FramebufferTexturePairContext scope before generating mipmaps; make run_clouds match. Reading a texture that is attached to the bound framebuffer is a driver hazard even outside a draw. (AI-assisted)
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.
Found while investigating the jak2/jak3 one-frame sky flicker (see the fog CLUT inline payload PR:
#4343).Problem
TextureAnimator::run_cloudscallsglGenerateMipmapon the final cloud texture while that texture is still attached to the currently bound draw framebuffer (theFramebufferTexturePairContextis still in scope). Reading a texture that is attached to the bound framebuffer is a driver hazard even outside a draw call.Every other site in this file already avoids this:
run_slimeandopengl_upload_resize_textureboth close the FBO context scope before generating mipmaps.run_cloudsis the one outlier, presumably an oversight.Fix
Scope the
FramebufferTexturePairContextin braces and generate the mipmaps after it restores the previous framebuffer binding, matching the established pattern in the rest of the file.Test plan
(AI-assisted)