diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 3bc5068d..aeb85f92 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -2134,10 +2134,7 @@ namespace dxvk { VkDeviceSize size, const void* data) { bool isHostVisible = buffer->memFlags() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; - - bool replaceBuffer = (size == buffer->info().size) - && (size <= (1 << 18)) - && !isHostVisible; + bool replaceBuffer = size == buffer->info().size && !isHostVisible; DxvkBufferSliceHandle bufferSlice; DxvkCmdBuffer cmdBuffer; @@ -2165,34 +2162,11 @@ namespace dxvk { m_execBarriers.recordCommands(m_cmd); } - // 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. - // 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( - cmdBuffer, - bufferSlice.handle, - bufferSlice.offset, - bufferSlice.length, - data); - } else { - auto stagingSlice = m_staging.alloc(CACHE_LINE_SIZE, size); - auto stagingHandle = stagingSlice.getSliceHandle(); - - std::memcpy(stagingHandle.mapPtr, data, size); - - VkBufferCopy region; - region.srcOffset = stagingHandle.offset; - region.dstOffset = bufferSlice.offset; - region.size = size; - - m_cmd->cmdCopyBuffer(cmdBuffer, - stagingHandle.handle, bufferSlice.handle, 1, ®ion); - - m_cmd->trackResource(stagingSlice.buffer()); - } + m_cmd->cmdUpdateBuffer(cmdBuffer, + bufferSlice.handle, + bufferSlice.offset, + bufferSlice.length, + data); auto& barriers = replaceBuffer ? m_initBarriers