[Mesa-dev] [PATCH 2/6] anv: make layout size computation helper available across compilation units

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Feb 27 19:34:31 UTC 2017


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
 src/intel/vulkan/anv_descriptor_set.c | 6 +++---
 src/intel/vulkan/anv_private.h        | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index 7853ec7dd9..fc8e523e05 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -391,8 +391,8 @@ struct pool_free_list_entry {
    uint32_t size;
 };
 
-static size_t
-layout_size(const struct anv_descriptor_set_layout *layout)
+size_t
+anv_descriptor_set_layout_size(const struct anv_descriptor_set_layout *layout)
 {
    return
       sizeof(struct anv_descriptor_set) +
@@ -412,7 +412,7 @@ anv_descriptor_set_create(struct anv_device *device,
                           struct anv_descriptor_set **out_set)
 {
    struct anv_descriptor_set *set;
-   const size_t size = layout_size(layout);
+   const size_t size = anv_descriptor_set_layout_size(layout);
 
    set = NULL;
    if (size <= pool->size - pool->next) {
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index a5d012773d..39d633e362 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -935,6 +935,9 @@ struct anv_descriptor_pool {
    char data[0];
 };
 
+size_t
+anv_descriptor_set_layout_size(const struct anv_descriptor_set_layout *layout);
+
 VkResult
 anv_descriptor_set_create(struct anv_device *device,
                           struct anv_descriptor_pool *pool,
-- 
2.11.0



More information about the mesa-dev mailing list