d3d12: use 32-byte guest stride for Device11 inline descriptor arenas #184
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!184
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/184/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?
@DrArroway on GitHub · 2026-11-25 17:54 UTC · original
DrArroway:fix/radv-inline-descriptor-stride→main· +99 −41 · 6 files · 1 commits · merged 2026-11-25 19:03 UTCSummary
Fixes #182.
On hosts where
vkd3d-protonreports a 64-byte nativeCBV_SRV_UAVdescriptor handle increment (AMD RADV withVK_EXT_descriptor_heaporVK_EXT_descriptor_buffer),Device11inline descriptor arenas previously mixed two strides:GetDescriptorHandleIncrementSize,Arena::author, andArena::cpustepped at nativeself.stride(64), whileArena::gpu_tablewalked inline records byINLINE_BYTES(32) andArena::publishscaled slot offsets byself.stride / INLINE_BYTES. As a result, guests queryingGetDescriptorHandleIncrementSize(such aslanes-selftest-descriptor-reclaim) only materialized slot 0 and left slots 1+ as null SRVs, while 32-byte inline table offsets misaligned againstself.stride.Separate the guest-visible logical stride (
guest_stride(), 32 bytes wheninlineis active onDevice11) from the host staging/visible heap stride (self.stride):device.rs: addguest_increment_sizereturningINLINE_BYTES(32) forCBV_SRV_UAVwhendevice11_queueis active and native stride is a nonzero multiple ofINLINE_BYTES.descriptor_paging.rs&lookup.rs: allocate guest arena memory, checkRegistry::find/copy_source/contains/resident_gpu/gpu_table, stepauthor, mapcpu()(guest_slot * self.stridein native staging), andpublish()uniformly usingguest_stride()(removing theself.stride / INLINE_BYTESscaling branch), whilecopy()uses nativestaging_cpu_start + src * self.stride.descriptor_copy.rs&commands/descriptors.rs: step guest descriptor handles byguest_stridewhen copying into or reading scalar descriptors from an inline arena, leaving native descriptor tracking on native stride.tests/device/descriptor_paging.rs: updateaddr_ofand addinline_arena_uses_32_byte_guest_stride_on_64_byte_native_heapcovering 64-byte native heaps with odd 32-byte table offsets,cpu(),author(),resolve_inline(), andpublish().On
stride == 32hosts,guest_stride() == self.stride, leaving behavior unchanged.Verified on Lanes
python tuxbox.py checkpassed on this branch (withTUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000exported until #178 lands; unpinned passes Phases 1–4 ofdescriptor-reclaimand fails only at #178's Phase 5E_OUTOFMEMORYlimit check)lanes-selftest-descriptor-reclaimdirectly exercises this path on default RADV (VK_EXT_descriptor_heap, native stride 64):TUXBOX_LOG=1now logsmaterialized 3 CPU-authored descriptor records (table length 8192, native stride 64)instead of1, anddescriptor-reclaimpasses (lanes-selftest PASS pci=1002:73bf scenario=descriptor-reclaim passed=1).d3d12-mesh(tuxbox.py verify --only d3d12-mesh) and all112tuxbox-d3d12Rust unit tests (cargo test --target x86_64-pc-windows-msvc -p tuxbox-d3d12under Wine) also pass.GPU, driver and backend: AMD Radeon RX 6900 XT (
1002:73bf), Mesa RADV26.3.1-arch3.4, Proton Experimental (1794497090 experimental-11.0-20261112-x86_64,vkd3d-proton 3.2.0), CachyOS Linux (Ryzen 9 7900X).Summary from
DXC=... TUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000 python tuxbox.py check --backend proton --adapter 1002:73bf(64/64 verify gates passed):(Note:
D3D12 regression controlsandShader translator on the GPUwere not run here because Windowsdxcompiler.dll/dxil.dllandxvfb-runare not installed on this host.)Checks
All CI checks in
.github/workflows/ci.ymlpass locally with 0 warnings (Python tests,Shader compiler tests,DXBC tests,XG layout tests,D3D12 Windows typecheck). Noevidence/*.jsonfiles were modified.@postblink on GitHub · 2026-11-25 18:55 UTC · original
An independent reproduction of #182 from a different scenario, and this change fixes it.
I'm writing a Lanes scenario for #168 (
raster-tables, not posted yet): a console pixel program reads one raw SRV from slot 2 of the second of two root tables, with views created atGetDescriptorHandleIncrementSizeon aDevice11heap. Every other view holds a decoy naming its index, so a wrong slot shows up as a number.Radeon 610M iGPU (
1002:13c0, Mesa RADV 26.3.1, Proton Experimental 11.0-20261112) and RTX 5080 (10de:2c02, driver 620.73.04) on the same machine:7b22d71+ scenariotexel 0,0 read view 9, not table 1 slot 2 (view 10)7b22d71+ scenario + this branch (cf427e8)On RADV the provider logged
materialized 1 CPU-authored descriptor records (table length 3, native stride 64). Console slot 2 is read at table + 2 × 32 bytes, which with 64-byte authoring is the middle of the record for view 9 (table base 8, so 8 + 1). That's the same mix of strides your summary describes, seen from the table side rather than through reclaim.