Texture Collection crash while using shared sampler

[PCD3D_SM6]

BindlessResources=Enabled

BindlessSamplers=Enabled

; The lines below fix 5.7 bindless in materials

[ShaderPlatformConfig PCD3D_SM6]

bindlessconfiguration=Minimal

;end fix

[/Script/Engine.RendererSettings]

rhi.Bindless.Resources=Enabled

rhi.Bindless.Samplers=Enabled

rhi.Bindless=Enabled

[Attachment Removed]

Steps to Reproduce

  1. add two virtual texture collection parameter in material function
  2. change the sampler source to shared:wrap of Texture Sample nodes which are connect to TextureObjectFromCollection
  3. save the material function

[Image Removed]

[Attachment Removed]

if the default value of texture collection parameter set to DefaultTextureCollection, and change the parameter in material instance to a virtual texture collection asset, then the engine will crash

[Attachment Removed]

Apologies for the delay, I’ve verified the issue with swapping the DefaultTextureCollection in MIs still exists in latest and am testing some fixes.

[Attachment Removed]

I’ve created https://issues.unrealengine.com/issue/UE\-390625 which should be visible publicly soon for tracking. The ticket repro uses the material instance override crash method which I found reproduced the crash most reliably and with the same callstack. I wasn’t able to reproduce the crash that involved changing the sampler source in a Material Function, but it’s likely the same issue.

[Attachment Removed]

That’s correct, and the fix we’re most likely to implement is to not let the user override a parent material’s bindless TC (like the DefaultTextureCollection) with a VTC or visa-versa.

[Attachment Removed]

TC/VTC’s uniform buffer are not comptiable, that’s the root cause. why I met this problem with sampler type is the same issue , because I use TC as parameter default value, change to VTC in material instance, and ​it’s not take effect before I changed the sampler type, because there are a errror for the material if sampler type not set

[Attachment Removed]