From 52f4e361ae03717a02ba69daabf89c407bb07070 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 23 Feb 2024 15:40:18 -0800 Subject: [PATCH] use element-wise buffer upload in GetBufferData --- GetBufferData/GetBufferDataGame.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GetBufferData/GetBufferDataGame.cs b/GetBufferData/GetBufferDataGame.cs index 46b1d89..5f52767 100644 --- a/GetBufferData/GetBufferDataGame.cs +++ b/GetBufferData/GetBufferDataGame.cs @@ -90,10 +90,13 @@ namespace MoonWorks.Test var lastTwoSpan = otherVerts.Slice(1, 2); transferBuffer.SetData(lastTwoSpan, SetDataOptions.Overwrite); cmdbuf.BeginCopyPass(); - cmdbuf.UploadToBuffer( + cmdbuf.UploadToBuffer( 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);