From be9e6f82a7f364661b4c555c914d99aca9a72076 Mon Sep 17 00:00:00 2001 From: szombathy-tamas Date: Sat, 7 Nov 2026 01:25:53 +0100 Subject: [PATCH] D3D12: micromap prebuild query passes dummy non-zero addresses "GetMicromapPrebuildInfo" left "InputBuffer" and "PerOmmDescs" null, while every build passes real addresses. The DXR spec lets the prebuild query inspect whether GPU addresses are null and names dummy non-zero values for this case; the debug layer refused the nulls at every micromap creation ([1162]). Pass 256 for both (128- and 4-byte aligned) with the build's stride. --- Source/D3D12/DeviceD3D12.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/D3D12/DeviceD3D12.hpp b/Source/D3D12/DeviceD3D12.hpp index d916cc44..e6a5a076 100644 --- a/Source/D3D12/DeviceD3D12.hpp +++ b/Source/D3D12/DeviceD3D12.hpp @@ -1657,6 +1657,11 @@ void DeviceD3D12::GetMicromapPrebuildInfo(const MicromapDesc& micromapDesc, D3D1 opacityMicromapArrayDesc.NumOmmHistogramEntries = micromapDesc.usageNum; opacityMicromapArrayDesc.pOmmHistogram = usages; + // Not dereferenced, but may be checked for null: dummy non-zero values stand for the build's buffers (DXR spec, "GetRaytracingAccelerationStructurePrebuildInfo") + opacityMicromapArrayDesc.InputBuffer = 256; + opacityMicromapArrayDesc.PerOmmDescs.StartAddress = 256; + opacityMicromapArrayDesc.PerOmmDescs.StrideInBytes = sizeof(MicromapTriangle); + D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS accelerationStructureInputs = {}; accelerationStructureInputs.Type = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_OPACITY_MICROMAP_ARRAY; accelerationStructureInputs.Flags = GetMicromapFlags(micromapDesc.flags);