Add support for up to 65536 skeleton bones in skinned meshes

https://forum.flaxengine.com/t/import-fbx-with-bones-more-than-256/1196
This commit is contained in:
Wojtek Figat
2025-01-08 18:48:50 +01:00
parent 1f294605a3
commit 3505b8971b
6 changed files with 123 additions and 8 deletions

View File

@@ -126,6 +126,16 @@ String GPUVertexLayout::GetElementsString() const
return result;
}
VertexElement GPUVertexLayout::FindElement(VertexElement::Types type) const
{
for (const VertexElement& e : _elements)
{
if (e.Type == type)
return e;
}
return VertexElement();
}
GPUVertexLayout* GPUVertexLayout::Get(const Elements& elements, bool explicitOffsets)
{
// Hash input layout

View File

@@ -47,6 +47,13 @@ public:
return _stride;
}
/// <summary>
/// Searches for a given element type in a layout.
/// </summary>
/// <param name="type">The type of element to find.</param>
/// <returns>Found element with properties or empty if missing.</returns>
API_FUNCTION() VertexElement FindElement(VertexElement::Types type) const;
/// <summary>
/// Gets the vertex layout for a given list of elements. Uses internal cache to skip creating layout if it's already exists for a given list.
/// </summary>