mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #710] [MERGED] OLD-8414: restore old upstream PR 8414 - d3d12: arena AS resources take their address from vkGetAccelerationStructureDeviceAddressKHR #751
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#751
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/710
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:gpuav-as-type📝 Commits (2)
186b20ed3d12: arena AS resources take their address from vkGetAccelerationStructureDeviceAddressKHR296508ed3d12_indirect_rt: check arena AS addresses, also on a driver whose address is not buffer address + offset📊 Changes
2 files changed (+112 additions, -2 deletions)
View changed files
📝
runtime/shims/d3d12_vulkan_device.cpp(+22 -2)📝
runtime/test/d3d12_indirect_rt_test.cpp(+90 -0)📄 Description
Claimed in the coordination issue as: OLD-8414 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131404028
Restoration of my original pull request, old upstream PR 8414 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Ported onto main at21625bca8c. The runtime change applies unchanged. Ind3d12_indirect_rt_test.cpp, main's CLONE/COMPACT tests stay as they are, and the new checks go right after the TLAS lookups, where they were in the original.What and why
vkGetAccelerationStructureDeviceAddressKHR(VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-12281). For aGENERICstructure the spec only promises consistent offsets between the structures of one buffer, not that the address equals the buffer address.buffer_va_path.GENERICstructure built as bottom level is "not a bottom level acceleration structure", which the spec allows.d3d12_indirect_rt:get_instance_procreturns avkGetAccelerationStructureDeviceAddressKHRthat adds 256 MiB to the real address (no runtime change), an AS resource's GPU VA is the driver's address, and the arena address still names the structure.Tested
On Linux,
d3d12_indirect_rt_testwas cross-built with clang for the mingw target and run under Wine 11.22 (staging) on Mesa 26.3.1 RADV. CI's MSVC build was not run locally. Each GPU ran three builds: main, main with only the new test, and this branch. Every run used the host Khronos validation layer.LEONIDA_UPLOAD_SYSMEM=1LEONIDA_UPLOAD_SYSMEM=1With GPU-AV (
VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1), both GPUs give the same result as each other and as the original PR:GENERICstructures, plus 1 invalid reference on the ARRAY_OF_POINTERS instance.Both changed files pass
git diff --checkandpython -I scripts/check_no_game_data.py.GPUs tested: AMD Radeon RX 7900 XTX (RDNA3) and the integrated AMD Radeon Graphics of a Ryzen 9 7950X3D (RDNA2, gfx1036), both on Mesa 26.3.1 RADV, Arch Linux, through Wine 11.22
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.