1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +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; var totalIndex = 0;
while (totalIndex < this.vertices.Count) { while (totalIndex < this.vertices.Count) {
var now = Math.Min(this.vertices.Count - totalIndex, Data.Length); var now = Math.Min(this.vertices.Count - totalIndex, Data.Length);
for (var i = 0; i < now; i++) this.vertices.CopyTo(totalIndex, Data, 0, now);
Data[i] = this.vertices[totalIndex + i];
this.vertexBuffers[arrayIndex++].SetData(Data); this.vertexBuffers[arrayIndex++].SetData(Data);
totalIndex += now; totalIndex += now;
} }