Mesa (master): anv/descriptor_set: Properly align descriptor buffer to a page

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 24 05:52:48 UTC 2019


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Tue Apr 23 21:40:31 2019 -0500

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 <lionel.g.landwerlin at intel.com>

---

 src/intel/vulkan/anv_descriptor_set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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




More information about the mesa-commit mailing list