Skip to content

Commit

Permalink
[dxvk] Limit vkCmdUpdateBuffer size to 4kB
Browse files Browse the repository at this point in the history
This should help prevent issues with command buffers becoming
too big. Larger uploads will use a staging buffer instead.
  • Loading branch information
doitsujin committed Jan 13, 2018
1 parent 198c938 commit e05c961
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dxvk/dxvk_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e05c961

Please sign in to comment.