bonsaiviewer: show the pool's capacity in the VRAM readout, budget alongside

The readout showed used over budget, which reads as impossible once the
pool legitimately sits a sub-buffer above a lowered budget (releasing
it would undershoot). Show used/capacity, and the budget only when it
differs from capacity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-08-23 19:46:57 +10:00
parent 777b728205
commit d755ca3a59
+9 -5
View File
@@ -566,11 +566,15 @@ void MainWindow::setupLoader() {
.arg(stats.total_triangles)
.arg(stats.gl_draw_calls)
.arg(double(stats.vram_used_bytes) * mb, 0, 'f', 0)
// Used against what the cache may grow to; the pool's
// momentary capacity only until the budget is known.
.arg(double(stats.vram_budget_bytes > 0
? stats.vram_budget_bytes
: stats.vram_capacity_bytes) * mb, 0, 'f', 0);
.arg(double(stats.vram_capacity_bytes) * mb, 0, 'f', 0);
// The budget is where the pool may grow to; the pool can also sit
// a sub-buffer above it (a release would undershoot). Show it
// only when it tells the user something capacity does not.
if (stats.vram_budget_bytes > 0
&& stats.vram_budget_bytes != stats.vram_capacity_bytes) {
text += QString(" (budget %1)")
.arg(double(stats.vram_budget_bytes) * mb, 0, 'f', 0);
}
// Device total is only known when a driver backend answered.
if (stats.device_vram_total_bytes > 0) {
text += QString(" | Device %1/%2 MB")