[d3d11] Only use updateBuffer for very small buffer updates

Otherwise we may end up with significant copy overhead on the CS thread.
This commit is contained in:
Philip Rebohle 2022-02-12 14:34:54 +01:00
parent ac9ed96457
commit 26381fd5df
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 3 additions and 2 deletions

View File

@ -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);