Mesa (master): anv: Align inline uniform data to ANV_UBO_ALIGNMENT

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 25 19:09:05 UTC 2021


Module: Mesa
Branch: master
Commit: 82b25a1d7577704c8e4e83cce9355361e3b09d67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=82b25a1d7577704c8e4e83cce9355361e3b09d67

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Mar 25 13:07:17 2021 -0500

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 at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9837>

---

 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 =



More information about the mesa-commit mailing list