Repository navigation
Conversation
…ad recording, 5120-SRV table, pipeline cache) Test d3d12_m5_world_test (D3D12 API only, translator-output shaders, every pixel against a CPU reference): (a) five ExecuteIndirect calls (DRAW and DRAW_INDEXED signatures, CPU- and GPU-written records at offsets in placed buffers, count buffer, count 0, count above MaxCommandCount), (b) four threads recording four lists run in one ExecuteCommandLists, eight rounds, (c) a descriptor table of 5120 SRVs of distinct textures read at a byte offset from a root constant, (d) a PSO created twice through the device's VkPipelineCache. Layer gaps fixed on the way: - ExecuteIndirect draws carry the list's graphics state and replay as whole draws; they used to replay as a bare vkCmdDraw*Indirect outside any render pass with no pipeline bound. - multiDrawIndirect, drawIndirectCount and drawIndirectFirstInstance are enabled on the layer's device where present (VulkanDeviceInfo::multi_draw_indirect / draw_indirect_count); without multiDrawIndirect each record is its own call. - One VkPipelineCache per device for every graphics and compute pipeline (was VK_NULL_HANDLE), with VkPipelineCreationFeedback hit counting (rt::d3d12::pipeline_cache_stats). Section 6 M5 row: synthetic part met except mesh shaders (D3D-29). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ature flags, test leniency - A draw-kind ExecuteIndirect with no graphics state is unsupported at prepare unless it is marked raw (ExecuteIndirect::raw, set by the unit tests that wrap the call in rendering themselves). - Calls take at most VkPhysicalDeviceLimits::maxDrawIndirectCount records (ReplayFunctions, VulkanDeviceInfo). - VulkanDeviceInfo::draw_indirect_first_instance is recorded; the layer logs once when it is absent. - VulkanDeviceInfo::draw_indirect_count defaults to false. - d3d12_m5_world_test: without drawIndirectCount the count-buffer calls are left out; pipeline-cache checks only run when the driver returns valid creation feedback, and size equality only when both sizes are known. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # runtime/src/vulkan_replay.h
The fixed-count loops added a full chunk to a 32-bit cursor, so a short final chunk could wrap it and restart at argument offset 0 (MaxCommandCount UINT32_MAX with maxDrawIndirectCount 0x80000000). Found by @Vonsek in review of ItsNotRexed#1865. d3d12_state_map now checks the calls (counts and offsets, not records) for both draw kinds with a huge count and for a limit that does not divide the count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wing without bound A cursor that wraps again now ends the loop with a failed check rather than appending until memory runs out. Checked by lowering the cap to 1: the check fails at the call. Suggested by @Vonsek in ProjectLeonida#1865. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/d3d12_vulkan.md # runtime/CMakeLists.txt # runtime/src/command_list.h # runtime/src/vulkan_replay.h # scripts/run_gpu_tests.py
…ce_generated_commands A command signature with root constants, root CBV/SRV/UAV, vertex or index buffer views per record now replays: one device-generated-commands token per argument at its record offset (push-constant tokens into the 144-byte user data block, vertex/index buffer tokens, DRAW/DRAW_INDEXED/DISPATCH), a compute pass that rebases buffer views by heap_base, a count buffer as the sequence count address. CreateCommandSignature lays the record out and refuses what D3D12 refuses (compared with the host runtime). d3d12_indirect_multiarg_test draws and dispatches against a CPU reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Patch pass copies exactly (n - 1) * stride + the arguments (the last record's tail need not exist) in a 2D grid; indirectAddressSize is that span on both paths. Layout cache is keyed on the record description, bounded to 64 and evicts only layouts no running submission uses. Preprocess buffers come from a pool per memory-type set and honour the required alignment. CreateCommandSignature refuses vertex/index buffers in a dispatch signature, a vertex slot twice, a second index buffer and an index buffer without DRAW_INDEXED (all checked against the host runtime). The test adds an exact-size argument buffer and says SKIPPED when there is no host runtime to compare with. Documents that views outside the arena cannot be detected on GPU-written records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed commands read it D3D12 runs min(count, MaxCommandCount), but the generated commands took the application's count word as the sequence count address with maxSequenceCount = MaxCommandCount, and VUID-VkGeneratedCommandsInfoEXT-sequenceCountAddress-11068 wants the value there to be at most maxSequenceCount. Every count-buffer plan (with views patched or read in place, draw or dispatch) now runs a one-invocation compute pass (indirect_count.comp) that writes min(count, MaxCommandCount) to scratch, barriered to the commands, and the layer passes that address. The dispatch path now runs the prepass too. The test's count 100 against MaxCommandCount 2 draws cells 13 and 14 and leaves cell 15 clear. Reported-by: Flyander (review of ItsNotRexed#2077) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # runtime/CMakeLists.txt # runtime/src/vulkan_backend.h # scripts/run_gpu_tests.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ultiarg # Conflicts: # runtime/shims/d3d12_vulkan_device.cpp
…mits, doc corrections - The test sets the list's root constants, vertex buffer and index buffer (graphics) and root constants and UAV (compute) before the calls and runs a plain DrawIndexedInstanced / Dispatch after them: each must use the list's state, not the last record's. The layer already re-pushes and rebinds everything with every command; the spec says the tokens leave that state undefined (vkCmdExecuteGeneratedCommandsEXT, Table 1), and the docs now cite it. - The limits a signature alone decides (token count, token offset, stride, DXGI index mode, view count) are checked in CreateCommandSignature (E_NOTIMPL with a log) and again at replay; replay refusals log their reason once. - The docs say what was measured for deviceGeneratedCommandsMultiDrawIndirectCount (false on the AMD Windows driver 26.11.2, true on NVIDIA 617.42) instead of claiming it for AMD, describe the bounded count, and cite vkd3d-proton (LGPL-2.1, approach only) for invalidating state after the generated commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/d3d12_vulkan.md # runtime/shims/d3d12_com.h # runtime/shims/d3d12_vulkan_device.cpp
…ultiarg # Conflicts: # runtime/shims/d3d12_vulkan_device.cpp
# Conflicts: # runtime/shims/d3d12_com.cpp # runtime/src/vulkan_backend.h
…main's translator subtracts BaseVertex/BaseInstance) After the round-41 merge the non-indexed records (P1) all drew cell 0: they chose their cell by StartVertexLocation, which the hardware-style zero-based v0 no longer carries. P1 now picks cells through the instance id (InstanceCount), indexed records still through the index values. The layer and the merge were fine; the test relied on an id semantic main changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ultiarg # Conflicts: # docs/d3d12_vulkan.md # runtime/src/vulkan_backend.h
# Conflicts: # docs/d3d12_vulkan.md # runtime/src/vulkan_replay.h
…ultiarg # Conflicts: # docs/d3d12_vulkan.md # runtime/src/vulkan_replay.h
…the PreparedDraw Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Built and ran at 48b50f51d on Windows 11, RTX 5070 Ti (configured with LEONIDA_LLVM_MC, so the translated shader fixtures built):
pytest tests/test_compute_fixture_shift.py tests/test_root_sig_contract.py -q-> 63 passed.d3d12_indirect_multiarg_test-> exit 0:15 cells drawn by 5 calls ... and 13 groups run by 2 dispatch calls ... matched the CPU reference (error 0);34 CreateCommandSignature cases agree with the host runtime.d3d12_m5_world_test-> exit 0:35 cells drawn by 5 ExecuteIndirect calls ... 5120 pixels each drawn from its own texture ... every pixel matched the CPU reference (error 0); the pipeline cache answered 1 of 1 duplicate PSO creations.d3d12_state_map_test-> exit 0 (state map, enhanced barriers, ... OK).git diff --checkclean.
The indirect path now applies the compute root-argument offsets per record (root constants and a root UAV per dispatch, with the count-buffer cases), which is what the two new GPU tests exercise end to end; the signature cases also match the host's answers. There is a new MSVC C4456 shadowing warning in d3d12_m5_world_test.cpp at line 418 (counts hides the earlier local) — harmless but worth renaming before the warning-clean branch lands. No functional blocking issue.
|
Tested AI-assisted (Claude Code). Synthetic data only, no game files. |
|
Synced this draft with current main |
|
Tested 54ccfd9 merged with main 28f8653 on Linux/Python 3.12.16: concern. The merge with main conflicts in runtime/shims/d3d12_com.cpp, runtime/src/command_list.h, runtime/src/vulkan_backend.h and runtime/src/vulkan_replay.h (one hunk each), so the branch needs a rebase before it can be built or run. No tests were run (the changed tests are native GPU C++ tests, not run on Linux). |
|
Independent native Windows test of
AI-assisted (Codex). Synthetic fixtures only. |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
Claimed in the coordination issue as: D3D-448, #4933 (comment 7094567788).
Dependency: #2077 remains draft and must be reconciled with current main before this PR can be unstacked. #4312 (
7c225260) has merged. This draft retains #2077's reviewed head (91ba3847) so the four-file ExecuteIndirect follow-up can be tested; once #2077 lands, I will reduce this to its single fix commit and rerun the focused tests.What and why
build_indirect_signatureused graphicsuser_offsetfor root arguments even when ExecuteIndirect ended withDISPATCH. With #4312's per-stage root layout, compute constants and root views can occupy different offsets. A synthetic pre-fix indirect dispatch left its output at zero where the CPU oracle expected0x0055aa01and subsequent values; direct dispatch passed.Select
compute_offset/compute_okforDISPATCH, keepuser_offset/graphics_okfor draw actions, and rejectkNoSgpror out-of-range offsets before narrowing. Add synthetic constant-subrange, CBV/SRV/UAV, graphics-versus-compute, overflow-sentinel, and native command-signature parity cases.Tested
Windows 11, NVIDIA RTX 5070, driver 621.01, validation enabled: focused CTest suite 5/5 (
root_signature,d3d12_indirect_multiarg,d3d12_m4_compute,d3d12_indirect_rt,d3d12_compute). Ind3d12_indirect_multiarg_test, 15 drawn cells and 13 dispatched groups matched the CPU oracle with error 0; 34CreateCommandSignaturecases agreed with native D3D12.tests/test_compute_fixture_shift.py: 8/8.git diff --check: clean.AI-assisted: yes.
Checklist