1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Always align texel buffers to at least 16 bytes

Since we don't know the view format in advance, and some
drivers require single-texel alignment.
This commit is contained in:
Philip Rebohle 2019-11-18 13:45:35 +01:00
parent 73a5b33375
commit cee7db1c57
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -126,8 +126,10 @@ namespace dxvk {
if (m_info.usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) if (m_info.usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT)
result = std::max(result, devInfo.limits.minStorageBufferOffsetAlignment); result = std::max(result, devInfo.limits.minStorageBufferOffsetAlignment);
if (m_info.usage & (VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT)) if (m_info.usage & (VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT)) {
result = std::max(result, devInfo.limits.minTexelBufferOffsetAlignment); result = std::max(result, devInfo.limits.minTexelBufferOffsetAlignment);
result = std::max(result, VkDeviceSize(16));
}
if (m_info.usage & (VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT) if (m_info.usage & (VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)
&& m_info.size > (devInfo.limits.optimalBufferCopyOffsetAlignment / 2)) && m_info.size > (devInfo.limits.optimalBufferCopyOffsetAlignment / 2))