radv: use push descriptors in meta
authorFredrik Höglund <fredrik@kde.org>
Thu, 13 Apr 2017 22:26:59 +0000 (00:26 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 14 Apr 2017 21:21:24 +0000 (23:21 +0200)
Use push descriptors instead of temp descriptor sets.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_blit.c
src/amd/vulkan/radv_meta_blit2d.c
src/amd/vulkan/radv_meta_buffer.c
src/amd/vulkan/radv_meta_bufimage.c
src/amd/vulkan/radv_meta_resolve_cs.c
src/amd/vulkan/radv_query.c

index 228aefaf4b63c9a8f8e4f5fe6cc25ca797891f84..a3256ab05cc1102b35b64b0a3afdf340381648b0 100644 (file)
@@ -307,31 +307,6 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
                                                 .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
                                                 }, &cmd_buffer->pool->alloc, &sampler);
 
-       VkDescriptorSet set;
-       radv_temp_descriptor_set_create(cmd_buffer->device, cmd_buffer,
-                                               device->meta_state.blit.ds_layout,
-                                               &set);
-
-       radv_UpdateDescriptorSets(radv_device_to_handle(device),
-                                 1, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                         .dstSet = set,
-                                                         .dstBinding = 0,
-                                                         .dstArrayElement = 0,
-                                                         .descriptorCount = 1,
-                                                         .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
-                                                         .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = sampler,
-                                                                 .imageView = radv_image_view_to_handle(src_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
        VkFramebuffer fb;
        radv_CreateFramebuffer(radv_device_to_handle(device),
                               &(VkFramebufferCreateInfo) {
@@ -439,10 +414,26 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
                                     VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
        }
 
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_GRAPHICS,
-                                  device->meta_state.blit.pipeline_layout, 0, 1,
-                                  &set, 0, NULL);
+       radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
+                                     device->meta_state.blit.pipeline_layout,
+                                     0, /* set */
+                                     1, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
+                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                             {
+                                                                     .sampler = sampler,
+                                                                     .imageView = radv_image_view_to_handle(src_iview),
+                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                             },
+                                                     }
+                                             }
+                                     });
 
        radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
                .x = dest_offset_0.x,
@@ -471,7 +462,6 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
        /* TODO: above comment is not valid for at least descriptor sets/pools,
         * as we may not free them till after execution finishes. Check others. */
 
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, set);
        radv_DestroySampler(radv_device_to_handle(device), sampler,
                            &cmd_buffer->pool->alloc);
        radv_DestroyFramebuffer(radv_device_to_handle(device), fb,
@@ -1299,6 +1289,7 @@ radv_device_init_meta_blit_state(struct radv_device *device)
 
        VkDescriptorSetLayoutCreateInfo ds_layout_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 1,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
index e6848de7e9762c99e9833482d0d533f29f45c299..f69fec8ea66bc359bd34a39f1b9bb768abfe9136 100644 (file)
@@ -104,8 +104,6 @@ create_bview(struct radv_cmd_buffer *cmd_buffer,
 
 struct blit2d_src_temps {
        struct radv_image_view iview;
-
-       VkDescriptorSet set;
        struct radv_buffer_view bview;
 };
 
@@ -117,28 +115,24 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
                 enum blit2d_src_type src_type, VkFormat depth_format)
 {
        struct radv_device *device = cmd_buffer->device;
-       VkDevice vk_device = radv_device_to_handle(cmd_buffer->device);
 
        if (src_type == BLIT2D_SRC_TYPE_BUFFER) {
                create_bview(cmd_buffer, src_buf, &tmp->bview, depth_format);
 
-               radv_temp_descriptor_set_create(cmd_buffer->device, cmd_buffer,
-                                               device->meta_state.blit2d.ds_layouts[src_type],
-                                               &tmp->set);
-
-               radv_UpdateDescriptorSets(vk_device,
-                                         1, /* writeCount */
-                                         (VkWriteDescriptorSet[]) {
-                                                 {
-                                                         .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                         .dstSet = tmp->set,
-                                                         .dstBinding = 0,
-                                                         .dstArrayElement = 0,
-                                                         .descriptorCount = 1,
-                                                         .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
-                                                         .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->bview) }
-                                                 }
-                                         }, 0, NULL);
+               radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
+                                             device->meta_state.blit2d.p_layouts[src_type],
+                                             0, /* set */
+                                             1, /* descriptorWriteCount */
+                                             (VkWriteDescriptorSet[]) {
+                                                     {
+                                                             .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                             .dstBinding = 0,
+                                                             .dstArrayElement = 0,
+                                                             .descriptorCount = 1,
+                                                             .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
+                                                             .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->bview) }
+                                                     }
+                                             });
 
                radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
                                      device->meta_state.blit2d.p_layouts[src_type],
@@ -148,44 +142,27 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
                create_iview(cmd_buffer, src_img, VK_IMAGE_USAGE_SAMPLED_BIT, &tmp->iview,
                             depth_format);
 
-               radv_temp_descriptor_set_create(cmd_buffer->device, cmd_buffer,
-                                               device->meta_state.blit2d.ds_layouts[src_type],
-                                               &tmp->set);
-
-               radv_UpdateDescriptorSets(vk_device,
-                                         1, /* writeCount */
-                                         (VkWriteDescriptorSet[]) {
-                                                 {
-                                                         .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                                 .dstSet = tmp->set,
-                                                                 .dstBinding = 0,
-                                                                 .dstArrayElement = 0,
-                                                                 .descriptorCount = 1,
-                                                                 .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-                                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                                 {
-                                                                         .sampler = VK_NULL_HANDLE,
-                                                                         .imageView = radv_image_view_to_handle(&tmp->iview),
-                                                                         .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                                 },
-                                                         }
-                                                 }
-                                         }, 0, NULL);
-
+               radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
+                                             device->meta_state.blit2d.p_layouts[src_type],
+                                             0, /* set */
+                                             1, /* descriptorWriteCount */
+                                             (VkWriteDescriptorSet[]) {
+                                                     {
+                                                             .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                             .dstBinding = 0,
+                                                             .dstArrayElement = 0,
+                                                             .descriptorCount = 1,
+                                                             .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+                                                             .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                                     {
+                                                                             .sampler = VK_NULL_HANDLE,
+                                                                             .imageView = radv_image_view_to_handle(&tmp->iview),
+                                                                             .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                                     },
+                                                             }
+                                                     }
+                                             });
        }
-
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_GRAPHICS,
-                                  device->meta_state.blit2d.p_layouts[src_type], 0, 1,
-                                  &tmp->set, 0, NULL);
-}
-
-static void
-blit2d_unbind_src(struct radv_cmd_buffer *cmd_buffer,
-                  struct blit2d_src_temps *tmp,
-                  enum blit2d_src_type src_type)
-{
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, tmp->set);
 }
 
 struct blit2d_dst_temps {
@@ -430,7 +407,6 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
                /* At the point where we emit the draw call, all data from the
                 * descriptor sets, etc. has been used.  We are free to delete it.
                 */
-               blit2d_unbind_src(cmd_buffer, &src_temps, src_type);
                blit2d_unbind_dst(cmd_buffer, &dst_temps);
        }
 }
@@ -1228,6 +1204,7 @@ radv_device_init_meta_blit2d_state(struct radv_device *device)
        result = radv_CreateDescriptorSetLayout(radv_device_to_handle(device),
                                                &(VkDescriptorSetLayoutCreateInfo) {
                                                        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+                                                       .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                                                                .bindingCount = 1,
                                                                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                                                                {
@@ -1255,6 +1232,7 @@ radv_device_init_meta_blit2d_state(struct radv_device *device)
        result = radv_CreateDescriptorSetLayout(radv_device_to_handle(device),
                                                &(VkDescriptorSetLayoutCreateInfo) {
                                                        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+                                                       .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                                                                .bindingCount = 1,
                                                                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                                                                {
index cb13f2f288f1cb118c0e8ea4bd328f5a91c4ebf4..0bb926fa902a91a897bd55e5b42816b58b14417c 100644 (file)
@@ -126,6 +126,7 @@ VkResult radv_device_init_meta_buffer_state(struct radv_device *device)
 
        VkDescriptorSetLayoutCreateInfo fill_ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 1,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -147,6 +148,7 @@ VkResult radv_device_init_meta_buffer_state(struct radv_device *device)
 
        VkDescriptorSetLayoutCreateInfo copy_ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -297,46 +299,37 @@ static void fill_buffer_shader(struct radv_cmd_buffer *cmd_buffer,
        struct radv_device *device = cmd_buffer->device;
        uint64_t block_count = round_up_u64(size, 1024);
        struct radv_meta_saved_compute_state saved_state;
-       VkDescriptorSet ds;
 
        radv_meta_save_compute(&saved_state, cmd_buffer, 4);
 
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.buffer.fill_ds_layout,
-                                       &ds);
-
        struct radv_buffer dst_buffer = {
                .bo = bo,
                .offset = offset,
                .size = size
        };
 
-       radv_UpdateDescriptorSets(radv_device_to_handle(device),
-                                 1, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = ds,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
-                                                 .pBufferInfo = &(VkDescriptorBufferInfo) {
-                                                       .buffer = radv_buffer_to_handle(&dst_buffer),
-                                                       .offset = 0,
-                                                       .range = size
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
                             VK_PIPELINE_BIND_POINT_COMPUTE,
                             device->meta_state.buffer.fill_pipeline);
 
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.buffer.fill_p_layout, 0, 1,
-                                  &ds, 0, NULL);
+       radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.buffer.fill_p_layout,
+                                     0, /* set */
+                                     1, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
+                                                     .pBufferInfo = &(VkDescriptorBufferInfo) {
+                                                             .buffer = radv_buffer_to_handle(&dst_buffer),
+                                                             .offset = 0,
+                                                             .range = size
+                                                     }
+                                             }
+                                     });
 
        radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
                              device->meta_state.buffer.fill_p_layout,
@@ -345,8 +338,6 @@ static void fill_buffer_shader(struct radv_cmd_buffer *cmd_buffer,
 
        radv_CmdDispatch(radv_cmd_buffer_to_handle(cmd_buffer), block_count, 1, 1);
 
-       radv_temp_descriptor_set_destroy(device, ds);
-
        radv_meta_restore_compute(&saved_state, cmd_buffer, 4);
 }
 
@@ -359,14 +350,9 @@ static void copy_buffer_shader(struct radv_cmd_buffer *cmd_buffer,
        struct radv_device *device = cmd_buffer->device;
        uint64_t block_count = round_up_u64(size, 1024);
        struct radv_meta_saved_compute_state saved_state;
-       VkDescriptorSet ds;
 
        radv_meta_save_compute(&saved_state, cmd_buffer, 0);
 
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.buffer.copy_ds_layout,
-                                       &ds);
-
        struct radv_buffer dst_buffer = {
                .bo = dst_bo,
                .offset = dst_offset,
@@ -379,51 +365,43 @@ static void copy_buffer_shader(struct radv_cmd_buffer *cmd_buffer,
                .size = size
        };
 
-       radv_UpdateDescriptorSets(radv_device_to_handle(device),
-                                 2, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = ds,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
-                                                 .pBufferInfo = &(VkDescriptorBufferInfo) {
-                                                       .buffer = radv_buffer_to_handle(&dst_buffer),
-                                                       .offset = 0,
-                                                       .range = size
-                                                 }
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = ds,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
-                                                 .pBufferInfo = &(VkDescriptorBufferInfo) {
-                                                       .buffer = radv_buffer_to_handle(&src_buffer),
-                                                       .offset = 0,
-                                                       .range = size
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
                             VK_PIPELINE_BIND_POINT_COMPUTE,
                             device->meta_state.buffer.copy_pipeline);
 
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.buffer.copy_p_layout, 0, 1,
-                                  &ds, 0, NULL);
-
+       radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.buffer.copy_p_layout,
+                                     0, /* set */
+                                     2, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
+                                                     .pBufferInfo = &(VkDescriptorBufferInfo) {
+                                                             .buffer = radv_buffer_to_handle(&dst_buffer),
+                                                             .offset = 0,
+                                                             .range = size
+                                                     }
+                                             },
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 1,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
+                                                     .pBufferInfo = &(VkDescriptorBufferInfo) {
+                                                             .buffer = radv_buffer_to_handle(&src_buffer),
+                                                             .offset = 0,
+                                                             .range = size
+                                                     }
+                                             }
+                                     });
 
        radv_CmdDispatch(radv_cmd_buffer_to_handle(cmd_buffer), block_count, 1, 1);
 
-       radv_temp_descriptor_set_destroy(device, ds);
-
        radv_meta_restore_compute(&saved_state, cmd_buffer, 0);
 }
 
index 4cdd070354785edbee0150f39cbb17675c3978c7..09a29d2d0cfdf31bd538b1cb525b03794b7ab88b 100644 (file)
@@ -133,6 +133,7 @@ radv_device_init_meta_itob_state(struct radv_device *device)
         */
        VkDescriptorSetLayoutCreateInfo ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -328,6 +329,7 @@ radv_device_init_meta_btoi_state(struct radv_device *device)
         */
        VkDescriptorSetLayoutCreateInfo ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -517,6 +519,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device)
         */
        VkDescriptorSetLayoutCreateInfo ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -670,6 +673,7 @@ radv_device_init_meta_cleari_state(struct radv_device *device)
         */
        VkDescriptorSetLayoutCreateInfo ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 1,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -883,7 +887,6 @@ create_bview(struct radv_cmd_buffer *cmd_buffer,
 struct itob_temps {
        struct radv_image_view src_iview;
        struct radv_buffer_view dst_bview;
-       VkDescriptorSet set;
 };
 
 static void
@@ -891,45 +894,36 @@ itob_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
                      struct itob_temps *tmp)
 {
        struct radv_device *device = cmd_buffer->device;
-       VkDevice vk_device = radv_device_to_handle(cmd_buffer->device);
-
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.itob.img_ds_layout,
-                                       &tmp->set);
-
-       radv_UpdateDescriptorSets(vk_device,
-                                 2, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&tmp->src_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
-                                                 .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->dst_bview) },
-                                         }
-                                 }, 0, NULL);
-
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.itob.img_p_layout, 0, 1,
-                                  &tmp->set, 0, NULL);
+
+       radv_meta_push_descriptor_set(cmd_buffer,
+                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.itob.img_p_layout,
+                                     0, /* set */
+                                     2, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                             {
+                                                                     .sampler = VK_NULL_HANDLE,
+                                                                     .imageView = radv_image_view_to_handle(&tmp->src_iview),
+                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                             },
+                                                     }
+                                             },
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 1,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
+                                                     .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->dst_bview) },
+                                             }
+                                     });
 }
 
 static void
@@ -973,13 +967,11 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
 
                radv_unaligned_dispatch(cmd_buffer, rects[r].width, rects[r].height, 1);
        }
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
 }
 
 struct btoi_temps {
        struct radv_buffer_view src_bview;
        struct radv_image_view dst_iview;
-       VkDescriptorSet set;
 };
 
 static void
@@ -987,45 +979,36 @@ btoi_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
                      struct btoi_temps *tmp)
 {
        struct radv_device *device = cmd_buffer->device;
-       VkDevice vk_device = radv_device_to_handle(cmd_buffer->device);
-
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.btoi.img_ds_layout,
-                                       &tmp->set);
-
-       radv_UpdateDescriptorSets(vk_device,
-                                 2, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
-                                                 .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->src_bview) },
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&tmp->dst_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.btoi.img_p_layout, 0, 1,
-                                  &tmp->set, 0, NULL);
+
+       radv_meta_push_descriptor_set(cmd_buffer,
+                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.btoi.img_p_layout,
+                                     0, /* set */
+                                     2, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
+                                                     .pTexelBufferView = (VkBufferView[])  { radv_buffer_view_to_handle(&tmp->src_bview) },
+                                             },
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 1,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                             {
+                                                                     .sampler = VK_NULL_HANDLE,
+                                                                     .imageView = radv_image_view_to_handle(&tmp->dst_iview),
+                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                             },
+                                                     }
+                                             }
+                                     });
 }
 
 static void
@@ -1069,13 +1052,11 @@ radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
 
                radv_unaligned_dispatch(cmd_buffer, rects[r].width, rects[r].height, 1);
        }
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
 }
 
 struct itoi_temps {
        struct radv_image_view src_iview;
        struct radv_image_view dst_iview;
-       VkDescriptorSet set;
 };
 
 static void
@@ -1083,51 +1064,42 @@ itoi_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
                      struct itoi_temps *tmp)
 {
        struct radv_device *device = cmd_buffer->device;
-       VkDevice vk_device = radv_device_to_handle(cmd_buffer->device);
-
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.itoi.img_ds_layout,
-                                       &tmp->set);
-
-       radv_UpdateDescriptorSets(vk_device,
-                                 2, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&tmp->src_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&tmp->dst_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.itoi.img_p_layout, 0, 1,
-                                  &tmp->set, 0, NULL);
+
+       radv_meta_push_descriptor_set(cmd_buffer,
+                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.itoi.img_p_layout,
+                                     0, /* set */
+                                     2, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                      .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                      .dstBinding = 0,
+                                                      .dstArrayElement = 0,
+                                                      .descriptorCount = 1,
+                                                      .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+                                                      .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                              {
+                                                                      .sampler = VK_NULL_HANDLE,
+                                                                      .imageView = radv_image_view_to_handle(&tmp->src_iview),
+                                                                      .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                              },
+                                                      }
+                                             },
+                                             {
+                                                      .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                      .dstBinding = 1,
+                                                      .dstArrayElement = 0,
+                                                      .descriptorCount = 1,
+                                                      .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+                                                      .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                              {
+                                                                      .sampler = VK_NULL_HANDLE,
+                                                                      .imageView = radv_image_view_to_handle(&tmp->dst_iview),
+                                                                      .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                              },
+                                                      }
+                                             }
+                                     });
 }
 
 static void
@@ -1173,49 +1145,35 @@ radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
 
                radv_unaligned_dispatch(cmd_buffer, rects[r].width, rects[r].height, 1);
        }
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
 }
 
-struct cleari_temps {
-       struct radv_image_view dst_iview;
-       VkDescriptorSet set;
-};
-
 static void
 cleari_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
-                       struct cleari_temps *tmp)
+                       struct radv_image_view *dst_iview)
 {
        struct radv_device *device = cmd_buffer->device;
-       VkDevice vk_device = radv_device_to_handle(cmd_buffer->device);
-
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.cleari.img_ds_layout,
-                                       &tmp->set);
-
-       radv_UpdateDescriptorSets(vk_device,
-                                 1, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = tmp->set,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&tmp->dst_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         },
-                                 }, 0, NULL);
-
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.cleari.img_p_layout, 0, 1,
-                                  &tmp->set, 0, NULL);
+
+       radv_meta_push_descriptor_set(cmd_buffer,
+                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.cleari.img_p_layout,
+                                     0, /* set */
+                                     1, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                              {
+                                                                     .sampler = VK_NULL_HANDLE,
+                                                                     .imageView = radv_image_view_to_handle(dst_iview),
+                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                              },
+                                                     }
+                                              },
+                                     });
 }
 
 static void
@@ -1236,10 +1194,10 @@ radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
                         const VkClearColorValue *clear_color)
 {
        struct radv_device *device = cmd_buffer->device;
-       struct cleari_temps temps;
+       struct radv_image_view dst_iview;
 
-       create_iview(cmd_buffer, dst, VK_IMAGE_USAGE_STORAGE_BIT, &temps.dst_iview);
-       cleari_bind_descriptors(cmd_buffer, &temps);
+       create_iview(cmd_buffer, dst, VK_IMAGE_USAGE_STORAGE_BIT, &dst_iview);
+       cleari_bind_descriptors(cmd_buffer, &dst_iview);
 
        cleari_bind_pipeline(cmd_buffer);
 
@@ -1256,5 +1214,4 @@ radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
                              push_constants);
 
        radv_unaligned_dispatch(cmd_buffer, dst->image->extent.width, dst->image->extent.height, 1);
-       radv_temp_descriptor_set_destroy(cmd_buffer->device, temps.set);
 }
index dc0672ec98851ab576c908f243a35c6dcc4d3a67..ffa07cac5f1d633717de4bd9a3ddc17f057fe013 100644 (file)
@@ -179,6 +179,7 @@ create_layout(struct radv_device *device)
         */
        VkDescriptorSetLayoutCreateInfo ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -369,7 +370,6 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                     ++layer) {
 
                        struct radv_image_view src_iview;
-                       VkDescriptorSet set;
                        radv_image_view_init(&src_iview, cmd_buffer->device,
                                             &(VkImageViewCreateInfo) {
                                                     .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
@@ -404,49 +404,41 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                             cmd_buffer, VK_IMAGE_USAGE_STORAGE_BIT);
 
 
-                       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                                       device->meta_state.resolve_compute.ds_layout,
-                                                       &set);
-
-                       radv_UpdateDescriptorSets(radv_device_to_handle(device),
-                                                 2, /* writeCount */
-                                                 (VkWriteDescriptorSet[]) {
-                                                 {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = set,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&src_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = set,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
-                                                 .pImageInfo = (VkDescriptorImageInfo[]) {
-                                                         {
-                                                                 .sampler = VK_NULL_HANDLE,
-                                                                 .imageView = radv_image_view_to_handle(&dest_iview),
-                                                                 .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
-                                                         },
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
-                       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                                  device->meta_state.resolve_compute.p_layout, 0, 1,
-                                                  &set, 0, NULL);
+                       radv_meta_push_descriptor_set(cmd_buffer,
+                                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                                     device->meta_state.resolve_compute.p_layout,
+                                                     0, /* set */
+                                                     2, /* descriptorWriteCount */
+                                                     (VkWriteDescriptorSet[]) {
+                                                             {
+                                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                                     .dstBinding = 0,
+                                                                     .dstArrayElement = 0,
+                                                                     .descriptorCount = 1,
+                                                                     .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+                                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                                             {
+                                                                                     .sampler = VK_NULL_HANDLE,
+                                                                                     .imageView = radv_image_view_to_handle(&src_iview),
+                                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                                             },
+                                                                     }
+                                                             },
+                                                             {
+                                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                                     .dstBinding = 1,
+                                                                     .dstArrayElement = 0,
+                                                                     .descriptorCount = 1,
+                                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+                                                                     .pImageInfo = (VkDescriptorImageInfo[]) {
+                                                                             {
+                                                                                     .sampler = VK_NULL_HANDLE,
+                                                                                     .imageView = radv_image_view_to_handle(&dest_iview),
+                                                                                     .imageLayout = VK_IMAGE_LAYOUT_GENERAL,
+                                                                             },
+                                                                     }
+                                                             }
+                                                     });
 
                        VkPipeline pipeline;
                        if (vk_format_is_int(src_image->vk_format))
@@ -469,7 +461,6 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                              VK_SHADER_STAGE_COMPUTE_BIT, 0, 16,
                                              push_constants);
                        radv_unaligned_dispatch(cmd_buffer, extent.width, extent.height, 1);
-                       radv_temp_descriptor_set_destroy(cmd_buffer->device, set);
                }
        }
        radv_meta_restore_compute(&saved_state, cmd_buffer, 16);
index fa5a3b6df24cf536b62a1814b05d2fb28c39ce6f..7e0fd1d073f2fdab49e4e940d1b883635cb68686 100644 (file)
@@ -529,6 +529,7 @@ VkResult radv_device_init_meta_query_state(struct radv_device *device)
 
        VkDescriptorSetLayoutCreateInfo occlusion_ds_create_info = {
                .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+               .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
                .bindingCount = 2,
                .pBindings = (VkDescriptorSetLayoutBinding[]) {
                        {
@@ -656,14 +657,9 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
 {
        struct radv_device *device = cmd_buffer->device;
        struct radv_meta_saved_compute_state saved_state;
-       VkDescriptorSet ds;
 
        radv_meta_save_compute(&saved_state, cmd_buffer, 4);
 
-       radv_temp_descriptor_set_create(device, cmd_buffer,
-                                       device->meta_state.query.ds_layout,
-                                       &ds);
-
        struct radv_buffer dst_buffer = {
                .bo = dst_bo,
                .offset = dst_offset,
@@ -676,44 +672,40 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
                .size = MAX2(src_stride * count, avail_offset + 4 * count - src_offset)
        };
 
-       radv_UpdateDescriptorSets(radv_device_to_handle(device),
-                                 2, /* writeCount */
-                                 (VkWriteDescriptorSet[]) {
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = ds,
-                                                 .dstBinding = 0,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
-                                                 .pBufferInfo = &(VkDescriptorBufferInfo) {
-                                                       .buffer = radv_buffer_to_handle(&dst_buffer),
-                                                       .offset = 0,
-                                                       .range = VK_WHOLE_SIZE
-                                                 }
-                                         },
-                                         {
-                                                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
-                                                 .dstSet = ds,
-                                                 .dstBinding = 1,
-                                                 .dstArrayElement = 0,
-                                                 .descriptorCount = 1,
-                                                 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
-                                                 .pBufferInfo = &(VkDescriptorBufferInfo) {
-                                                       .buffer = radv_buffer_to_handle(&src_buffer),
-                                                       .offset = 0,
-                                                       .range = VK_WHOLE_SIZE
-                                                 }
-                                         }
-                                 }, 0, NULL);
-
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
                             VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
 
-       radv_CmdBindDescriptorSets(radv_cmd_buffer_to_handle(cmd_buffer),
-                                  VK_PIPELINE_BIND_POINT_COMPUTE,
-                                  device->meta_state.query.p_layout, 0, 1,
-                                  &ds, 0, NULL);
+       radv_meta_push_descriptor_set(cmd_buffer,
+                                     VK_PIPELINE_BIND_POINT_COMPUTE,
+                                     device->meta_state.query.p_layout,
+                                     0, /* set */
+                                     2, /* descriptorWriteCount */
+                                     (VkWriteDescriptorSet[]) {
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 0,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
+                                                     .pBufferInfo = &(VkDescriptorBufferInfo) {
+                                                             .buffer = radv_buffer_to_handle(&dst_buffer),
+                                                             .offset = 0,
+                                                             .range = VK_WHOLE_SIZE
+                                                     }
+                                             },
+                                             {
+                                                     .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+                                                     .dstBinding = 1,
+                                                     .dstArrayElement = 0,
+                                                     .descriptorCount = 1,
+                                                     .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
+                                                     .pBufferInfo = &(VkDescriptorBufferInfo) {
+                                                             .buffer = radv_buffer_to_handle(&src_buffer),
+                                                             .offset = 0,
+                                                             .range = VK_WHOLE_SIZE
+                                                     }
+                                             }
+                                     });
 
        /* Encode the number of elements for easy access by the shader. */
        pipeline_stats_mask &= 0x7ff;
@@ -750,8 +742,6 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
                                        RADV_CMD_FLAG_INV_VMEM_L1 |
                                        RADV_CMD_FLAG_CS_PARTIAL_FLUSH;
 
-       radv_temp_descriptor_set_destroy(device, ds);
-
        radv_meta_restore_compute(&saved_state, cmd_buffer, 4);
 }