diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index 9eabd90d913..e7393cd6688 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -322,7 +322,7 @@ namespace dxvk { } // Create global buffer if the allocation supports it - if (type.bufferUsage && !next) { + if (type.bufferUsage && !next && !(size & (GlobalBufferAlignment - 1u))) { VkBuffer buffer = VK_NULL_HANDLE; VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; diff --git a/src/dxvk/dxvk_memory.h b/src/dxvk/dxvk_memory.h index 4e55b4ed61c..59c45a8dad6 100644 --- a/src/dxvk/dxvk_memory.h +++ b/src/dxvk/dxvk_memory.h @@ -335,6 +335,10 @@ namespace dxvk { constexpr static VkDeviceSize MinChunkSize = 4ull << 20; constexpr static VkDeviceSize MaxChunkSize = 256ull << 20; + + // Assume an alignment of 256 bytes. This is enough to satisfy all + // buffer use cases, and matches our minimum allocation size. + constexpr static VkDeviceSize GlobalBufferAlignment = 256u; public: DxvkMemoryAllocator(DxvkDevice* device);