While working with DirectX 12 in the project settings, the editor crashes by check() code when attempting to create a static texture from a non-HDR Cube Render Target asset. This crash doesn't occur with DirectX 11.
The check() code in question is in FD3D12DynamicRHI::GetStagingTexture() in D3D12RenderTarget.cpp.
// Ensure we're dealing with a Texture2D, which the rest of this function already assumes
check(TextureRHI->GetTexture2D());
Possible Solution:
Further down in this function, there's code that handles a texture as a Cube Map. Therefore, this check code could be unnecessary (It seems DX11 doesn't do this kind of check.) Commenting out this line makes it possible to create a valid texture asset from a non-HDR Cube Render Target asset.
The attached project to repro already finished step 1 to 5.
(This callstack came from UE5.2.1)
LoginId:637e5626447de5b7d4b9e9a79f04a92e
EpicAccountId:e08a7c8293b5475087681986ffe111c2
Assertion failed: TextureRHI->GetTexture2D() [Link Removed] [Line: 653]
UnrealEditor_D3D12RHI!FD3D12DynamicRHI::GetStagingTexture() [D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RenderTarget.cpp:653]
UnrealEditor_D3D12RHI!FD3D12DynamicRHI::ReadSurfaceDataNoMSAARaw() [D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RenderTarget.cpp:759]
UnrealEditor_D3D12RHI!FD3D12DynamicRHI::RHIReadSurfaceData() [D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12RenderTarget.cpp:1232]
UnrealEditor_RHI!FRHICommandListImmediate::ReadSurfaceData() [D:\build\++UE5\Sync\Engine\Source\Runtime\RHI\Public\RHICommandList.h:4770]
UnrealEditor_Engine!TEnqueueUniqueRenderCommandType<`FTextureRenderTargetCubeResource::ReadPixels'::`2'::ReadSurfaceCommandName,<lambda_4bdfc41ec1076a6d75cd6e5ae57c4443> >::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\RenderCore\Public\RenderingThread.h:209]
UnrealEditor_Engine!TGraphTask<TEnqueueUniqueRenderCommandType<`FTextureRenderTargetCubeResource::ReadPixels'::`2'::ReadSurfaceCommandName,<lambda_4bdfc41ec1076a6d75cd6e5ae57c4443> > >::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1310]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:758]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:649]
UnrealEditor_RenderCore!RenderingThreadMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:416]
UnrealEditor_RenderCore!FRenderingThread::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:542]
UnrealEditor_Core!FRunnableThreadWin::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:149]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-195025 in the post.
1 |
Component | UE - Rendering Architecture - RHI |
---|---|
Affects Versions | 5.1, 5.2, 5.3 |
Target Fix | 5.5 |
Fix Commit | 28494190 |
---|
Created | Sep 11, 2023 |
---|---|
Resolved | Sep 13, 2024 |
Updated | Sep 18, 2024 |