Repository navigation
Conversation
…ructureDeviceAddressKHR A default-heap acceleration-structure resource in the GPU address arena handed out buffer address + offset as its GPU VA without asking the driver. An instance must name its BLAS by a value obtained from vkGetAccelerationStructureDeviceAddressKHR (VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-12281), and for a GENERIC structure the spec only promises consistent offsets between structures of one buffer, not equality with the buffer address. Query it as the committed path does; if a driver ever returns a different address, use the driver's and keep the arena address registered too. GPU-assisted validation only knows addresses it has seen that call return, so it reported every arena BLAS as "an invalid acceleration structure reference" and rewrote the instance to its dummy BLAS (the ray-query miss marso006 saw). It now reports the remaining layer limitation instead: a GENERIC structure built as bottom level is "not a bottom level acceleration structure", which the spec allows. d3d12_indirect_rt checks that every AS resource's GPU VA is the driver's address for the structure behind it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent native Windows check of 08c19978 on an RTX 3080 Ti (driver 621.35, MSVC 19.44, Vulkan SDK 1.4.363.0). In the focused A separate run that also included the stock Synthetic geometry only. AI-assisted. |
|
Code read of the PR head: looks right. The arena path (d3d12_vulkan_device.cpp:1799-1819) now matches the committed path (:1874-1890); ~Resource (:1720-1723) already unregisters both gpu_va_ and buffer_va_, so cleanup on free is covered; XDXR isn't affected since info.ray_tracing is false there (:8979). On the KHR path instance descs pass the BLAS VA through, Dest/Source go through resolve_acceleration_structure (vulkan_replay.h:3039-3042), and copy/postbuild aren't used (:3050-3070), so GetGPUVirtualAddress() is the only source of the address and it now returns the driver's value. Two notes, neither blocking:
AI-assisted (Claude Code). |
…ss is not buffer address + offset Envyre's review of ItsNotRexed#8414: the branch that takes the driver's address when it differs only ran on such a driver. The test creates a second device whose get_instance_proc hands out a vkGetAccelerationStructureDeviceAddressKHR that answers the real address plus 256 MiB (the device's existing function-lookup hook, no change to the runtime), creates one AS resource on it and checks that its GPU VA is the driver's address, that the arena address still names the structure, and that releasing the resource forgets both. No builds run on that device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Envyre for the careful read.
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Tested b9e0544 (with the shifted-address test) on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300), native Windows: pass Built with
|
Claimed in the coordination issue: #8186 (comment) (marso006's findings: #8186 (comment)). The #313 table lists this one as D3D-883.
Depends on: none. It builds on
main.What and why
An acceleration-structure resource in the default heap lives in the GPU address arena. It is a
GENERICstructure over its arena range. Its GPU VA wasarena.address + offset, and the driver was never asked for the structure's address. Instance descriptors then hold that computed value.vkGetAccelerationStructureDeviceAddressKHR" (VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-12281).GENERIC, the spec only promises that these addresses keep the offsets between structures in the same buffer (vkGetAccelerationStructureDeviceAddressKHR, resources chapter). That the address equals buffer address + offset is only in a non-normative note.libs/vkd3d/resource.c,vkd3d_create_acceleration_structure_view).The change:
vkGetAccelerationStructureDeviceAddressKHR, the same way the committed path does.d3d12_indirect_rtnow checks that each AS resource'sGetGPUVirtualAddress()equals the driver's address for theVkAccelerationStructureKHRbehind it.This is what GPU-assisted validation tripped on in marso006's run:
vkGetAccelerationStructureDeviceAddressKHRreturn. Every arena BLAS was therefore "an invalid acceleration structure reference".hit=0 miss=0).d3d12_indirect_rtshares one instance buffer between theARRAYand theARRAY_OF_POINTERSTLAS. The second build therefore reads GPU-AV's dummy address and gets a second, follow-on message.This does not make the GPU-AV run pass. With the address queried, GPU-AV reports the remaining cause instead: "is not a bottom level acceleration structure, but has type
VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR".GENERICis "intended to be used by API translation layers", and the real type is the one given at build time.AccelerationStructureKHR::GetType()returnscreate_info.type;gpuav/shaders/validation_cmd/tlas.slangrequiresBUILD_AS_METADATA_AS_TYPE_BLAS). That is a layer false positive, to report to Khronos.vkCreateAccelerationStructureKHRa typed structure's address may differ from buffer address + offset, but the D3D12 VA is fixed when the resource is created. vkd3d-proton usesGENERICfor the same reason.A standalone Vulkan check (no D3D12, one triangle) shows the same split on RADV with VVL 1.4.363.1 and GPU-AV:
BOTTOM_LEVELGENERICGENERIC"GENERICIn both
GENERICcases, the instance reads back afterwards with GPU-AV's dummy BLAS address. The queried and computed addresses were equal in every case.Tested
Linux, Wine 11.22 (staging), host Vulkan validation layer 1.4.363.1 through winevulkan (
VK_LOADER_LAYERS_ENABLE=*validation, GPU-AV withVK_KHRONOS_VALIDATION_GPUAV_ENABLE=1), Mesa 26.3.1 RADV. The tests were built with clang 23 for the mingw target, not MSVC: this is a local check, and the MSVC/W4 /permissive-build is CI's.The integrated GPU (Ryzen 9 7950X3D, gfx1036 RDNA2) ran all four tests. The RX 7900 XTX (RDNA3) ran three, after they had run clean on the integrated GPU. Results before (
maindde82f27e) and after:d3d12_dxr_validation(XDXR)d3d12_dxr_validation_khrGENERICtype"d3d12_xdxr_rtd3d12_indirect_rt(integrated GPU only)GENERICtype" + 1 follow-ond3d12_indirect_rtpasses on the integrated GPU, with and without GPU-AV.VUID-vkCreateDevice-ppEnabledExtensionNames-01387, which every Wine run shows.d3d12_indirect_rtfails onmaintoo in this Wine setup, without GPU-AV. The RT build list is refused ("ExecuteCommandLists failed: invalid copy or resolve"), from theARRAY_OF_POINTERSinstance staging. That is the knownARRAY_OF_POINTERSproblem (#4301 and related), not this change.Checklist
docs/design.md, with how it was confirmed. (No translator change.)AI-assisted (Claude Code, Claude Opus 5.5).