1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 22:18:34 +01:00

copy vertex data more efficiently

This commit is contained in:
Ell 2021-10-20 15:34:21 +02:00
parent 04dc2bf2d0
commit e5593f2132

View file

@ -77,8 +77,7 @@ namespace MLEM.Misc {
var totalIndex = 0;
while (totalIndex < this.vertices.Count) {
var now = Math.Min(this.vertices.Count - totalIndex, Data.Length);
for (var i = 0; i < now; i++)
Data[i] = this.vertices[totalIndex + i];
this.vertices.CopyTo(totalIndex, Data, 0, now);
this.vertexBuffers[arrayIndex++].SetData(Data);
totalIndex += now;
}