From e05c961b9eb80bf7ef0d9506067422d4e2947740 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 13 Jan 2018 23:41:36 +0100 Subject: [PATCH] [dxvk] Limit vkCmdUpdateBuffer size to 4kB This should help prevent issues with command buffers becoming too big. Larger uploads will use a staging buffer instead. --- src/dxvk/dxvk_context.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 8a780986542..e61089a7c2a 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -636,7 +636,9 @@ namespace dxvk { // Vulkan specifies that small amounts of data (up to 64kB) can // be copied to a buffer directly if the size is a multiple of // four. Anything else must be copied through a staging buffer. - if ((size <= 65536) && ((size & 0x3) == 0) && ((offset & 0x3) == 0)) { + // We'll limit the size to 4kB in order to keep command buffers + // reasonably small, we do not know how much data apps may upload. + if ((size <= 4096) && ((size & 0x3) == 0) && ((offset & 0x3) == 0)) { m_cmd->cmdUpdateBuffer( buffer->handle(), offset, size, data);