Repository navigation
Runtime: CreateReservedResource takes ALLOW_CROSS_ADAPTER, as the host does (D3D-468) - #4496
emirduran707 wants to merge 4 commits into
Conversation
…t does (D3D-468) create_reserved checked the description with committed_resource_refusal, which refuses ALLOW_CROSS_ADAPTER (a committed resource needs a shared cross-adapter heap for it). The host creates a reserved buffer or texture with the flag wherever it creates the same description without it, and GetDesc reports it. The description is now checked and backed without the flag, and the resource keeps the application's flags for GetDesc. 19 cases in d3d12_vulkan_device_test's compare_placed_reserved, the same on an RX 9060 XT (AMD 26.10.44) and on WARP. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_vulkan_device_test at 5c6544ee on Windows 11, RTX 5070 Ti: exit 0; the reserved-resource cases and the full device suite pass, matching the host. CreateReservedResource now accepts ALLOW_CROSS_ADAPTER with the host's behavior. No blocking issue.
|
Tested 5c6544e on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and on AMD Radeon(TM) Graphics (driver 32.0.21043.5001), Windows 11, MSVC 14.51: pass for the reserved-resource checks. The build has no validation layers. I set Extra case: a buffer of 65,537 bytes with Negative control: the test object of this head, linked with the D3D12 libraries of the merge base I found no defect. AI-assisted. |
AGInformatique81
left a comment
There was a problem hiding this comment.
I ran the synthetic d3d12_vulkan_device CTest at 5c6544e on Windows 11 build 26300, with MSVC 19.52 and the 10.0.26100 Windows SDK, in RelWithDebInfo. Leonida used Vulkan on an NVIDIA GeForce RTX 2060 (driver 32.0.16.2124).
| Native D3D12 reference | PR revision | Parent implementation with the PR tests |
|---|---|---|
| RTX 2060 | CTest passed, 19/19 cross-adapter cases matched | CTest failed, 15/19 cross-adapter cases differed |
| WARP (Microsoft Basic Render Driver) | CTest passed, 19/19 cross-adapter cases matched | CTest failed, 15/19 cross-adapter cases differed |
Both GetDesc cases matched the native reference with the PR. For the control, I rebuilt with only runtime/shims/d3d12_vulkan_device.cpp sourced from parent 03b09a0 and kept the PR's test harness. The runs used synthetic inputs only. Codex assisted with the validation and this report.
Flyander
left a comment
There was a problem hiding this comment.
[P2] Preserve the simultaneous-access behavior implied by ALLOW_CROSS_ADAPTER. Microsoft documents that this flag also enables the features of ALLOW_SIMULTANEOUS_ACCESS (resource flags). This implementation strips ALLOW_CROSS_ADAPTER before creating the backing resource, then restores only the public GetDesc flags. Resource::create_image has already set binding.simultaneous_access from ALLOW_SIMULTANEOUS_ACCESS alone and registered that binding, so a reserved texture with ALLOW_CROSS_ADAPTER alone is still backed as exclusive and misses the GENERAL-layout path. Preserve that semantic in the Vulkan binding or reject the unsupported use, and add a concurrent-queue regression for CROSS_ADAPTER alone.
|
Tested
AI-assisted (Claude Code). |
|
Reading review (no Windows/D3D12 here), plus the API documentation and a cross-PR merge check.
Cannot run the Windows test. No game data. AI-assisted. |
|
AI-assisted Windows hardware verification for D3D-468 on AMD Radeon RX 6750 XT (
|
…access (D3D-468 review) D3D12_RESOURCE_FLAGS documents ALLOW_CROSS_ADAPTER as enabling the features of ALLOW_SIMULTANEOUS_ACCESS. create_reserved dropped the flag before backing the resource, so a reserved texture with it alone was backed as exclusive and its image did not stay in GENERAL. The backing texture now gets ALLOW_SIMULTANEOUS_ACCESS in its place, except a depth-stencil or multisampled one, where the runtime refuses simultaneous access. Buffers have no layouts. GetDesc still reports the application's flags. vulkan_simultaneous_access (for tests) reads the binding; d3d12_vulkan_device_test checks it for CROSS_ADAPTER alone, SIMULTANEOUS_ACCESS, a plain texture, a depth texture and a buffer. Also notes that the resource still cannot be shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Flyander, you're right: stripping the flag also dropped the simultaneous-access behaviour it enables. Fixed in af00d12.
On the concurrent-queue regression you asked for: I did not add one, and want to say so plainly. The check above shows that @mrbean56, thanks: the comment in Tested at af00d12 on the RX 9060 XT (AMD 26.10.44), Windows 11: |
|
Tested af00d12 merged with main d0835dd (merged tree 1d7ba28392) on Windows 11 with two GPUs (MSVC 14.51): built
Negative control (compile-only): with |
create_reserved now returns through d3d12_trace::result (main) and still passes the caller's flags to make_reserved (D3D-468). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested 826d4dd on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Verified 826d4dd merged with main 3faac55: the 911-commit count is stack noise — three own commits off a recent merge-base, merge clean, and main has not touched the file since. Static read matches the docs: ALLOW_CROSS_ADAPTER is stripped from the backing description, reported through GetDesc, and mapped to general-image backing for plain textures while refused for depth-stencil/multisampled — consistent with the named host measurements. Docs guards green; C++ needs the pending linux-gpu-tools and windows runs. Heads-up: docs/d3d12_vulkan.md is also edited by long-open #3634, different sections, low collision. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only review). |
Conflict in runtime/shims/d3d12_vulkan_device.cpp: main reworded the comment on Resource::make_reserved for sparse resources. Kept main's comment and this branch's flags parameter, which GetDesc reports. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Merged The conflict was in Tested on AMD Radeon RX 9060 XT, driver 26.10.44, Windows 11, MSVC (VS 2022), full build and
So the five are not from this PR. I have not looked into why they fail on AI-assisted (Claude Code). Synthetic tests only, no game files. |
|
Independent Windows check of 31e1bb11 on 561b65a8. Windows 11 x64 build 26300, RTX 3080 Ti / 621.35, MSVC 19.44.35230, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0. The focused device fixture matched native D3D12 on the RTX and WARP across 13 successful reserved-resource creations. Both A scratch extension of the sparse-buffer fixture set the same flag and mapped one tile. Direct, copy and compute queue runs each matched all 65,536 bytes. Vulkan core and synchronization validation reported zero errors, with no skips. The runtime was exact. The focused fixtures covered valid single-adapter cases and sparse buffer mapping. Synthetic inputs only. AI-assisted. |
|
Tested
No game files. AI-assisted. |
|
On the WARP run above (@speed-y, thanks for testing): I reproduced it and it is not from this PR. AMD Radeon RX 9060 XT, driver 26.10.44, Windows 11, MSVC (VS 2022),
So the "same on WARP" statement in the description holds, but only once #4698 is in; until then a WARP host cannot check it. The verbose output of this run also differs from what I described there in one way: I had not said that the WARP run needs #4698. AI-assisted (Claude Code). Synthetic test only, no game files. |
|
Tested
AI-assisted (Claude Code). |
|
Tested 31e1bb1 on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main 561b65a.
|
Claimed in the coordination issue as: D3D-468, #4421 (comment)
What and why
CreateReservedResourcerefused a description withD3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER(E_INVALIDARG), which the host creates (@gabsilvs's finding, 9 random reserved buffers).create_reservedchecks the description withcommitted_resource_refusal, whose flag masks leaveALLOW_CROSS_ADAPTERout: a committed resource only takes it on aSHARED | SHARED_CROSS_ADAPTERheap, which the layer doesn't have.GetDescreports it. A description it refuses anyway stays refused.create_reservedchecks and backs the resource without the flag, andmake_reservedkeeps the application's flags forGetDesc. A reserved resource has no heap to share and the layer has one adapter, so the flag changes nothing else.compare_placed_reserved(d3d12_vulkan_device_test), and a line indocs/d3d12_vulkan.md.The item names buffers. Textures go through the same check and the host answers them the same way, so they are in here too.
ALLOW_CROSS_ADAPTERCOPY_DEST, withALLOW_UNORDERED_ACCESS, withDENY_SHADER_RESOURCES_OKE_INVALIDARGS_OKALLOW_SIMULTANEOUS_ACCESS,ALLOW_DEPTH_STENCILor flag 0x200E_INVALIDARGE_INVALIDARGE_INVALIDARGALLOW_UNORDERED_ACCESS, withALLOW_SIMULTANEOUS_ACCESS, BC1, full mip chain, 4-layer array; 3D textureS_OKE_INVALIDARGS_OKROW_MAJORE_INVALIDARGE_INVALIDARGE_INVALIDARGGetDesc().Flagsof the buffer and of the textureTwo combinations are not in the test, because a host driver loses its device on them (
DXGI_ERROR_DEVICE_REMOVED, and every later case with it):ALLOW_CROSS_ADAPTER | ALLOW_RENDER_TARGET:S_OKon the AMD driver, device removed on WARP;D32_FLOATdepth texture withALLOW_CROSS_ADAPTER | ALLOW_DEPTH_STENCIL:S_OKon WARP, device removed on the AMD driver.The layer creates both. The test's comment says why they are left out.
Not in this PR:
GetResourceAllocationInfowith this flag (D3D-467), andCreatePlacedResource.@SHAURYASANYAL3, our claims for D3D-468 crossed two seconds apart (mine 01:37:33 UTC, yours 01:37:35), so this one is covered; D3D-467 and D3D-469 are untouched here.
Tested
Windows 11 Pro 10.0.26300, AMD Radeon RX 9060 XT (RDNA4), AMD driver 26.10.44 (Vulkan driver 2.0.395), MSVC 14.44 (VS 2022), Windows SDK 10.0.26100, base 03b09a0.
d3d12_vulkan_device_testwithLEONIDA_D3D49_VERBOSE=1: the 19 new cases match the host, and the test exits 0, with the default host (the AMD adapter) and withLEONIDA_HOST_ADAPTER=warp.d3d12_vulkan_device.cpp, the 15 cases the host accepts are mismatches (ours 0x80070057, host 0x00000000, or 0x00010010 for the twoGetDesccases) on both hosts.ctest(full build): 154 of 154 passed. Skipped as on main: the package-gated tests,vk_sync_validation,d3d12_first_light.git diff --checkclean.Not tested: NVIDIA or Intel hosts, and a Vulkan device without sparse buffers (there a reserved buffer is a fully backed committed resource; the flag is stripped before that path too).
No game files. AI-assisted (Claude Code): the measurement, the change and the tests were made and run with it on my machine.
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)🤖 Generated with Claude Code