fix #424: a zero-area viewport skips the frame before any GPU work (alt-tab out of exclusive fullscreen crashed the pack-on client)

GLFW auto-iconifies an exclusive-fullscreen window on focus loss; for one
frame the window size reads 0x0 while the swapchain is still created, so
GameWindow.OnRender's PrepareFrame guard let a zero-area RenderFrameInput
through. The retail path tolerated it silently; the render-pack controller
correctly rejects a zero activation extent, which surfaced the latent frame
as an unhandled ArgumentOutOfRangeException during the owner's VM6/VM3 gate.

RenderFrameOrchestrator.Render now returns RenderFrameOutcome.ZeroArea
before BeginFrame when either dimension is <= 0 (no GPU frame, phase,
measurement, diagnostics or recovery runs) and GameWindow skips
NoteFrameClosed for it. Test: ZeroAreaViewport_SkipsTheFrameBeforeAnyGpuWork.

Verify: App hermetic lane 6,059/0 (Release).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-23 09:49:56 +02:00
parent b017391b98
commit 38def07edb
4 changed files with 84 additions and 3 deletions

View file

@ -1748,6 +1748,7 @@ public sealed class GameWindow :
_renderLoopArmed = false;
return;
}
AcDream.App.Rendering.RenderFrameOutcome outcome;
try
{
_frameGraphs.Render(
@ -1755,7 +1756,7 @@ public sealed class GameWindow :
deltaSeconds,
size.X,
size.Y),
out _);
out outcome);
}
catch (AcDream.App.Rendering.Gpu.Vk.VulkanSwapchainOutOfDateException)
when (_vulkanGraphics is not null)
@ -1765,7 +1766,11 @@ public sealed class GameWindow :
return;
}
_vulkanGraphics?.NoteFrameClosed();
// A zero-area frame (window iconified between the swapchain check
// above and the size read — see RenderFrameOutcome.SkippedZeroArea)
// opened no GPU frame, so there is no present outcome to note.
if (!outcome.SkippedZeroArea)
_vulkanGraphics?.NoteFrameClosed();
_renderLoopArmed = false;
}