nvk: Expose nvk_descriptor_stride_align_for_type
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:11:47 +0000 (20:11 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:53 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/vulkan/nvk_descriptor_set_layout.c
src/nouveau/vulkan/nvk_descriptor_set_layout.h

index 1be1fa9..f1eeaab 100644 (file)
@@ -18,7 +18,7 @@ binding_has_immutable_samplers(const VkDescriptorSetLayoutBinding *binding) {
   }
 }
 
-static void descriptor_stride_align_for_type(
+void nvk_descriptor_stride_align_for_type(
     VkDescriptorType type, const VkMutableDescriptorTypeListVALVE *type_list,
     uint32_t *stride, uint32_t *align) {
   switch (type) {
@@ -54,8 +54,8 @@ static void descriptor_stride_align_for_type(
       assert(type_list->pDescriptorTypes[i] !=
              VK_DESCRIPTOR_TYPE_MUTABLE_VALVE);
       uint32_t desc_stride, desc_align;
-      descriptor_stride_align_for_type(type_list->pDescriptorTypes[i], NULL,
-                                       &desc_stride, &desc_align);
+      nvk_descriptor_stride_align_for_type(type_list->pDescriptorTypes[i],
+                                           NULL, &desc_stride, &desc_align);
       *stride = MAX2(*stride, desc_stride);
       *align = MAX2(*align, desc_align);
     }
@@ -163,8 +163,8 @@ VKAPI_ATTR VkResult VKAPI_CALL nvk_CreateDescriptorSetLayout(
     }
 
     uint32_t stride, align;
-    descriptor_stride_align_for_type(binding->descriptorType, type_list,
-                                     &stride, &align);
+    nvk_descriptor_stride_align_for_type(binding->descriptorType, type_list,
+                                         &stride, &align);
 
     layout->binding[b].offset = ALIGN_POT(buffer_size, align);
     layout->binding[b].stride = stride;
index 9adec0d..840f159 100644 (file)
@@ -50,6 +50,10 @@ struct nvk_descriptor_set_layout {
 VK_DEFINE_HANDLE_CASTS(nvk_descriptor_set_layout, base, VkDescriptorSetLayout,
                        VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT)
 
+void nvk_descriptor_stride_align_for_type(
+    VkDescriptorType type, const VkMutableDescriptorTypeListVALVE *type_list,
+    uint32_t *stride, uint32_t *align);
+
 void nvk_descriptor_set_layout_destroy(
     struct nvk_device *device, struct nvk_descriptor_set_layout *layout);