diff options
-rw-r--r-- | host/vulkan/VkDecoderGlobalState.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/host/vulkan/VkDecoderGlobalState.cpp b/host/vulkan/VkDecoderGlobalState.cpp index ce9251fe..ebfac077 100644 --- a/host/vulkan/VkDecoderGlobalState.cpp +++ b/host/vulkan/VkDecoderGlobalState.cpp @@ -1223,6 +1223,14 @@ class VkDecoderGlobalState::Impl { pMemoryProperties->memoryTypes[i].propertyFlags & ~(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); } + + // for AMD, zap the type that is is not on device + if (feature_is_enabled(kFeature_VulkanAllocateDeviceMemoryOnly)) { + auto memFlags = pMemoryProperties->memoryTypes[i].propertyFlags; + if (!(memFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { + pMemoryProperties->memoryTypes[i].propertyFlags = 0; + } + } } } @@ -1281,6 +1289,14 @@ class VkDecoderGlobalState::Impl { pMemoryProperties->memoryProperties.memoryTypes[i].propertyFlags & ~(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); } + + // for AMD, zap the type that is is not on device + if (feature_is_enabled(kFeature_VulkanAllocateDeviceMemoryOnly)) { + auto memFlags = pMemoryProperties->memoryProperties.memoryTypes[i].propertyFlags; + if (!(memFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { + pMemoryProperties->memoryProperties.memoryTypes[i].propertyFlags = 0; + } + } } } |