From 82b25a1d7577704c8e4e83cce9355361e3b09d67 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 25 Mar 2021 13:07:17 -0500 Subject: [PATCH] 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 Part-of: --- src/intel/vulkan/anv_descriptor_set.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index b92088c13b3..a543958f1c9 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -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 =