Hello everyone,
I’ve encountered a problem when enabling DX12 and hardware ray tracing. In a Shipping build, the project crashes on startup with the following error (but only on some machines, even with similar hardware configurations):
Engine Version: 5.5.0 (no additional plugins)
Crash log:
LowLevelFatalError [File:D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 991]
RayTracingDevice->CreateStateObject(&Desc, IID_PPV_ARGS(Result.GetInitReference())) failed
at D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RayTracing.cpp:663
with error E_INVALIDARG
Reichfall_Win64_Shipping!D3D12RHI::VerifyD3D12Result()
Reichfall_Win64_Shipping!FD3D12PoolAllocator::CreatePlacedResource()
Reichfall_Win64_Shipping!FD3D12RayTracingPipelineCache::FShaderCompileTask::DoTask()
Reichfall_Win64_Shipping!TGraphTask<FD3D12RayTracingPipelineCache::FShaderCompileTask>::ExecuteTask()
Reichfall_Win64_Shipping!UE::Tasks::Private::FTaskBase::TryExecuteTask()
Reichfall_Win64_Shipping!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __ptr64 __cdecl(bool),48>::TTaskDelegateImpl<LowLevelTasks::FTask::Init<UE::Tasks::Private::FTaskBase::Init'::2'::<lambda_1> >'::5'::<lambda_1>,0>::CallAndMove()
Reichfall_Win64_Shipping!LowLevelTasks::FTask::ExecuteTask()
Reichfall_Win64_Shipping!LowLevelTasks::FScheduler::WorkerLoop()
Reichfall_Win64_Shipping!operator<<()
Reichfall_Win64_Shipping!FThreadImpl::Run()
Reichfall_Win64_Shipping!FRunnableThreadWin::Run()
Relevant Code in D3D12RayTracing.cpp:
// Existing collection objects
for (int32 CollectionIndex = 0; CollectionIndex < ExistingCollections.Num(); ++CollectionIndex)
{
Subobjects[Index++] = D3D12_STATE_SUBOBJECT{ D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION, &ExistingCollections[CollectionIndex] };
}
// Done!
checkf(Index == Subobjects.Num(), TEXT("All pipeline subobjects must be initialized."));
// Create ray tracing pipeline state object
D3D12_STATE_OBJECT_DESC Desc = {};
Desc.NumSubobjects = Index;
Desc.pSubobjects = &Subobjects[0];
Desc.Type = StateObjectType;
VERIFYD3D12RESULT(RayTracingDevice->CreateStateObject(&Desc, IID_PPV_ARGS(Result.GetInitReference()))); // crash!
INC_DWORD_STAT(STAT_D3D12RayTracingCreatedPipelines);
INC_DWORD_STAT_BY(STAT_D3D12RayTracingCompiledShaders, NumExports);
return Result;
}
DirectX Debug Log:
D3D12 ERROR: ID3D12Device::CreateStateObject: Resource bindings for function "RayGen_56888ca624d69fc5" not compatible with associated root signatures (if any): local root signature object: 0x00000181432A6E60:'Unnamed ID3D12RootSignature Object', global root signature object: 0x00000181656E0E20:'Unnamed ID3D12RootSignature Object'. Error detail: Shader CBV descriptor range (BaseShaderRegister=1, NumDescriptors=1, RegisterSpace=4) is not fully bound in a root signature. If the intent is this will be resolved later when this state object is combined with other state object(s), use a D3D12_STATE_OBJECT_CONFIG subobject with D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS set in Flags. [ STATE_CREATION ERROR #1194: CREATE_STATE_OBJECT_ERROR]
D3D12: **BREAK** enabled for the previous message, which was: [ ERROR STATE_CREATION #1194: CREATE_STATE_OBJECT_ERROR ]
Interestingly, as long as I don’t click OK on the error message box, the application appears to work fine.
- Does anyone have ideas on what might be causing this issue?
- Is there a workaround for this without modifying Unreal Engine source files?
Any help is appreciated!