anv: Align inline uniform data to ANV_UBO_ALIGNMENT

If we're going to have a #define for UBO alignments, it's probably a
good idea to make sure everything is aligned to that.  This increases
the alignment from 32B to 64B but that shouldn't hurt anyone.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9837>
This commit is contained in:
Jason Ekstrand 2021-03-25 13:07:17 -05:00 committed by Marge Bot
parent 5ae276f7e0
commit 82b25a1d75

View File

@ -526,7 +526,8 @@ VkResult anv_CreateDescriptorSetLayout(
/* Inline uniform blocks are specified to use the descriptor array
* size as the size in bytes of the block.
*/
descriptor_buffer_size = align_u32(descriptor_buffer_size, 32);
descriptor_buffer_size = align_u32(descriptor_buffer_size,
ANV_UBO_ALIGNMENT);
set_layout->binding[b].descriptor_offset = descriptor_buffer_size;
descriptor_buffer_size += binding->descriptorCount;
} else {
@ -843,9 +844,11 @@ VkResult anv_CreateDescriptorPool(
* of them to 32B.
*/
descriptor_bo_size += 32 * pCreateInfo->maxSets;
/* We align inline uniform blocks to 32B */
if (inline_info)
descriptor_bo_size += 32 * inline_info->maxInlineUniformBlockBindings;
/* We align inline uniform blocks to ANV_UBO_ALIGNMENT */
if (inline_info) {
descriptor_bo_size +=
ANV_UBO_ALIGNMENT * inline_info->maxInlineUniformBlockBindings;
}
descriptor_bo_size = ALIGN(descriptor_bo_size, 4096);
const size_t pool_size =