Groom crash with disabled card hair sections

On 5.6, we are getting the following fatal

Fatal error: [File:.\Runtime/RenderCore/Private/ShaderParameterStruct.cpp] [Line: 477]

FSkinUpdateCS’s required shader parameter FParameters::BoneMatrices was not set.

This is due to disabled sections in the HairGeometryCache for card hair not having any vertex factories, and thus no BoneMatrices. I do see that something close to this was fixed in UE maineline, but we’ve taken those preports and it is not changing this behavior. I’m curious if in FHairGeometryCache::GetOrAdd, when iterating over InLODData->RenderSections to add to the Data.RequestedSections if disabled sections should be ignored from that. Is there any reason to keep disabled sections in there? It’s failing on later iterations over that and there is no checks to guard a disabled section there.

Should clarify this is specifically the mesh the hair is being attached to having disabled sections it looks like.

Steps to Reproduce

Charles DeRousiers would seemingly know the most about this, but I don’t see him available. [mention removed]​ perhaps.

Hi, sorry for the late reply.

From what I can tell the issue arises when using a groom binding without skin cache (using “the hair manual skin cache”), but it is a general issue. The simplest solution we could find was to handle the issue at the source, within the groom binding builder, by not considering disabled sections. This makes the binding to only store data for valid section, making the current code work as expected.

A fix has been push in our mainline at CL 44625871 and will be part of 5.7. The change is relatively self contains, and should be easy to integrate on your side.

Please let me know if you have any question.

/Charles.

[mention removed]​ as well since this new IsValid check on the sections was introduced in FSkeletalMeshObjectGPUSkin::FVertexFactoryData::InitVertexFactories by you, which is what adds the null vertex factory causing this crash in the first place

Thanks Charles. Preporting this fixes the crash for us.