1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00
Files
egui/crates
Lucas Meurer 211d19090a Leave a hosted viewport's texture uploads to the viewport hosting it
A pass ends by taking the `Context`'s texture uploads for the backend to apply.
That is wrong for a hosted viewport: the application paints it, and paints the
viewport hosting it, so the uploads were taken by code that has no way to give
them back. `TextureManager::set` and `free` both assert on ids the pass had
already finished with, and a freed texture cannot be re-queued at all, since
`free` decrements a retain count that has already reached zero.

Leaving them in place means the hosting viewport's pass takes them, as it would
have without the hosted viewport, and its backend applies them as usual.

Immediate viewports keep taking theirs, because they are painted during the
nested pass and their painter needs the uploads by then.

`TextureManager::pending_delta` lets an application that paints part way through
a frame apply what is pending without taking it. Applying an upload twice is
harmless; the second time re-uploads the same data.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 22:48:52 +02:00
..
2026-07-20 11:07:29 +02:00