Hi,
We hit two different crashes inside FRecordUpdateRayTracingGeometryListener.
1st callstack is
FD3D12RayTracingShaderBindingTableInternal::FRecordUpdateRayTracingGeometryListener::RemoveListener E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp (1921)
FD3D12RayTracingGeometry::~FD3D12RayTracingGeometry E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp (3854)
FD3D12RayTracingGeometry::`scalar deleting destructor'
FRHICommandListExecutor::FSubmitState::Submit E:\dev\main\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp (1246)
``FRHICommandListExecutor::Submit'::`36'::<...>::operator E:\dev\main\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp (1468)
FRHICommandListExecutor::FTaskPipe::Execute E:\dev\main\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp (725)
2nd callstack is
FD3D12RayTracingShaderBindingTableInternal::FRecordUpdateRayTracingGeometryListener::HitGroupParametersUpdated E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp (1929)
FD3D12RayTracingGeometry::SetupHitGroupSystemParameters E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp (4102)
FD3D12RayTracingGeometry::Swap E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp (3774)
`FD3D12DynamicRHI::RHIReplaceResources'::`2'::<...>::operator E:\dev\main\Engine\Source\Runtime\D3D12RHI\Private\D3D12Resources.cpp (1799)
TRHILambdaCommandMultiPipe<...>::ExecuteAndDestruct E:\dev\main\Engine\Source\Runtime\RHI\Public\RHICommandList.inl (285)
FRHICommandListBase::Execute E:\dev\main\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp (524)
These crashes are very hard to reproduce (about once per day). In both crashes, the ShaderTable was NULL.
virtual void RemoveListener(FD3D12RayTracingGeometry* InGeometry) final override
{
check(Geometry == InGeometry);
ShaderTable->RemoveUpdateRayTracingGeometryListener(RecordIndex, this); // <<----
}
virtual void HitGroupParametersUpdated(FD3D12RayTracingGeometry* InGeometry) final override
{
check(InGeometry == Geometry);
uint32 GPUIndex = ShaderTable->Device->GetGPUIndex(); // <<----
Is this crash a known issue?
To avoid the crash, we added an early return if ShaderTable is null in the code listed above. Is there any potential concern about our local fix?
virtual void RemoveListener(FD3D12RayTracingGeometry* InGeometry) final override
{
check(Geometry == InGeometry);
if (ShaderTable == nullptr) return; <<++++++
ShaderTable->RemoveUpdateRayTracingGeometryListener(RecordIndex, this);
}
virtual void HitGroupParametersUpdated(FD3D12RayTracingGeometry* InGeometry) final override
{
check(InGeometry == Geometry);
if (ShaderTable == nullptr) return; <<++++++
Thanks,
Yichen Wang
[Attachment Removed]