anv: Rework arguments to anv_descriptor_set_write_*
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Nov 2018 00:00:56 +0000 (18:00 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Mar 2019 16:06:50 +0000 (10:06 -0600)
Make them all take a device followed by a set.  This is consistent
with how the actual Vulkan entrypoint parameters are laid out.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/anv_descriptor_set.c
src/intel/vulkan/anv_private.h

index 53303e0e7455ea58f14e8f259cdb3082ea2b0ef7..afbdef7b7e40db84a8eba32c9410e341800535d8 100644 (file)
@@ -1025,7 +1025,7 @@ void anv_CmdPushDescriptorSetKHR(
       case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
       case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
          for (uint32_t j = 0; j < write->descriptorCount; j++) {
-            anv_descriptor_set_write_image_view(set, &cmd_buffer->device->info,
+            anv_descriptor_set_write_image_view(cmd_buffer->device, set,
                                                 write->pImageInfo + j,
                                                 write->descriptorType,
                                                 write->dstBinding,
@@ -1039,7 +1039,7 @@ void anv_CmdPushDescriptorSetKHR(
             ANV_FROM_HANDLE(anv_buffer_view, bview,
                             write->pTexelBufferView[j]);
 
-            anv_descriptor_set_write_buffer_view(set,
+            anv_descriptor_set_write_buffer_view(cmd_buffer->device, set,
                                                  write->descriptorType,
                                                  bview,
                                                  write->dstBinding,
@@ -1056,8 +1056,7 @@ void anv_CmdPushDescriptorSetKHR(
             ANV_FROM_HANDLE(anv_buffer, buffer, write->pBufferInfo[j].buffer);
             assert(buffer);
 
-            anv_descriptor_set_write_buffer(set,
-                                            cmd_buffer->device,
+            anv_descriptor_set_write_buffer(cmd_buffer->device, set,
                                             &cmd_buffer->surface_state_stream,
                                             write->descriptorType,
                                             buffer,
@@ -1106,8 +1105,7 @@ void anv_CmdPushDescriptorSetWithTemplateKHR(
    set->buffer_count = set_layout->buffer_count;
    set->buffer_views = push_set->buffer_views;
 
-   anv_descriptor_set_write_template(set,
-                                     cmd_buffer->device,
+   anv_descriptor_set_write_template(cmd_buffer->device, set,
                                      &cmd_buffer->surface_state_stream,
                                      template,
                                      pData);
index 31b6b039055cbadffb5782465c9d12c6b5a9da25..1bece393941adaee4328ba9e06e25c9682ddaad2 100644 (file)
@@ -712,8 +712,8 @@ VkResult anv_FreeDescriptorSets(
 }
 
 void
-anv_descriptor_set_write_image_view(struct anv_descriptor_set *set,
-                                    const struct gen_device_info * const devinfo,
+anv_descriptor_set_write_image_view(struct anv_device *device,
+                                    struct anv_descriptor_set *set,
                                     const VkDescriptorImageInfo * const info,
                                     VkDescriptorType type,
                                     uint32_t binding,
@@ -764,7 +764,8 @@ anv_descriptor_set_write_image_view(struct anv_descriptor_set *set,
 }
 
 void
-anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set,
+anv_descriptor_set_write_buffer_view(struct anv_device *device,
+                                     struct anv_descriptor_set *set,
                                      VkDescriptorType type,
                                      struct anv_buffer_view *buffer_view,
                                      uint32_t binding,
@@ -784,8 +785,8 @@ anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set,
 }
 
 void
-anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
-                                struct anv_device *device,
+anv_descriptor_set_write_buffer(struct anv_device *device,
+                                struct anv_descriptor_set *set,
                                 struct anv_state_stream *alloc_stream,
                                 VkDescriptorType type,
                                 struct anv_buffer *buffer,
@@ -855,7 +856,7 @@ void anv_UpdateDescriptorSets(
       case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
       case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
          for (uint32_t j = 0; j < write->descriptorCount; j++) {
-            anv_descriptor_set_write_image_view(set, &device->info,
+            anv_descriptor_set_write_image_view(device, set,
                                                 write->pImageInfo + j,
                                                 write->descriptorType,
                                                 write->dstBinding,
@@ -869,7 +870,7 @@ void anv_UpdateDescriptorSets(
             ANV_FROM_HANDLE(anv_buffer_view, bview,
                             write->pTexelBufferView[j]);
 
-            anv_descriptor_set_write_buffer_view(set,
+            anv_descriptor_set_write_buffer_view(device, set,
                                                  write->descriptorType,
                                                  bview,
                                                  write->dstBinding,
@@ -886,8 +887,7 @@ void anv_UpdateDescriptorSets(
             ANV_FROM_HANDLE(anv_buffer, buffer, write->pBufferInfo[j].buffer);
             assert(buffer);
 
-            anv_descriptor_set_write_buffer(set,
-                                            device,
+            anv_descriptor_set_write_buffer(device, set,
                                             NULL,
                                             write->descriptorType,
                                             buffer,
@@ -930,8 +930,8 @@ void anv_UpdateDescriptorSets(
  */
 
 void
-anv_descriptor_set_write_template(struct anv_descriptor_set *set,
-                                  struct anv_device *device,
+anv_descriptor_set_write_template(struct anv_device *device,
+                                  struct anv_descriptor_set *set,
                                   struct anv_state_stream *alloc_stream,
                                   const struct anv_descriptor_update_template *template,
                                   const void *data)
@@ -949,7 +949,7 @@ anv_descriptor_set_write_template(struct anv_descriptor_set *set,
          for (uint32_t j = 0; j < entry->array_count; j++) {
             const VkDescriptorImageInfo *info =
                data + entry->offset + j * entry->stride;
-            anv_descriptor_set_write_image_view(set, &device->info,
+            anv_descriptor_set_write_image_view(device, set,
                                                 info, entry->type,
                                                 entry->binding,
                                                 entry->array_element + j);
@@ -963,7 +963,7 @@ anv_descriptor_set_write_template(struct anv_descriptor_set *set,
                data + entry->offset + j * entry->stride;
             ANV_FROM_HANDLE(anv_buffer_view, bview, *_bview);
 
-            anv_descriptor_set_write_buffer_view(set,
+            anv_descriptor_set_write_buffer_view(device, set,
                                                  entry->type,
                                                  bview,
                                                  entry->binding,
@@ -980,8 +980,7 @@ anv_descriptor_set_write_template(struct anv_descriptor_set *set,
                data + entry->offset + j * entry->stride;
             ANV_FROM_HANDLE(anv_buffer, buffer, info->buffer);
 
-            anv_descriptor_set_write_buffer(set,
-                                            device,
+            anv_descriptor_set_write_buffer(device, set,
                                             alloc_stream,
                                             entry->type,
                                             buffer,
@@ -1062,5 +1061,5 @@ void anv_UpdateDescriptorSetWithTemplate(
    ANV_FROM_HANDLE(anv_descriptor_update_template, template,
                    descriptorUpdateTemplate);
 
-   anv_descriptor_set_write_template(set, device, NULL, template, pData);
+   anv_descriptor_set_write_template(device, set, NULL, template, pData);
 }
index 2746e443bc8a5f651de85eec7511063e785e387a..c997d79e0b6d726a0699cb4e8def9734c1fc7a7a 100644 (file)
@@ -1677,23 +1677,24 @@ size_t
 anv_descriptor_set_layout_size(const struct anv_descriptor_set_layout *layout);
 
 void
-anv_descriptor_set_write_image_view(struct anv_descriptor_set *set,
-                                    const struct gen_device_info * const devinfo,
+anv_descriptor_set_write_image_view(struct anv_device *device,
+                                    struct anv_descriptor_set *set,
                                     const VkDescriptorImageInfo * const info,
                                     VkDescriptorType type,
                                     uint32_t binding,
                                     uint32_t element);
 
 void
-anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set,
+anv_descriptor_set_write_buffer_view(struct anv_device *device,
+                                     struct anv_descriptor_set *set,
                                      VkDescriptorType type,
                                      struct anv_buffer_view *buffer_view,
                                      uint32_t binding,
                                      uint32_t element);
 
 void
-anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
-                                struct anv_device *device,
+anv_descriptor_set_write_buffer(struct anv_device *device,
+                                struct anv_descriptor_set *set,
                                 struct anv_state_stream *alloc_stream,
                                 VkDescriptorType type,
                                 struct anv_buffer *buffer,
@@ -1703,8 +1704,8 @@ anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
                                 VkDeviceSize range);
 
 void
-anv_descriptor_set_write_template(struct anv_descriptor_set *set,
-                                  struct anv_device *device,
+anv_descriptor_set_write_template(struct anv_device *device,
+                                  struct anv_descriptor_set *set,
                                   struct anv_state_stream *alloc_stream,
                                   const struct anv_descriptor_update_template *template,
                                   const void *data);