Memory access assertion when handling a resource transition

Upon handling a resource transition and while fetching the resource’s After state, GetD3D12ResourceState asserts because it does not expect the provided ERHIAccess flags to indicate that the resource can be written to (it expects ERHIAccess on AccessAfter to be read only)

We have no specific repro, but can provide a callstack and a small RHI breadcrumbs trace from the RHI thread.

[2025.05.30-19.25.13:834][544]LogWindows: Error: appError called: Assertion failed: !(EnumHasAnyFlags(InRHIAccess, ERHIAccess::WritableMask)) [File:\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 1719]

[2025.05.30-19.25.13:834][544]LogWindows: Windows GetLastError: The operation completed successfully. (0)

[2025.05.30-19.25.14:685][544]LogRHI: Error: Breadcrumbs ‘RHIThread’

- NiagaraGpuComputeDispatch

- VisibilityCommands

- Scene

- RenderGraphExecute - /ViewFamilies

- SceneRender - ViewFamilies

- Frame 40542

[2025.05.30-19.25.14:685][544]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe

[2025.05.30-19.25.14:685][544]LogMemory: Platform Memory Stats for Windows

[2025.05.30-19.25.14:685][544]LogMemory: Process Physical Memory: 5297.45 MB used, 5375.59 MB peak

[2025.05.30-19.25.14:685][544]LogMemory: Process Virtual Memory: 10318.70 MB used, 10444.85 MB peak

[2025.05.30-19.25.14:686][544]LogMemory: Physical Memory: 47532.53 MB used, 214484.97 MB free, 262017.50 MB total

[2025.05.30-19.25.14:686][544]LogMemory: Virtual Memory: 52353.18 MB used, 248576.31 MB free, 300929.50 MB total

[2025.05.30-19.25.14:686][544]Message dialog closed, result: Yes, title: The UE Game has crashed and will close, text: Assertion failed: !(EnumHasAnyFlags(InRHIAccess, ERHIAccess::WritableMask)) [File:\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 1719]

[2025.05.30-19.25.14:686][544]LogThreadingWindows: Error: Runnable thread RHIThread crashed.

[2025.05.30-19.25.14:686][544]LogWindows: Error: === Critical error: ===

[2025.05.30-19.25.14:686][544]LogWindows: Error:

[2025.05.30-19.25.14:686][544]LogWindows: Error: Assertion failed: !(EnumHasAnyFlags(InRHIAccess, ERHIAccess::WritableMask)) [File:\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp] [Line: 1719]

[2025.05.30-19.25.14:686][544]LogWindows: Error:

[2025.05.30-19.25.14:686][544]LogWindows: Error:

[2025.05.30-19.25.14:686][544]LogWindows: Error:

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff621dc0de8 Game.exe!FDebug::CheckVerifyFailedImpl2() [\\UE\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:728]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6267530df Game.exe!GetD3D12ResourceState() [\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Util.cpp:1719]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff62664a369 Game.exe!`FD3D12CommandContext::HandleResourceTransitions’::`6’::<lambda_1>::operator()() [\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Commands.cpp:617]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6266617da Game.exe!FD3D12CommandContext::HandleResourceTransitions() [\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Commands.cpp:557]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff62666f166 Game.exe!FD3D12CommandContext::RHIEndTransitions() [\\UE\Engine\Source\Runtime\D3D12RHI\Private\D3D12Commands.cpp:742]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6269747fd Game.exe!FRHICommand<FRHICommandResourceTransition,FRHICommandResourceTransitionString2358>::ExecuteAndDestruct() [\\UE\Engine\Source\Runtime\RHI\Public\RHICommandList.h:1619]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff626971e51 Game.exe!FRHICommandListBase::Execute() [\\UE\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp:524]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff62699f46e Game.exe!FRHICommandListExecutor::FTranslateState::Translate() [\\UE\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp:1081]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff62695b1d6 Game.exe!`FRHICommandListExecutor::FSubmitState::Dispatch’::`10’::<lambda_1>::operator()() [\\UE\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp:1029]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff626973811 Game.exe!FRHICommandListExecutor::FTaskPipe::Execute() [\\UE\Engine\Source\Runtime\RHI\Private\RHICommandList.cpp:725]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6220eff66 Game.exe!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(enum ENamedThreads::Type,TRefCountPtr<FBaseGraphTask> const &),0> >::ExecuteTask() [\\UE\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:707]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff621ac6483 Game.exe!UE::Tasks::Private::FTaskBase::TryExecuteTask() [\\UE\Engine\Source\Runtime\Core\Public\Tasks\TaskPrivate.h:528]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff621ab95a9 Game.exe!FNamedTaskThread::ProcessTasksNamedThread() [\\UE\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:779]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff621ab9afe Game.exe!FNamedTaskThread::ProcessTasksUntilQuit() [\\UE\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:668]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff626b3b5d3 Game.exe!FRHIThread::Run() [\\UE\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:271]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6220fbdd8 Game.exe!FRunnableThreadWin::Run() [\\UE\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:159]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007ff6220f491f Game.exe!FRunnableThreadWin::GuardedRun() [\\UE\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:79]

[2025.05.30-19.25.14:686][544]LogWindows: Error: [Callstack] 0x00007fff1af47374 KERNEL32.DLL!UnknownFunction

[2025.05.30-19.25.14:686][544]LogWindows: Error:

[2025.05.30-19.25.14:686][544]LogWindows: Error: Crash in runnable thread RHIThread

[2025.05.30-19.25.14:690][544]LogExit: Executing StaticShutdownAfterError

[2025.05.30-19.25.14:694][544]LogWindows: FPlatformMisc::RequestExit(1, FRunnableThreadWin::GuardedRun.ExceptionHandler)

[2025.05.30-19.25.14:694][544]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3, FRunnableThreadWin::GuardedRun.ExceptionHandler)

[2025.05.30-19.25.14:694][544]LogCore: Engine exit requested (reason: Win RequestExit)

Note that this is the same internal demo build where we also see [Content removed]

Hi,

This could be Niagara related but we don’t have any known issues yet with this callstack. Can you add some test code in this area to get more information about the texture being accessed when the crash happens?

// temporary check to output additional information about the resource being accessed here // check(!(EnumHasAnyFlags(InRHIAccess, ERHIAccess::WritableMask))); checkf(!(EnumHasAnyFlags(InRHIAccess, ERHIAccess::WritableMask)), TEXT("Texture resource (%s) should not have a writable mask"), InRHID3D12Texture == nullptr ? TEXT("Unknown") : *InRHID3D12Texture->GetName().GetPlainNameString());If you are able to repro this then running with -rhivalidation and -onethread may help narrow down the issue further. Also please let us know if you have custom code in this area because custom data interfaces might be the root cause. Running custom code / modifications in this area can lead to these kind of crashes.

Hope that helps.

Hey Alex! I have more information about this crash.

Niagara indeed. I caught a couple of system resources that are causing it:

  • GPUIDToIndexTable, as in “NiagaraIDToIndexTable_<sim name>” (for example, NiagaraIDToIndexTable_NS_MySystem)
  • GPUBufferFloat (I’m guessing I don’t see GPUBufferInt or GPUBufferHalf here because we’re mainly using floats in our NS’)

I see that Simon Tovey might have fixed a similar issue back in '24 (CL 37203248), could this be a similar case? For reference, our Niagara systems use Data Channels, and we’re currently re-using some from Nightingale; this assertion is most probably related to changes in 5.6

Let me know your thoughts. I’d be ready to try exploring some possible patches if you have ideas!

Thanks!

Dan.

The issue comes from AccessAfter for these resources being more than just UAVCompute (most common case), and also implying a read-only state.

For example, when the assertion happens, I see a mask of 0x444804E6. Therefore, we’d go into the default (read-only) section of GetD3D12ResourceState, and trigger the assertion because UAVCompute is considered a writable state.

I suspect this could happen if AccessAfter contained, for example, UAVMask.

Still a bit preliminary to say, but we haven’t observed this assertion since the fix to the dangling OwnerLastRenderTimePtr went in (mentioned here: [Content removed]

I can’t explain how one thing would relate to the other, though. Will keep an eye on this for a couple more days.

Just wanted to post a reminder that Epic is on holiday break from 6/30 - 7/11, returning on 7/14. Confidential issues will be unanswered during that time but non-confidential issues will be answered, but likely with slower response times.

Hey Alex!

For sure! I’ll add this check and take it for a spin. I’ll report our findings here. Thanks!

Hi, Alex!

It looks like the texture resource that we’re querying here is null. I’m adding a bit more debug code to catch the kind of RHI access that it’s requesting.