Description

A Salesforce ticket reports that entering the above code into a custom node in a Material Function causes a crash. I was able to repro his crash reliably.

This is a regression. Working as expected on 4.25.4 CL 14469661.

Steps to Reproduce
  1. Create a Material Function Asset.
  2. Add a Custom Node and connect with Result.
  3. Add
     return CalcSceneDepth(ScreenAlignedPosition(GetScreenPosition(Parameters)));
  1. Apply Material Changes.

Expected Result: Material changes are applied. No any errors and SCENE_TEXTURES_DISABLED_SCENE_DEPTH_VALUE value from function result

Actual Result: Crash.

Callstack
Assertion failed: false [File:D:/Perforce/Local_UE4_4.26/Engine/Source/Runtime/RenderCore/Private/ShaderCore.cpp] [Line: 397] Shader attempted to bind uniform buffer 'FOpaqueBasePassUniformParameters' at slot [Name: SceneTextures, Slot: 0] with hash '158926433', but the shader expected 'SceneTexturesStruct' with hash '214239873'. 
UE4Editor_Core!AssertFailedImplV() [AssertionMacros.cpp:104]
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [AssertionMacros.cpp:461]
UE4Editor_RenderCore!DispatchCheckVerify<void,<lambda_75024baf82fd32b96f25cc29526da109> >() [AssertionMacros.h:164]
UE4Editor_RenderCore!ValidateStaticUniformBuffer() [ShaderCore.cpp:394]
UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHISetGraphicsPipelineState() [D3D11Commands.cpp:202]
UE4Editor_RHI!FRHICommand<FRHICommandSetGraphicsPipelineState,FRHICommandSetGraphicsPipelineStateString1255>::ExecuteAndDestruct() [RHICommandList.h:763]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteInner_DoExecute() [RHICommandList.cpp:368]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteInner() [RHICommandList.cpp:659]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteList() [RHICommandList.cpp:682]
UE4Editor_RHI!FRHICommandWaitForAndSubmitSubList::Execute() [RHICommandList.cpp:1109]
UE4Editor_RHI!FRHICommand<FRHICommandWaitForAndSubmitSubList,FRHICommandWaitForAndSubmitSubListString1075>::ExecuteAndDestruct() [RHICommandList.h:763]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteInner_DoExecute() [RHICommandList.cpp:368]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteInner() [RHICommandList.cpp:659]
UE4Editor_RHI!FRHICommandListExecutor::ExecuteList() [RHICommandList.cpp:709]
UE4Editor_RHI!FRHICommandList::EndScene() [RHICommandList.cpp:1575]
UE4Editor_Renderer!TRDGLambdaPass<FEmptyShaderParameters,<lambda_252577c0dad6136b63ad4da3e49192c9> >::ExecuteImpl() [RenderGraphPass.h:424]
UE4Editor_RenderCore!FRDGPass::Execute() [RenderGraphPass.cpp:302]
UE4Editor_RenderCore!FRDGBuilder::ExecutePass() [RenderGraphBuilder.cpp:1593]
UE4Editor_RenderCore!FRDGBuilder::Execute() [RenderGraphBuilder.cpp:1253]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [DeferredShadingRenderer.cpp:2618]
UE4Editor_Renderer!RenderViewFamily_RenderThread() [SceneRendering.cpp:3619]
UE4Editor_Renderer!<lambda_ead3a0042dfdf5af6dd902d9545231b0>::operator() [SceneRendering.cpp:3889]
UE4Editor_Renderer!TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`35'::FDrawSceneCommandName,<lambda_ead3a0042dfdf5af6dd902d9545231b0> >::DoTask() [RenderingThread.h:183]
UE4Editor_Renderer!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`35'::FDrawSceneCommandName,<lambda_ead3a0042dfdf5af6dd902d9545231b0> > >::ExecuteTask() [TaskGraphInterfaces.h:886]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [TaskGraph.cpp:709]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [TaskGraph.cpp:601]
UE4Editor_RenderCore!RenderingThreadMain() [RenderingThread.cpp:373]
UE4Editor_RenderCore!FRenderingThread::Run() [RenderingThread.cpp:509]
UE4Editor_Core!FRunnableThreadWin::Run() [WindowsRunnableThread.cpp:86] 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-110868 in the post.

6
Login to Vote

By Design
ComponentUE - Graphics Features
Affects Versions4.26.1
Target Fix4.27
CreatedMar 16, 2021
ResolvedApr 1, 2021
UpdatedJun 15, 2022