Files
jak-project/game
Alexander J. Semenuk eddd6fb019 fix(gfx): generate cloud mipmaps after unbinding the render FBO (#4344)
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)
2026-07-19 14:59:17 -04:00
..
2026-04-03 20:40:14 +02:00
2026-04-20 03:19:08 +02:00
2025-04-12 15:59:13 -04:00