From: Jason Ekstrand Date: Wed, 24 Apr 2019 02:40:31 +0000 (-0500) Subject: anv/descriptor_set: Properly align descriptor buffer to a page X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45957c05b06f6e05820a87276b682af110bb13a9;p=mesa.git anv/descriptor_set: Properly align descriptor buffer to a page Instead of aligning and then taking inline uniforms into account, we need to take inline uniforms into account and then align to a page. Otherwise, we may not be aligned to a page and allocation may fail. Fixes: 43f40dc7cb2 "anv: Implement VK_EXT_inline_uniform_block" Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 2d4d37febb5..63fd8c69608 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -676,10 +676,10 @@ VkResult anv_CreateDescriptorPool( * of them to 32B. */ descriptor_bo_size += 32 * pCreateInfo->maxSets; - descriptor_bo_size = ALIGN(descriptor_bo_size, 4096); /* We align inline uniform blocks to 32B */ if (inline_info) descriptor_bo_size += 32 * inline_info->maxInlineUniformBlockBindings; + descriptor_bo_size = ALIGN(descriptor_bo_size, 4096); const size_t pool_size = pCreateInfo->maxSets * sizeof(struct anv_descriptor_set) +