Tidy up vertex attributes

This commit is contained in:
ackwell 2024-01-06 11:55:37 +11:00
parent 70a09264a8
commit b5b3e1b1f2
2 changed files with 55 additions and 66 deletions

View file

@ -655,13 +655,7 @@ public sealed partial class ModelManager : SingleTaskQueue, IDisposable
{
if (attribute == null) continue;
var element = attribute.Element;
// recreating this here really sucks - add a "withstream" or something.
attributes.Add(new VertexAttribute(
element with { Offset = offsets[element.Stream] },
attribute.Build,
attribute.HasMorph,
attribute.BuildMorph
));
attributes.Add(attribute.WithOffset(offsets[element.Stream]));
offsets[element.Stream] += attribute.Size;
}
var strides = offsets;