Repository navigation
Conversation
…MPUTE and COPY lists CheckFeatureSupport(OPTIONS3) answered WriteBufferImmediateSupportFlags NONE, although WriteBufferImmediate records on every list type and replays as vkCmdUpdateBuffer on any queue family since D3D-26 (ItsNotRexed#417). WARP answers DIRECT | BUNDLE | COMPUTE | COPY (0xF), and native D3D12 on an RTX 5070 Ti (driver 610.74) answers 0x7f, which adds the video list types. The layer now answers 0xF, a subset of both, so the same-adapter host comparison in d3d12_vulkan_device_test still holds. Its local invariant now expects that value. The new d3d12_write_immediate_queues test holds each advertised type to it: - a DIRECT, a COMPUTE and a COPY list, each on its own queue, write the three modes into a readback buffer; - a bundle executed by a DIRECT list does the same; - each of the three lists then copies a word and overwrites it with a MARKER_OUT write, which must land last; - the test prints which Vulkan families the COMPUTE and COPY queues lease from. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tupacfan04
left a comment
There was a problem hiding this comment.
The 0xF flag set matches the recording code and the test exercises all four list types, but COPY is advertised while a known ordering hole remains.
queue_stages_copy(runtime/src/vulkan_replay.h:1263-1265) hasTRANSFER/COPYbut noCLEAR.vulkan_sync()mapsD3D12_BARRIER_SYNC_COPYtoVK_PIPELINE_STAGE_2_COPY_BITonly (:216).restrict_to_queue()masks the stage to the queue's stages (:1270-1281), removing theCLEARstage.WriteImmediatereplays asvkCmdUpdateBufferin the CLEAR/transfer path (:3884-3900), with no barrier for DEFAULT.
A title that sees COPY in WriteBufferImmediateSupportFlags and uses a DEFAULT-mode WBI followed by an enhanced SYNC_COPY barrier gets no ordering — the PR body itself documents this. Either do not advertise COPY until queue_stages_copy includes CLEAR and the enhanced mapping is fixed, or fix it and add a COPY-list test with DEFAULT WBI, SYNC_COPY, and a readback. The new d3d12_write_immediate_queues_test uses MARKER_OUT and a legacy CopyBufferRegion, so it misses this.
Test gap: write_three() issues all three modes and landed() checks only the final values. The implementation could ignore modes, or swap MARKER_IN/MARKER_OUT, and every value check would pass; the copy-then-MARKER_OUT case is also weak because both are transfer commands. Add an earlier non-transfer op (dispatch/render write) followed by MARKER_IN/MARKER_OUT and a visibility check, or an invalid-mode/HRESULT test.
Clean: the 0xF subset, recording on every list type, type creation/execution, mode/value/copy/capability/Close checks, 77 skip and 30 s timeout; the current mode constants and replay barriers are correct. Synthetic only; no game files. AI-assisted (OpenCode).
|
Returned this to draft while we resolve the enhanced-barrier ordering concern. The existing tests establish write execution and the measured capability subset, but do not establish DEFAULT-mode WBI ordering through enhanced SYNC_COPY barriers. We are checking the exact #8187 dependency and the remaining queue-stage filtering against current ownership before proposing a change; we will not duplicate that author's implementation. We will also keep the marker-mode coverage claims limited to what the tests actually exercise. |
|
Tested
|
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (ac1da453) — code read
What changed: OPTIONS3.WriteBufferImmediateSupportFlags advertises DIRECT/BUNDLE/COMPUTE/COPY (matching the vkCmdUpdateBuffer replay path), with a new queue-type test.
Checked:
- Diff is a four-flag advertisement + focused CTest.
- Did not build/run the C++ test here.
Looks correct; no game files.
xundru
left a comment
There was a problem hiding this comment.
I ran the new test on a second NVIDIA generation with the Vulkan validation layer, which the description lists as not run. Setup: Windows 11 26200, RTX 3060 (Ampere), NVIDIA 610.88, Vulkan SDK 1.4.363.1, MSVC 19.44.35230, with ac1da45 applied on main e68c5c9 (applies cleanly).
d3d12_write_immediate_queues_test |
Result |
|---|---|
| plain | 18/18 PASS |
LEONIDA_VK_VALIDATION=1 |
18/18 PASS, no validation messages |
+ VK_KHRONOS_VALIDATION_VALIDATE_SYNC=1 |
18/18 PASS, no SYNC-HAZARD |
+ VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 |
18/18 PASS, only the layer's own settings warnings |
The queue families here match the 5070 Ti: graphics 0, compute 2, copy 1 (own queues).
d3d12_vulkan_device_test: the OPTIONS3 comparison passes with the new 0xF invariant. The run then stops at tiles == 1, exactly as it does on main (the existing #7125 / #8496 failure).
On the COPY ordering gap raised above: sync validation stays silent, but that doesn't rule the gap out. The test records no barriers at all, and its COPY ordering cases use MARKER_OUT, which carries its own barrier. So nothing here runs a DEFAULT-mode write followed by an enhanced SYNC_COPY barrier on a COPY list. A case for exactly that sequence, run under sync validation, would confirm or rule out the hole.
No game files. AI-assisted run.
…ers of each mode Review of ItsNotRexed#8457: a DEFAULT-mode WriteBufferImmediate followed by an enhanced SYNC_COPY barrier is not ordered. Replay records the write as vkCmdUpdateBuffer, which synchronization2 runs in the CLEAR stage, while SYNC_COPY maps to COPY only. ItsNotRexed#8187 adds CLEAR to that mapping, which orders the DIRECT and COMPUTE queues. The COPY queue's stage mask (queue_stages_copy) drops CLEAR again, so OPTIONS3 now answers DIRECT | BUNDLE | COMPUTE (0x7). Advertising COPY is deferred to a follow-up after that mask is fixed. 0x7 is a subset of the native answer on the same adapter (0x7f on an RTX 5070 Ti, driver 610.74) and of WARP's 0xF. The new replay_write_immediate_barriers_test (no GPU) mocks the barrier and update functions: - DEFAULT adds no barrier, MARKER_IN waits for every earlier command (ALL_COMMANDS -> TRANSFER, no access) and MARKER_OUT for them and their writes (MEMORY_WRITE -> TRANSFER_WRITE). This is what the written values cannot show: swapping the two marker modes fails it. - On the DIRECT queue (no mask) and under queue_stages_compute, a DEFAULT write, a SYNC_COPY buffer barrier and a copy record the update, then a barrier holding its CLEAR stage and transfer write, then the copy. This part fails until ItsNotRexed#8187 is merged. d3d12_write_immediate_queues_test expects 0x7 and still runs a COPY list's writes as replay coverage, without the cap. Its copy-then-MARKER_OUT checks are gone: both are transfer commands, so they showed no ordering. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in 85931f8. The advertised flags are now DIRECT|BUNDLE|COMPUTE (0x7), with Depends on: #8187. COPY is not advertised. The COPY-stage filtering/image-initialization guard has a separate bounded claim: #8504 (comment). The probe showed the enhanced SYNC_COPY gap on all three queue kinds on main. #8187 resolves DIRECT/COMPUTE; COPY still drops CLEAR. This PR remains draft and its ordering tests intentionally fail until #8187 lands. A CPU mocked-dispatch test now distinguishes DEFAULT, MARKER_IN and MARKER_OUT by their stage/access barriers, verifies the barrier precedes the update, and verifies DEFAULT update -> CLEAR-covering enhanced barrier -> copy on DIRECT/COMPUTE. It passes all 5 checks with #8187 at 1cb2e43. Swapping the marker modes fails their checks; moving the enhanced barrier after the copy also fails despite its correct CLEAR scope. Callbacks use the correct Vulkan function signatures. The GPU test is now value/replay coverage only. At 0x7 it passes 15/15 on RTX 5070 Ti / 610.74, including COPY execution without claiming that capability. No Vulkan validation layer or AMD/Intel run. Synthetic inputs only; AI-assisted. |
|
Tested
So no regression; this head should be rechecked together with #8187 for the ordering part. AI-assisted (Claude Code). |
|
Follow-up: same GPU and build,
So with #8187 the ordering part holds on RDNA4. AI-assisted (Claude Code). |
|
Tested on AMD Radeon RX 7700 XT (RDNA3), AMD Windows driver 32.0.32029.2010, Windows 11, MSVC 14.51 Release, at 85931f8:
The other failures in the full run are the same 5 as on AI-assisted (Claude Code). |
d3d12: advertise WriteBufferImmediate on DIRECT, BUNDLE and COMPUTE lists
Claimed in #8344 (#8344 (comment)).
Depends on: #8187.
replay_write_immediate_barriers_test's ordering part fails onmainuntil #8187 is merged. This is by design: that is the ordering this PR's capability bits rely on.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3)answeredWriteBufferImmediateSupportFlags = NONE. ButWriteBufferImmediaterecords on every list type, and replay runs it asvkCmdUpdateBuffer(#417). The layer now answersDIRECT | BUNDLE | COMPUTE(0x7).Why not COPY yet (review by @tupacfan04):
vkCmdUpdateBufferruns in the synchronization2 CLEAR stage.SYNC_COPYbarrier maps toCOPY_BITonly (vulkan_replay.h:216). So onmain, a DEFAULT-mode write followed by such a barrier is unordered on every queue type.queue_stages_copy,vulkan_replay.h:1263) has no CLEAR bit.restrict_to_queue(:1270) strips it again, so COPY stays unordered even with d3d12: SYNC_COPY waits for the CLEAR stage too, so WriteBufferImmediate is ordered (D3D-838) #8187.initialize()(:1493), which reads the same bit as "image clears allowed". That fix is a separate claim, and it does not touch the capability bits. Advertising COPY is deferred to a follow-up once it lands.Legacy barriers (
COPY_DEST→TRANSFER),SYNC_ALLand the MARKER modes' own barriers are ordered on every queue.Measured on the same adapter: native D3D12 answers 0x7f (RTX 5070 Ti, driver 610.74) and WARP answers 0xF. 0x7 is a subset of both, as the host check in
d3d12_vulkan_device_testrequires.Changes
runtime/shims/d3d12_vulkan_device.cpp: the OPTIONS3 answer, with the reason COPY is left out. TheBarycentricsSupportedline beside it is untouched.runtime/test/d3d12_vulkan_device_test.cpp: the local invariant expects 0x7.runtime/test/replay_write_immediate_barriers_test.cpp(no GPU). It mocksvkCmdPipelineBarrier/2andvkCmdUpdateBufferand checks:ALL_COMMANDS → TRANSFER, no access;ALL_COMMANDS/MEMORY_WRITE → TRANSFER/TRANSFER_WRITE;queue_stages_compute, a DEFAULT write, aSYNC_COPYbuffer barrier (COPY_DEST → COPY_SOURCE) and a copy must record, in that order, the update, then a barrier whose first scope holds CLEAR and the transfer write, then the copy. The COPY-queue case is left to the separate claim.runtime/test/d3d12_write_immediate_queues_test.cpp(GPU, skips with 77):Tested
Windows 11, MSVC 2022 Build Tools, Ninja
RelWithDebInfo.replay_write_immediate_barriers_test(CPU):main1cb2e4302The branch merges cleanly with d3d12: SYNC_COPY waits for the CLEAR stage too, so WriteBufferImmediate is ordered (D3D-838) #8187 and with current
main.GPU, NVIDIA GeForce RTX 5070 Ti, driver 610.74.
d3d12_write_immediate_queues_test: 15/15 pass, including the 0x7 capability check. Every write landed on DIRECT, COMPUTE, COPY and bundle-via-DIRECT. Families: graphics 0, compute 2, copy 1; per vulkaninfo, 1 is transfer-only.d3d12_vulkan_device_testat 0xF: "46 feature queries compared ... 0 mismatches" against native D3D12 on the same adapter. Its one failure (tiles == 1) is onmaintoo (d3d12_vulkan_device: check PC CreateReservedResource2 behind the Xbox proxy, not through slot 78 #7125). Not rerun for 0x7, which is a subset of 0xF.Not run:
Overlap
#8232 edits the same OPTIONS3 block and the same test line for
BarycentricsSupported. The conflict is textual only.AI-assisted (Claude Code): written with Claude Code and reviewed by a second agent. No game data, keys or online services were used.
🤖 Generated with Claude Code