Repository navigation
CreateCommandSignature refuses the descriptions the host refuses - #1886
Conversation
…h the host Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ2Pr9JZJaj81r4m2MtQZk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ2Pr9JZJaj81r4m2MtQZk
|
Tested 54e2fee on NVIDIA GeForce RTX 3070 Ti (driver 617.42) and AMD Radeon Graphics, Ryzen 7 7800X3D iGPU (driver 32.0.21045.29003), Windows 11 build 26300, MSVC 19.44, Ninja, RelWithDebInfo: pass.
Synthetic inputs only. AI-assisted. |
|
Reviewed and tested 54e2fee, merged into AI-assisted (Claude), on behalf of dev-ewann. Runs
Mutations of the new
Extra cases I compared with the host. These were local only, added to These agree with the host:
These differ, ours
So the host takes an index buffer view only once and only before a draw indexed, and a vertex buffer slot only once and below |
Serrambi
left a comment
There was a problem hiding this comment.
Reviewed 54e2fee2 and tested on NVIDIA GeForce RTX 5070 Ti (driver 610.88, Windows 11 Pro, MSVC 19.50.35719.0, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0): tests pass, with one small overflow fix suggested before merge.
Code review (runtime/shims/d3d12_vulkan_device.cpp, runtime/test/d3d12_vulkan_device_test.cpp)
- Validation logic (node mask, known argument types, draw/dispatch count and final position, root-signature requirement for non-IA arguments, multiple-of-4 stride,
ByteStride >= size, andE_UNEXPECTEDwhenout == nullptr) cleanly matches all 22 newcompare_invalid_argumentshost comparisons ind3d12_vulkan_device_test.cpp. - Minor overflow bug (
CreateCommandSignature):UINT size = 0and4 * arg.Constant.Num32BitValuesToSetaccumulate in 32-bit unsigned arithmetic, so a largeNum32BitValuesToSet(for example0x40000000u) or sum of arguments can wrap around2^32and slip pastdesc->ByteStride < size. UsingUINT64 size = 0;andUINT64{4} * arg.Constant.Num32BitValuesToSetprevents wrapping. - Out-of-scope host cases (not added in this PR, worth keeping in mind for follow-up): passing a non-null
root_signaturewhen there are no root arguments,VertexBuffer.Slotbounds, and matching root arguments against the supplied root signature.
Checks on 54e2fee2
d3d12_vulkan_device_test.exe(default andLEONIDA_VK_VALIDATION=1): passed (EXIT_DEV=0,EXIT_DEV_VAL=0, 0 Vulkan validation errors, host comparisons matched)d3d12_indirect_zero_test.exe: passed (EXIT_INDZ=0)d3d12_indirect_rt_test.exe: passed (EXIT_INDRT=0)ctest --test-dir runtime/build --output-on-failure -j 4:102/103passed (only pre-existingd3d12_drawbundle blend pixel failure from its base; 7 skipped/disabled)
|
Tested
AI-assisted (Claude Code). |
0xTehuti
left a comment
There was a problem hiding this comment.
Tested 54e2fee on NVIDIA GeForce RTX 2070 SUPER (driver 595.79), Windows 11 24H2, MSVC 19.44 (VS 2022 Community), Ninja RelWithDebInfo: pass
- Build: Clean compile and link with MSVC and Ninja.
- Runtime verification:
d3d12_vulkan_device_test.exepasses cleanly on RTX 2070 SUPER (0.85s), validating the 22CreateCommandSignaturerefusal cases against host D3D12 behavior (node mask, unknown arguments, draw/dispatch positioning, root signature presence, and alignment). - Standards: Clean-room implementation, no game files.
No game data used or added. AI-assisted.
A large Num32BitValuesToSet could wrap the 32-bit total and pass the ByteStride check (review on ItsNotRexed#1886). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ2Pr9JZJaj81r4m2MtQZk
|
Thanks all for testing. @Serrambi: done in e9f315f, the argument sizes now add up in 64 bits (UINT64 size, UINT64{4} * Num32BitValuesToSet). Rebuilt on RTX 4070 / 621.14: d3d12_vulkan_device, d3d12_indirect_zero, d3d12_indirect_rt pass, no new warnings. |
Claimed in the coordination issue as: new D3D item, CreateCommandSignature refusals (#1745)
What and why
ID3D12Device::CreateCommandSignatureonly refused stride 0, no arguments and null pointers. It accepted descriptions that the PC runtime refuses, and when an argument came after a draw or dispatch the last one silently won. This change checks the description before it creates the object, and every new check was measured against the host runtime:NodeMaskwith any bit other than node 0 set:E_INVALIDARGE_INVALIDARGE_INVALIDARGE_INVALIDARGByteStridenot a multiple of 4, or smaller than the arguments' total size:E_INVALIDARGE_UNEXPECTED, as the host returns (this wasE_POINTER)Which argument kinds are supported is unchanged (D3D-17). A valid signature whose last argument is not draw, draw indexed or dispatch still returns
E_NOTIMPL.compare_invalid_argumentsind3d12_vulkan_device_testgets 22command signature:cases (no root signature). A null description is not compared because it faults in the host runtime (0xC0000005), the same as the existing nullD3D12_HEAP_PROPERTIEScase.Tested
S_OKorE_NOTIMPLin ours, and null output wasE_POINTERin ours where the host returnsE_UNEXPECTED.d3d12_vulkan_device_testwithLEONIDA_D3D49_VERBOSE=1matches the host on all 22 cases and has 0 mismatches overall.ctest -R "d3d12_vulkan_device|d3d12_indirect": 3/3 passed (d3d12_vulkan_device,d3d12_indirect_zero,d3d12_indirect_rt).LEONIDA_VULKAN_HEADERS_FETCH=ON. No new warnings.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (n/a, no translator change)