use element-wise buffer upload in GetBufferData

refresh2
cosmonaut 2024-02-23 15:40:18 -08:00
parent b8bbbe2327
commit 52f4e361ae
1 changed files with 5 additions and 2 deletions

View File

@ -90,10 +90,13 @@ namespace MoonWorks.Test
var lastTwoSpan = otherVerts.Slice(1, 2);
transferBuffer.SetData(lastTwoSpan, SetDataOptions.Overwrite);
cmdbuf.BeginCopyPass();
cmdbuf.UploadToBuffer(
cmdbuf.UploadToBuffer<PositionVertex>(
transferBuffer,
vertexBuffer,
new BufferCopy(0, (uint) (vertexSize * (vertices.Length - 2)), (uint) (vertexSize * 2)));
0,
(uint)(vertices.Length - 2),
2
);
cmdbuf.EndCopyPass();
fence = GraphicsDevice.SubmitAndAcquireFence(cmdbuf);
GraphicsDevice.WaitForFences(fence);