From 6f3b46dc29fd54bf781c05024263e38e6c5596ea Mon Sep 17 00:00:00 2001 From: Peng Date: Thu, 6 May 2021 16:36:13 -0700 Subject: [PATCH] ATOM-15266 [RHI][Vulkan][Android] Use warning on fragment pool error due to recreation of the memory pool in subsequent step JIRA: https://jira.agscollab.com/browse/ATOM-15266 --- .../Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp | 11 ++++++++++- Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.cpp | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp index 8eee7ef726..8769aaa1f9 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp @@ -239,7 +239,16 @@ namespace AZ allocInfo.pSetLayouts = &nativeLayout; VkResult result = vkAllocateDescriptorSets(descriptor.m_device->GetNativeDevice(), &allocInfo, &m_nativeDescriptorSet); - AssertSuccess(result); + if (result == VK_ERROR_FRAGMENTED_POOL) + { + // fragmented pool will be re-created subsequently, so warning only + AZ_Warning("Vulkan RHI", false, "Fragmented pool"); + } + else + { + AssertSuccess(result); + } + if (result != VK_SUCCESS) { return result; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.cpp index 90a4c2f9c2..311d3436de 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/Vulkan.cpp @@ -96,6 +96,8 @@ namespace AZ return "Validation failed"; case VK_ERROR_OUT_OF_POOL_MEMORY: return "Pool is out of memory"; + case VK_ERROR_FRAGMENTED_POOL: + return "Fragmented pool"; default: return "Unknown error"; }