Description

 "This ensure is intended to catch regressions where rendering programmers add a loose parameter to LocalVertexFactory, breaking dynamic instancing on regular static meshes.  InstancedStaticMeshes cannot be dynamically instanced so the warning should not be triggering for them.  Somehow we need the VF to communicate to this renderer code whether it expects to be dynamic instancing compatible or not, so we can implement the ensure properly.  Something like SupportsCachingMeshDrawCommands(), which is already checked.  Perhaps this is fixed in latest."

Steps to Reproduce
  1. Launch the debug editor (And attach the VisualStudio debugger)
  2. Create a Blueprint actor
  3. Add Instanced static mesh component in the Blueprint
  4. Assign a static mesh to the ISM
  5. Add an instance in the ISM details panel.

Result:

The following ensure condition failed occurs. (It is not an assert)

Ensure condition failed: SingleShaderBindings.GetParameterMapInfo().LooseParameterBuffers.Num() == 0 [File:E:/dev/UnrealEngine-4.26.1/Engine/Source/Runtime/Renderer/Private/PrimitiveSceneInfo.cpp] [Line: 326] 
Cached Mesh Draw command uses loose parameters.  This will break dynamic instancing in performance critical pass.  Use Uniform Buffers instead.
UE4Editor-Win64-Debug.exe has triggered a breakpoint.
Callstack

UE4Editor-Renderer-Win64-Debug.dll!FPrimitiveSceneInfo::CacheMeshDrawCommands::__l2::<lambda>(int Index) Line 326
UE4Editor-Renderer-Win64-Debug.dll!ParallelForImpl::ParallelForInternal<void <lambda>(int)>(int Num, FPrimitiveSceneInfo::CacheMeshDrawCommands::__l2::void <lambda>(int) Body, EParallelForFlags Flags) Line 215
UE4Editor-Renderer-Win64-Debug.dll!FPrimitiveSceneInfo::CacheMeshDrawCommands(FRHICommandListImmediate & RHICmdList, FScene * Scene, const TArrayView<FPrimitiveSceneInfo *,int> & SceneInfos) Line 388
UE4Editor-Renderer-Win64-Debug.dll!FPrimitiveSceneInfo::AddStaticMeshes(FRHICommandListImmediate & RHICmdList, FScene * Scene, const TArrayView<FPrimitiveSceneInfo *,int> & SceneInfos, bool bAddToStaticDrawLists) Line 550
UE4Editor-Renderer-Win64-Debug.dll!FPrimitiveSceneInfo::AddToScene(FRHICommandListImmediate & RHICmdList, FScene * Scene, const TArrayView<FPrimitiveSceneInfo *,int> & SceneInfos, bool bUpdateStaticDrawLists, bool bAddToStaticDrawLists, bool bAsyncCreateLPIs) Line 712
UE4Editor-Renderer-Win64-Debug.dll!FScene::UpdateAllPrimitiveSceneInfos(FRHICommandListImmediate & RHICmdList, bool bAsyncCreateLPIs) Line 4052
UE4Editor-Engine-Win64-Debug.dll!TEnqueueUniqueRenderCommandType<`UpdateAllPrimitiveSceneInfosForSingleComponent'::`8'::UpdateAllPrimitiveSceneInfosCmdName,<lambda_92c7ded15dc75266dc679e1140cf2e42>>::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 183
UE4Editor-Engine-Win64-Debug.dll!TGraphTask<TEnqueueUniqueRenderCommandType<`UpdateAllPrimitiveSceneInfosForSingleComponent'::`8'::UpdateAllPrimitiveSceneInfosCmdName,<lambda_92c7ded15dc75266dc679e1140cf2e42>>>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread) Line 888
UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 709
UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 601
UE4Editor-Core-Win64-Debug.dll!FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type CurrentThread) Line 1474
UE4Editor-RenderCore-Win64-Debug.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 373
UE4Editor-RenderCore-Win64-Debug.dll!FRenderingThread::Run() Line 528
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::Run() Line 84
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::GuardedRun() Line 27
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::_ThreadProc(void * pThis) Line 38

Have Comments or More Details?

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

14
Login to Vote

Cannot Reproduce
ComponentUE - Graphics Features
Affects Versions4.224.26
Target Fix4.26
CreatedSep 4, 2019
ResolvedAug 28, 2020
UpdatedMar 17, 2021
View Jira Issue