GFxPlayerTinyVulkan: skip HAL Prepare/RestoreAfterReset on resize#10
Open
Monstrofil wants to merge 1 commit into
Open
GFxPlayerTinyVulkan: skip HAL Prepare/RestoreAfterReset on resize#10Monstrofil wants to merge 1 commit into
Monstrofil wants to merge 1 commit into
Conversation
On NVIDIA drivers, calling pHAL->PrepareForReset() and pHAL->RestoreAfterReset() around a swapchain rebuild leaves the Vulkan HAL with stale internal state, so subsequent filled triangle draws are silently dropped. Only outline (line) draws survive — the SWF appears as wireframe over the clear color. AMD drivers tolerate the stale state and render correctly, which is why this went unnoticed on AMD. The HAL doesn't cache framebuffers internally — SetMainRenderTarget is called per frame anyway and picks up the new framebuffer naturally. So the cleanest fix is to skip the reset notify cycle entirely on a swapchain resize: just vkDeviceWaitIdle, recreate swapchain + depth + framebuffers, re-issue pMovie->SetViewport, and continue. Verified pixel-perfect against the existing visual-regression baseline (RMSE 0.09 vs Tests/VisualRegression/Reference/vulkan/Window_AS2/frame_0010.png). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On NVIDIA drivers, calling
pHAL->PrepareForReset()/pHAL->RestoreAfterReset()around a swapchain rebuild leaves the Vulkan HAL in a stale state that silently drops subsequent filled triangle draws — only outline (line) draws survive. AMD drivers tolerate the stale state; NVIDIA does not, so the bug only manifests on NVIDIA.Symptom on NVIDIA before the fix: SWF appears as wireframe outlines floating over the clear color (e.g. for
Window.swfyou get the rounded-rect window outline + the green REPEAT button, but the entire interior fill is missing).Fix
Skip the reset notify cycle entirely on a swapchain resize. Just
vkDeviceWaitIdle, recreate swapchain + depth + framebuffers, re-issuepMovie->SetViewport(...), continue. The HAL doesn''t cache framebuffers internally —SetMainRenderTargetis called per frame and picks up the new framebuffer naturally.Verification
Pixel-perfect against the existing visual-regression baseline:
Tested on NVIDIA RTX 3060, Vulkan SDK 1.4.341, Windows 11, MSVC 2022.
Note: the underlying bug almost certainly lives in
Render::Vulkan::HAL::RestoreAfterReset(the notify-handlers chain doesn''t restore something NVIDIA strictly requires), but pinning that down requires a RenderDoc capture across the reset boundary. This PR is the workaround that unblocks the sample on NVIDIA; a proper fix toRestoreAfterResetitself can land separately.Test plan
GFxPlayerTinyVulkan.exe Bin/Data/AS2/Samples/Window.swf— verify the rounded-rect window frame fills properly (not just outlines), and the green REPEAT button is solid🤖 Generated with Claude Code