mirror of
https://github.com/open-goal/jak-project
synced 2026-08-05 01:30:22 -04:00
eddd6fb019
Found while investigating the jak2/jak3 one-frame sky flicker (see the fog CLUT inline payload PR: `#4343`). ## Problem `TextureAnimator::run_clouds` calls `glGenerateMipmap` on the final cloud texture while that texture is still attached to the currently bound draw framebuffer (the `FramebufferTexturePairContext` is 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_slime` and `opengl_upload_resize_texture` both close the FBO context scope before generating mipmaps. `run_clouds` is the one outlier, presumably an oversight. ## Fix Scope the `FramebufferTexturePairContext` in braces and generate the mipmaps after it restores the previous framebuffer binding, matching the established pattern in the rest of the file. ## Test plan - [ ] jak2/jak3 clouds render identically (hires and normal cloud modes) (AI-assisted)