From 31ada2b7cfa3149fa66e3eeeafbbf0b2096af4ba Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Fri, 9 Apr 2021 11:57:06 +0200 Subject: [PATCH] radv: Take image alignment into account when allocating MUTABLE pool. Allocating a descriptor set is aligned to 32 bytes, so just like the other buffer types, bump the descriptor size to 32 bytes when allocating MUTABLE descriptor types from a pool. Fixes: 86644b84b94 ("radv: Implement VK_VALVE_mutable_descriptor_type.") Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit b60bc59180abbe4277c72fb25b085896ae7744d7) --- .pick_status.json | 2 +- src/amd/vulkan/radv_descriptor_set.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index d52ea1755d9..1719f0d1394 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1084,7 +1084,7 @@ "description": "radv: Take image alignment into account when allocating MUTABLE pool.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "86644b84b94910ddb78b7a1117b8bcf55bb76265" }, diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c index 25b14939e8f..be8782ddca5 100644 --- a/src/amd/vulkan/radv_descriptor_set.c +++ b/src/amd/vulkan/radv_descriptor_set.c @@ -756,6 +756,8 @@ radv_CreateDescriptorPool(VkDevice _device, const VkDescriptorPoolCreateInfo *pC if (radv_mutable_descriptor_type_size_alignment( &mutable_info->pMutableDescriptorTypeLists[i], &mutable_size, &mutable_alignment)) { + /* 32 as we may need to align for images */ + mutable_size = align(mutable_size, 32); bo_size += mutable_size * pCreateInfo->pPoolSizes[i].descriptorCount; } } else {