Out of bounds access to DeformingInstanceViewMask when rendering a point light non-VSM shadow

Hi,

This is definitely an edge case (Nanite without VSM), but I noticed what seems to be a GPU OOB access when debugging something else:

There seems to be some missing setup in FSceneRenderer::RenderShadowDepthMaps where it never populates the SceneRendererPrimaryViewId of the Nanite::FPackedViewParams it creates, unlike in the VSM path which uses Nanite::SetCullingViewOverrides to do so. This results in the default -1 index reaching the shader which then causes the Nanite binning and culling code to read out of bounds when calling GetInstanceViewData() to test bIsDeforming.

This is difficult to verify and this code is complex, so it’s possible I’m missing some element here, but I wanted to report it since the issue still seems to be there in Main.

Thanks,

Lucas

[Attachment Removed]

Steps to Reproduce
Use a nanite skeletal mesh along with a point light non-VSM shadow

[Attachment Removed]

Thanks for sharing this. I think that we may be experiencing sporadic crashes related to this. I’m testing a fix based on your analysis right now.

[Attachment Removed]

Hi Lucas, thanks for reporting this issue., it does look like something we’ll want to fix. I’ll follow up with an issue link for tracking after a couple more tests.

[Attachment Removed]