From 26381fd5df976cc20ab5a5ffc55143067e1e4972 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 12 Feb 2022 14:34:54 +0100 Subject: [PATCH] [d3d11] Only use updateBuffer for very small buffer updates Otherwise we may end up with significant copy overhead on the CS thread. --- src/d3d11/d3d11_context.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 3171db31..cc470eee 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -3572,8 +3572,9 @@ namespace dxvk { const void* pSrcData) { DxvkBufferSlice bufferSlice = pDstBuffer->GetBufferSlice(Offset, Length); - if (Length <= 65536) { - // The backend has special code paths for small buffer updates + if (Length <= 1024 && !(Offset & 0x3) && !(Length & 0x3)) { + // The backend has special code paths for small buffer updates, + // however both offset and size must be aligned to four bytes. DxvkDataSlice dataSlice = AllocUpdateBufferSlice(Length); std::memcpy(dataSlice.ptr(), pSrcData, Length);