Preview: render at most two frames on the GPU at once so video memory stays flat (#3028)

This commit is contained in:
MarekSpodBiedry committed 2026-11-04 09:40:15 +01:00
1 parent 58ca9c1c1b
commit 29619dfe67
3 files changed
+80 -5

No files matched your search

+3 -1
View File
@@ -362,7 +362,9 @@ as NaNs (a kernel that skips pixels fails the oracle) and validation errors pani
(`ui-egui::frames`); headless renders, the CLI (unless `--gpu`) and CI use the CPU. Outside
tests, device errors are logged rather than fatal. A viewer frame that runs out of video memory
(`Gpu::within_memory`) renders on the CPU, the uploaded layers and pooled textures are freed, and
the RAM preview keeps half as many GPU frames from then on. The same guard catches a frame's
the RAM preview keeps half as many GPU frames from then on. However many frame threads the viewer
runs, at most two of them render on the GPU at once and the rest wait their turn, so their working
textures don't add up to more video memory than the GPU has (#3028). The same guard catches a frame's
validation errors (an invalid texture, often left by a failed allocation): that frame renders on
the CPU and the kept textures are freed, but the compositor stays on and, with no allocation
failure before it, the RAM preview keeps its GPU frames (#1319). A frame whose render panics is