Repository navigation
d3d12: refuse command signatures with arguments before the draw (D3D-INDIRECT-STATE-REFUSE) - #1737
potatoe0100 wants to merge 1 commit into
Conversation
…INDIRECT-STATE-REFUSE) A CommandSignature keeps only its kind and stride, and ExecuteIndirect reads the draw or dispatch arguments at the start of each record. A valid signature that puts root constants, root views or vertex/index buffer views first was accepted, so its draws read those bytes as their counts. Until per-command state is replayed, CreateCommandSignature answers E_NOTIMPL for a signature with more than one argument and logs it once per first argument type. Invalid descriptions are still E_INVALIDARG. One-argument signatures, which are all the title creates at startup, are unchanged. d3d12_execute_indirect_validation checks eight such shapes are refused with no object, that the invalid neighbours stay E_INVALIDARG, and that a one-argument signature with a root signature is still created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room & Technical Verification
- Mergeability: 3-way merge against upstream
main(bcaa13dad) is 100% clean with zero merge conflicts. - Clean-Room Compliance: 100% clean-room. D3D12 command signature validation logic and synthetic layer tests only; zero retail files, game data, or keys (
check_no_game_data.pyclean). - Technical Correctness & Behavioral Parity:
CreateCommandSignaturecurrently preserves only kind and stride, andExecuteIndirectconsumes draw/dispatch arguments at offset 0 of each record.- Signatures with leading state arguments (
VERTEX_BUFFER_VIEW,INDEX_BUFFER_VIEW,CONSTANT,CBV,SRV,UAV) were previously accepted, causing indirect draws to misinterpret state arguments as vertex/instance counts. - Refusing multi-argument command signatures with
E_NOTIMPLand rate-limited logging (log_once) maintains strict conformance until per-command state replay lands (docs/d3d12_vulkan.md §4.7), while preserving standardE_INVALIDARGvalidation on malformed inputs and leaving single-argument startup signatures intact. - Verified across 8 distinct argument shapes in
runtime/test/d3d12_execute_indirect_validation_test.cpp.
LGTM! Approved.
|
Independent verification of head Windows 11 Pro, RTX 4070 SUPER (NVIDIA 621.01), MSVC 19.52.37029, RelWithDebInfo. Result: not ready. This confirms the finding fiestorra posted in #1608 (comment):
No game files used. AI-assisted (Claude Code). |
|
A measurement your guard needs: with it, the replay PR's six tests fail; narrowed to dispatch, they pass I built the runtime on Windows (MSVC 14.44.35207, CMake + Ninja, Vulkan SDK 1.4.363.0, RTX 4090) and ran the tests against a merge of
The middle row fails with your guard's own line:
The narrowing that keeps your guard where it still has work to do is to refuse only the dispatch shapes, which have no replay behind them: if (desc->NumArgumentDescs > 1) {
const D3D12_INDIRECT_ARGUMENT_TYPE last = desc->pArgumentDescs[desc->NumArgumentDescs - 1].Type;
if (last != D3D12_INDIRECT_ARGUMENT_TYPE_DRAW && last != D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED) {
log_once("CreateCommandSignature refused (not implemented): arguments before a dispatch, "
"first argument type", int(desc->pArgumentDescs[0].Type));
return E_NOTIMPL;
}
}That changes The build is reproducible: Written with an AI assistant. |
|
The complete matrix for the shapes your guard refuses, and what the replay does with each Same machine as above (MSVC 14.44.35207, Vulkan SDK 1.4.363.0, RTX 4090), four trees from
And the point that decides it: the replay decodes every one of the six graphics shapes — Execution, with #1937's own test file in every tree (its file, not
Full What is still untested, so nobody reads more into this than it says: Written with an AI assistant. |
Claimed in the coordination issue as: D3D-INDIRECT-STATE-REFUSE
Depends on: none. #1620 (INDIRECT-STATE-ARGS) touches the same function; whichever lands second drops the VERTEX/INDEX_BUFFER_VIEW part of this refusal once those arguments are replayed.
What and why
On
main,CreateCommandSignatureaccepts a valid signature that puts arguments before its draw or dispatch (root constants, root CBV/SRV/UAV, vertex and index buffer views). But theCommandSignatureobject keeps only its kind and stride, andExecuteIndirectreads the draw arguments at the start of each record. So[VERTEX_BUFFER_VIEW, DRAW]or[CONSTANT, DRAW]was accepted and then drew with the state argument's bytes as its vertex and instance counts, with no message.Until per-command state is replayed (section 4.7 of
docs/d3d12_vulkan.md),CreateCommandSignaturenow answersE_NOTIMPLfor a signature with more than one argument, and logs it once per first argument type, the way other unimplemented features are refused. Invalid descriptions are stillE_INVALIDARGas on the host, since the checks run first. One-argument signatures are unchanged, and the title's five startup signatures (section 4.9) each have one argument.runtime/shims/d3d12_vulkan_device.cpp: the refusal.runtime/test/d3d12_execute_indirect_validation_test.cpp: a layer-only check that eight such shapes (VBV+draw, IBV+draw indexed, constant+draw, constant+dispatch, CBV+draw, SRV+draw indexed, UAV+dispatch, VBV+constant+draw) are refused with no object, that their invalid neighbours (no root signature, short stride) stayE_INVALIDARG, and that a one-argument signature with a root signature is still created.docs/d3d12_vulkan.mdsection 4.7: says so.Tested
Built with VS 2022 Build Tools (MSVC 19.44), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo, on
main57ba40bd6. No game files.ctest -R ^d3d12_execute_indirect_validation$withLEONIDA_VK_VALIDATION=1: passes (state-argument signatures: 8 shapes refused with E_NOTIMPL; 51 parity cases against live WARP and the RTX 4060, 0 validation errors). With only the shim change reverted, it fails at the first shape:hr=0x00000000, object created.ctest -j 6: 384 of 384 passed, 13 skipped (game-data and optional tests).GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro build 26300
AI-assisted: yes (Claude Code). Posted by a non-developer tester.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: D3D12 layer, no translator change)🤖 Generated with Claude Code