D3D-3D-VIEW-ARRAY-RANGE: use the single array layer for Vulkan 3D views #1860
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1860
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1860/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lixonik on GitHub · 2026-11-25 13:21 UTC · original
lixonik:fix/title-3d-view-array-range→main· +35 −6 · 3 files · 1 commits · merged 2026-11-25 22:02 UTCClaimed in the coordination issue as: D3D-3D-VIEW-ARRAY-RANGE
What and why
A title-written GFX10 Texture3D descriptor can carry a nonzero
BASE_ARRAYin the same word as its depth. The runtime used that field as Vulkan'sbaseArrayLayer. Both the sampled and storage image view creation paths now use array layer zero and a count of one for a 3D view. Mips, aspects, 2D array layers and the original descriptor bytes used as the bindless key are preserved.In GFX10 SRV mode, hardware ignores the volume's
BASE_ARRAY. In raw UAV mode it is a W-slice offset. The raw descriptor path refuses that offset rather than binding a whole-mip storage view in its place. The API path continues to use Vulkan's sliced-view extension for partial D3D12 Texture3D UAVs.Runtime finding · Mesa's GFX10 descriptor builder · Vulkan image view valid usage
Tested
gfx10_descriptors_testdirectly with MSVC. The new assertions cover sampled 3D T#s with nonzeroBASE_ARRAY, recognition of a raw UAV W-slice offset, the mip range and 2D array layers. Restoring the old range mapping made the new 3D assertion fail.BASE_ARRAYtriggered the older layer's 01482 and 01483 VUIDs with the old range. The fixed range created the view with zero validation errors.python -I -B scripts/run_semantic_tests.py tests/semanticpassed 6,261 tests across 489 files.GPUs tested: n/a (software Vulkan on lavapipe)
AI-assisted.
Checklist
mainand merges cleanly.@madvillain91 on GitHub · 2026-11-25 13:47 UTC · original · reviewed
Independent Windows 11 26H2 (26300.9711) check at
857314142against main384abe5b0, using VS 2022 Build Tools (MSVC 19.44.35230.0, RelWithDebInfo, Ninja), Vulkan SDK 1.4.363.0, and NVIDIA GeForce RTX 3070 Ti (Ampere, driver 617.14, Vulkan 1.4.351).gfx10_descriptors_test: passed (verifiesvulkan_subresource_range()clamps 3D views tobaseArrayLayer=0, layerCount=1while preserving array layers on 2D arrays, andhas_hardware_volume_uav_slice_offset()flags non-zero hardware 3D UAV slice offsets).d3d12_vulkan_device_test(LEONIDA_VK_VALIDATION=1): passed with 0 VUIDs.Code review looks clean and matches Vulkan's
VkImageViewCreateInfo3D subresource-range rules. Not checked: retail boot or a live 3D UAV slice-offset draw. LGTM.AI-assisted verification.
@ecox982745 on GitHub · 2026-11-25 13:47 UTC · original
Verified the Windows shim at
857314142on an RTX 4090 (Windows 11, NVIDIA 616.64, MSVC). The standalone runtime bound both sampled descriptors with nonzeroBASE_ARRAYand refused the raw sliced UAV.I used a 33×33×33
R32_UINTvolume with four mips and a sampled view covering mips 1–2. I copied its descriptor into a CPU-written console heap, changed the fields below, submitted a command list, and looked up each original eight-word key. The modified keys all had index zero before the heap was registered.WORD5[3:0] = 1)The runtime logged the explicit unsupported-slice reason for the last slot. This probe checks native view registration and key identity. Separately, I translated the PR revision’s synthetic
cs_texture_uavshader using LLVM 23.1.6. It passed SPIR-V validation and all 14 GPU storage-image cases passed readback, including 10 compared with D3D12 WARP. Those writes exercise the API-created views. I did not sample texels through the two modified raw sampled descriptors.CTest also passed
gfx10_descriptors(CPU),d3d12_texture_uav, andd3d12_view_slices. All inputs were synthetic. AI-assisted verification with OpenAI Codex.@aslan2142 on GitHub · 2026-11-25 22:02 UTC · original
Merged, thanks! A 3D view now uses the single array layer Vulkan allows, instead of a nonzero
baseArrayLayer.main24d8af66a: the only pass-to-fail wasxmem, the known first-run flake, which passed 5 of 5 on both devices when re-run alone.main6b843a4ad+857314142: it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).