Repository navigation
Runtime: CreateReservedResource takes ALLOW_CROSS_ADAPTER, as the host does (D3D-468) - #4496
emirduran707 wants to merge 911 commits into
Conversation
# Conflicts: # docs/animation.md
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
# Conflicts: # docs/character_skeleton.md
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
- replay_cpu_bench: ItsNotRexed#3693 moved a draw's render targets and vertex buffers into Draw::views (D3D-391); the bench builds a DrawViews block instead of writing the old inline arrays. - xgameruntime_user_test links file_system.cpp, which now defines rt::fs::game_dir that xgameruntime.cpp calls. - check_sparse_queue_family: a vkCreateInstance refused because the api_dump/validation layer is not installed is the documented "layer absent" skip (77), not a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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.
- test_bary_fallback: ItsNotRexed#3647 (BUILD-1046) made a missing input folder exit 2 with "does not exist"; the test from ItsNotRexed#1379 still expected exit 1. - test_format_decode_branch: the f16 reference uses the interpreter's pinned half_to_float (a NaN half widens to the canonical quiet NaN) instead of struct's '<e', whose NaN payload changed in Python 3.14 (CPython gh-130317). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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: |
Merges that each passed alone but clash together: - v_cmp_class_f64: the earlier cmp_class_f64 (685d16e) (operand-form checks, test_cmp_class_f64) and the later f64 branch in cmp_class both handled the opcode; f64 goes to cmp_class_f64 again, f16 stays in cmp_class. - rdna2spirv CLI tests: spirv-as/spirv-val now run in the output folder with the staging file's bare name, so the test doubles resolve it against cwd; assemble_spirv decodes the output only when it is bytes. (The doubles had been writing .spirv-*.tmp files into the repository root.) - ps_w64 fixtures (TEST-722): an 18th fixture (ps_w64_a_discard) landed; its killed lanes export nothing and keep the clear value. - first_light: a run without an OBJ removes mesh.bin, and harness_env reads manifest["files"]; batch_glb's stats name failures and dropped textures; run_gpu_tests reports a frame never written as a missing readback (TEST-837). - make_game TRANSLATION_SOURCES and runtime.yml's paths include spirv_opt.py and report_paths.py (and wave64_emulate_opt.py), which the translator imports. Repo rules: stdout guard on six tools; encoding on two opens (gen_gdk_runtime_classes' helper is read_utf8); newline on one write; anim_skeleton_match's joaat encodes like hashdict.joaat; test_feature_scan's new test is listed with the others its globals() runner reaches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/runtime_imports.md # runtime/CMakeLists.txt # runtime/shims/xgameruntime.cpp # runtime/test/xmem_test.cpp # tools/rdna2spirv.py
|
Tested af00d12 merged with main d0835dd (merged tree 1d7ba28392) on Windows 11 with two GPUs (MSVC 14.51): built
Negative control (compile-only): with |
- rdna2spirv: %fmt_size_tab (main's typed-load size table) registers its length and entry constants when a load
first uses it; created at assembly, %c128 came after the OpTypeArray naming it and spirv-val refused
buffer_store_format_d16 modules (test_u16_high_half).
- test_vs_packed_inputs matches main's wording of the same SHADER-644 rule ("mixed component types").
- test_mutations: the v_mul_legacy_f32 anchor follows the SHADER-340 flushes (it had stopped matching on main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ItsNotRexed#2887 added the fixture to the M2 build; with no entry in OTHER_HARNESS the GPU suite reported it as "no checker defined". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
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