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: 43f40dc7cb "anv: Implement VK_EXT_inline_uniform_block"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand 2019-04-23 21:40:31 -05:00
parent 3d33c13eca
commit 45957c05b0

View file

@ -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) +