From 9bff5fe29fe4daad5328954ebb90eeacee57b8cd Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 22 Nov 2024 16:15:18 +0000 Subject: [PATCH] Disallow compaction entirely * Although we intercept size queries to return the current size instead of compacted size, this size can still leak out if a compacted AS is used as the source of a subsequent update-build. Also in theory an application could just compact then query the current size (possibly for defrag? though you'd expect that size to be cached on the CPU from the original compact). --- renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index 72102cff9..39371df1c 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -1530,8 +1530,12 @@ void WrappedID3D12GraphicsCommandList::CopyRaytracingAccelerationStructure( _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE compactBlockedMode = Mode; + if(compactBlockedMode == D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT) + compactBlockedMode = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE; + SERIALISE_TIME_CALL(m_pList4->CopyRaytracingAccelerationStructure( - DestAccelerationStructureData, SourceAccelerationStructureData, Mode)); + DestAccelerationStructureData, SourceAccelerationStructureData, compactBlockedMode)); if(IsCaptureMode(m_State)) {