Repository navigation
fix(vulkan): synchronize physical constant-buffer reads - #1322
Conversation
A root CBV supplies a device address and shaders load through a physical storage buffer. Transfer writes must be visible to that access in both legacy and enhanced buffer transitions.
|
Windows CI passed the changed d3d12_state_map test. Its only failing test was d3d12_predicated_copy, also the sole failure on unmodified main c0ac5fd. #1314 addresses device unavailability in that test and its Windows job passes. This run · main baseline |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. |
|
Tested 36c11f8 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass (no regression against main).
The |
|
Tested 36c11f8 on Windows 11 (native, MSVC 17.14, Vulkan SDK 1.4.363), NVIDIA RTX 3070 Ti Laptop (621.14): pass
Code read: adding |
Claimed in the coordination issue as physical constant-buffer reads.
What and why
A root CBV can supply a device address. The source-built M1 fragment shader in #291 loads its tint through a
PhysicalStorageBufferpointer. The existing constant-buffer transition makes writes visible to uniform reads, which leaves the physical storage load outside its destination access scope. LegacyVERTEX_AND_CONSTANT_BUFFERnow also covers shader reads. EnhancedCONSTANT_BUFFERadds the narrower storage-read bit and retains the requested shader stage. Vulkan access definitionsTested
The new legacy assertion failed on
c0ac5fd6. With only the legacy change, the enhanced assertion still failed. Both passed after the fix withctest --test-dir build-review/runtime -R d3d12_state_map --no-tests=error --output-on-failure.For an end-to-end check, I used a local integration of the source-built M1 candidate and
c0ac5fd6. Two GPU copies wrote 12-byte tints at offsets 0 and 256 in a DEFAULT buffer. I ran both the legacy transition and a list7 COPY/COPY_DEST to PIXEL_SHADING/CONSTANT_BUFFER barrier, then drew using the two root CBVs. An API dump captured both actual destination masks on RTX 5080:0x0c0x2c0x80x200000008Both revisions matched all 4,096 pixels for each barrier on RTX 5080 (616.92) and integrated Radeon (26.10.1), Windows 11 build 26200. Swapping only the GPU copy sources exchanged red and green in two 32×32 quadrants, and both revisions matched the swapped reference on both GPUs. The regression is visible in the captured masks and CPU assertions. Neither driver returned stale pixels in this experiment.
vk_command_replay_testpassed on both adapters with Khronos synchronization validation, including its 360 sync/access pairs.AI-assisted contribution.
Checklist
docs/design.md, with how it was confirmed. (Not applicable to this runtime change.)