Module: Mesa
Branch: main
Commit: 1cdadbcdf6231d9973bd5bdbc9c0723ec75e4c9d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1cdadbcdf6231d9973bd5bdbc9c0723ec75e4c9d

Author: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Date:   Fri Oct 20 14:04:28 2023 +0300

anv: move descriptor set type selection to earlier

Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Reviewed-by: Rohan Garg <rohan.g...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>

---

 src/intel/vulkan/anv_descriptor_set.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/intel/vulkan/anv_descriptor_set.c 
b/src/intel/vulkan/anv_descriptor_set.c
index 6e638c45e4a..71ca443f97d 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -510,6 +510,13 @@ VkResult anv_CreateDescriptorSetLayout(
    set_layout->binding_count = num_bindings;
    set_layout->flags = pCreateInfo->flags;
 
+   if (pCreateInfo->flags & 
VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT)
+      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_BUFFER;
+   else if (device->physical->indirect_descriptors)
+      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_INDIRECT;
+   else
+      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_DIRECT;
+
    for (uint32_t b = 0; b < num_bindings; b++) {
       /* Initialize all binding_layout entries to -1 */
       memset(&set_layout->binding[b], -1, sizeof(set_layout->binding[b]));
@@ -670,13 +677,6 @@ VkResult anv_CreateDescriptorSetLayout(
    set_layout->dynamic_offset_count = dynamic_offset_count;
    set_layout->descriptor_buffer_size = descriptor_buffer_size;
 
-   if (pCreateInfo->flags & 
VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT)
-      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_BUFFER;
-   else if (device->physical->indirect_descriptors)
-      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_INDIRECT;
-   else
-      set_layout->type = ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_DIRECT;
-
    *pSetLayout = anv_descriptor_set_layout_to_handle(set_layout);
 
    return VK_SUCCESS;

Reply via email to