commit | 39787acc39ae7468e4f6e699ab0ecd611f85406b | [log] [tgz] |
---|---|---|
author | Nicolas Capens <capn@google.com> | Wed Jul 27 12:29:52 2022 -0400 |
committer | Nicolas Capens <nicolascapens@google.com> | Fri Jul 29 04:20:24 2022 +0000 |
tree | 3a42cbf33309354191d8c928cc31847ba83eaec0 | |
parent | 2f0654a3371deda4d19809a6f48abc5c1ed246b1 [diff] |
Increase minImportedHostPointerAlignment to 4096 This is the value reported by practically all other implementations: https://vulkan.gpuinfo.org/displayextensionproperty.php?extensionname=VK_EXT_external_memory_host&extensionproperty=minImportedHostPointerAlignment This change also decouples it from internal alignment values. Bug: b/238916823 Change-Id: Ib261edf39b0ffb663b3780a44b837bc524307949 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/67108 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Sean Risser <srisser@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Vulkan/VkConfig.hpp b/src/Vulkan/VkConfig.hpp index fba81b4..71bfdeb 100644 --- a/src/Vulkan/VkConfig.hpp +++ b/src/Vulkan/VkConfig.hpp
@@ -37,6 +37,8 @@ // Alignment of all Vulkan objects, pools, device memory, images, buffers, descriptors. constexpr VkDeviceSize REQUIRED_MEMORY_ALIGNMENT = 16; // 16 bytes for 128-bit vector types. +constexpr VkDeviceSize MIN_IMPORTED_HOST_POINTER_ALIGNMENT = 4096; + // Vulkan 1.2 requires buffer offset alignment to be at most 256. constexpr VkDeviceSize MIN_TEXEL_BUFFER_OFFSET_ALIGNMENT = 256; constexpr VkDeviceSize MIN_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 256;
diff --git a/src/Vulkan/VkPhysicalDevice.cpp b/src/Vulkan/VkPhysicalDevice.cpp index 34465ba..84100a2 100644 --- a/src/Vulkan/VkPhysicalDevice.cpp +++ b/src/Vulkan/VkPhysicalDevice.cpp
@@ -1066,7 +1066,7 @@ void PhysicalDevice::getProperties(VkPhysicalDeviceExternalMemoryHostPropertiesEXT *properties) const { - properties->minImportedHostPointerAlignment = REQUIRED_MEMORY_ALIGNMENT; + properties->minImportedHostPointerAlignment = vk::MIN_IMPORTED_HOST_POINTER_ALIGNMENT; } template<typename T>