Repository navigation
Runtime: suspend conditional rendering around WriteBufferImmediate - #1337
Conversation
|
I checked a GPU consumer of the immediate writes at
The low dword stayed zero throughout. The Vulkan test used a resource-relative write into a slice of the backing buffer and read the predicate at physical offset 160. No blue pixels or validation errors. WARP reported direct-list immediate-write support but suppressed the writes under this false predicate, consistent with the PR's WARP observation. Windows 11 26200, NVIDIA 616.92, AMD 26.10.1. |
|
Tested
NVIDIA never dropped these writes, so this run shows the change is safe there, not the Intel fix itself. Your negative control on UHD Graphics covers that. Code read: the suspend and resume follow the same pattern AI-assisted (Claude Code). |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51, llvm-mc 23.1.6): pass. |
|
Tested 8e50a77 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass (no regression against main).
The |
|
Tested 8e50a77 on Windows 11 (native, MSVC 17.14, Vulkan SDK 1.4.363), NVIDIA RTX 3070 Ti Laptop (621.14): pass
Code read: the suspend/resume is balanced, only when |
|
Tested 8e50a77 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Tested Your verification was GCC 16.2 only, so this adds a second toolchain: the branch builds clean with the repo's own What I ran:
On AMD the Intel-driver suppression you describe does not occur (as your table predicts), so Part F here is a no-regression check on a third vendor rather than a reproduction. CI on this branch shows "not run"; nothing local is blocking it. Synthetic inputs only, no game files. AI-assisted. |
Fixes silent suppression of
WriteBufferImmediate(vkCmdUpdateBuffer) under an activeSetPredicationon Intel Windows Vulkan drivers (claimed in #1218 (comment); sibling to #1321 / D3D-148, touching non-overlapping lines).Measured D3D12 vs Vulkan behavior
Synthetic Windows 11 D3D12 probe (
SetPredicationset to false viaEQUAL_ZEROwith predicate word0; no game files):WriteBufferImmediate(DEFAULT/MARKER_IN/MARKER_OUT)AtomicCopyBufferUINT101.7092)621.24)621.24)unpredicated_copies)101.7092)0xcdcdcdcd)On hardware D3D12 (matching Microsoft's
SetPredicationdocumentation, which omitsWriteBufferImmediatefrom the predicated-operations list),WriteBufferImmediateis unconditional. On Intel's Windows Vulkan driver,vkCmdUpdateBufferinside an activevkCmdBeginConditionalRenderingEXTscope followingPredicateReducer::capture's compute dispatch is suppressed, causing all three write modes to be silently dropped.AtomicCopyBufferUINTis predicated on all three native D3D12 drivers and is intentionally left untouched here.Fix
vk.update_bufferin theWriteImmediatebranch ofemit()(runtime/src/vulkan_replay.h) wheneverpredicate.bufferis non-null, and resume it immediately afterward.vk_command_replay_testPart F (whenVK_EXT_conditional_renderingis available) to execute all threeWriteBufferImmediatemodes under a false predicate, followed by a predicated render-target clear verifying conditional rendering resumes properly.replay_write_immediate_predication_test(registered inruntime/CMakeLists.txt) verifying suspend/resume ordering and balance for predicated and unpredicated writes.Verification
Built with GCC 16.2 (
-std=c++20) + KhronosVulkan-Headerson Windows 11. Synthetic tests only; no game files.main(c0ac5fd):vk_command_replay_testPart F on Intel(R) UHD Graphics (101.7092): FAIL (F buffer a +16: got 0xcdcdcdcd, want 0x66666666;+20and+24also0xcdcdcdcd).replay_write_immediate_predication_test(CPU): FAIL (all threeupdate_buffercalls emitted while conditional rendering active).replay_write_immediate_predication_test,command_list_test,replay_clear_gate_test,replay_uav_clear_offset_test,predicated_copy_test— all PASS.101.7092):vk_command_replay_test,vk_predicate_capture_test,vk_predicated_copy_test— all PASS.621.24): same 3 GPU tests — all PASS.AI-assisted.