Packaged/Standalone crash when creating instanced static mesh with 500+ instances. UE 4.26.1

Reproduction steps:

  1. Create empty project

  2. Create empty actor

  3. Add HierarchicalInstancedStaticMesh component

  4. Add 500+ instances on beginplay

  5. Launch standalone/packaged

  6. Get Crash and Error

    Fatal error:
    [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/D3D11RHI/Private/D3D11Commands.cpp]
    [Line: 1431] Null SRV (resource 0 bind 0) on UB Layout
    FInstancedStaticMeshVertexFactoryUniformShaderParameters
    UE4Editor_D3D11RHI
    UE4Editor_D3D11RHI
    UE4Editor_D3D11RHI
    UE4Editor_D3D11RHI
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Renderer
    UE4Editor_Core
    UE4Editor_Core
    UE4Editor_RenderCore
    UE4Editor_RenderCore
    UE4Editor_Core
    UE4Editor_Core
    kernel32
    ntdll

The error only occurs on D3D11 and UE 4.26, 12 and 4.25 works fine.
The error does not occur if instances are added manually or on a construction script.

having the same problem, any fix for this?

Send a crash report and upvote this thread. Hopefully they will fix this for 4.26.3.

Btw, this happened on a newly installed windows, UE 4.26.2 and the latest (recommended )ATI drivers.

While waiting for a fix, a temporary solution is to stagger the instance creation.
I simply added a delay of 0s (1 frame) between every 100 instances. That seems to fix the problem. Might be a good idea anyways, especially if you’re spawning some ungodly amount of instances.

I have tried this solution, however it does not work, temp solution is Forced to use DX12. Create a shortcut of UE4Editor.exe and at Target add -dx12 at the end of line (after the “…” -dx12).