diff --git a/src/common/vulkan/context.h b/src/common/vulkan/context.h index e08363676..7e95c6d43 100644 --- a/src/common/vulkan/context.h +++ b/src/common/vulkan/context.h @@ -97,7 +97,11 @@ public: } ALWAYS_INLINE VkDeviceSize GetTexelBufferAlignment() const { - return m_device_properties.limits.minUniformBufferOffsetAlignment; + return m_device_properties.limits.minTexelBufferOffsetAlignment; + } + ALWAYS_INLINE VkDeviceSize GetStorageBufferAlignment() const + { + return m_device_properties.limits.minStorageBufferOffsetAlignment; } ALWAYS_INLINE VkDeviceSize GetBufferImageGranularity() const { diff --git a/src/core/gpu_hw_vulkan.cpp b/src/core/gpu_hw_vulkan.cpp index 6df0d7229..abefcc9f7 100644 --- a/src/core/gpu_hw_vulkan.cpp +++ b/src/core/gpu_hw_vulkan.cpp @@ -1515,7 +1515,9 @@ void GPU_HW_Vulkan::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* } const u32 data_size = width * height * sizeof(u16); - const u32 alignment = std::max(sizeof(u16), static_cast(g_vulkan_context->GetTexelBufferAlignment())); + const u32 alignment = std::max(sizeof(u32), static_cast(m_use_ssbos_for_vram_writes ? + g_vulkan_context->GetStorageBufferAlignment() : + g_vulkan_context->GetTexelBufferAlignment())); if (!m_texture_stream_buffer.ReserveMemory(data_size, alignment)) { Log_PerfPrintf("Executing command buffer while waiting for %u bytes in stream buffer", data_size);