radv: do not recursively begin/end render pass for meta operations
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 10 Mar 2020 17:35:15 +0000 (18:35 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 07:54:43 +0000 (07:54 +0000)
To avoid breaking SQTT user markers that are emitted to report
barriers and layout transitions to RGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136>

src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_meta_blit.c
src/amd/vulkan/radv_meta_blit2d.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_meta_decompress.c
src/amd/vulkan/radv_meta_fast_clear.c
src/amd/vulkan/radv_meta_resolve.c
src/amd/vulkan/radv_meta_resolve_fs.c
src/amd/vulkan/radv_private.h

index c1ba099893bdc26b5e5279cd3b2ccf8d3c201783..c7b03fb19ad239431bd1d38b09263bf0c6da26ba 100644 (file)
@@ -4398,12 +4398,10 @@ radv_cmd_buffer_end_subpass(struct radv_cmd_buffer *cmd_buffer)
        }
 }
 
-void radv_CmdBeginRenderPass(
-       VkCommandBuffer                             commandBuffer,
-       const VkRenderPassBeginInfo*                pRenderPassBegin,
-       VkSubpassContents                           contents)
+void
+radv_cmd_buffer_begin_render_pass(struct radv_cmd_buffer *cmd_buffer,
+                                 const VkRenderPassBeginInfo *pRenderPassBegin)
 {
-       RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
        RADV_FROM_HANDLE(radv_render_pass, pass, pRenderPassBegin->renderPass);
        RADV_FROM_HANDLE(radv_framebuffer, framebuffer, pRenderPassBegin->framebuffer);
        VkResult result;
@@ -4419,6 +4417,16 @@ void radv_CmdBeginRenderPass(
        result = radv_cmd_state_setup_sample_locations(cmd_buffer, pass, pRenderPassBegin);
        if (result != VK_SUCCESS)
                return;
+}
+
+void radv_CmdBeginRenderPass(
+       VkCommandBuffer                             commandBuffer,
+       const VkRenderPassBeginInfo*                pRenderPassBegin,
+       VkSubpassContents                           contents)
+{
+       RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
+
+       radv_cmd_buffer_begin_render_pass(cmd_buffer, pRenderPassBegin);
 
        radv_cmd_buffer_begin_subpass(cmd_buffer, 0);
 }
@@ -5270,15 +5278,9 @@ void radv_unaligned_dispatch(
        radv_dispatch(cmd_buffer, &info);
 }
 
-void radv_CmdEndRenderPass(
-       VkCommandBuffer                             commandBuffer)
+void
+radv_cmd_buffer_end_render_pass(struct radv_cmd_buffer *cmd_buffer)
 {
-       RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
-
-       radv_subpass_barrier(cmd_buffer, &cmd_buffer->state.pass->end_barrier);
-
-       radv_cmd_buffer_end_subpass(cmd_buffer);
-
        vk_free(&cmd_buffer->pool->alloc, cmd_buffer->state.attachments);
        vk_free(&cmd_buffer->pool->alloc, cmd_buffer->state.subpass_sample_locs);
 
@@ -5289,6 +5291,18 @@ void radv_CmdEndRenderPass(
        cmd_buffer->state.subpass_sample_locs = NULL;
 }
 
+void radv_CmdEndRenderPass(
+       VkCommandBuffer                             commandBuffer)
+{
+       RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
+
+       radv_subpass_barrier(cmd_buffer, &cmd_buffer->state.pass->end_barrier);
+
+       radv_cmd_buffer_end_subpass(cmd_buffer);
+
+       radv_cmd_buffer_end_render_pass(cmd_buffer);
+}
+
 void radv_CmdEndRenderPass2(
     VkCommandBuffer                             commandBuffer,
     const VkSubpassEndInfo*                     pSubpassEndInfo)
index c19c1203db64f5f0c4992ee7b3e2c632ad15dbd3..b7a9205085e428280ab325fb37f50b4a65cddeff 100644 (file)
@@ -350,18 +350,18 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
                unsigned dst_layout = radv_meta_dst_layout_from_layout(dest_image_layout);
                fs_key = radv_format_meta_fs_key(dest_image->vk_format);
 
-               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                             &(VkRenderPassBeginInfo) {
-                                                     .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                                             .renderPass = device->meta_state.blit.render_pass[fs_key][dst_layout],
-                                                             .framebuffer = fb,
-                                                             .renderArea = {
-                                                             .offset = { dest_box.offset.x, dest_box.offset.y },
-                                                             .extent = { dest_box.extent.width, dest_box.extent.height },
-                                                     },
-                                                             .clearValueCount = 0,
-                                                                      .pClearValues = NULL,
-                                                      }, VK_SUBPASS_CONTENTS_INLINE);
+               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                 &(VkRenderPassBeginInfo) {
+                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                                               .renderPass = device->meta_state.blit.render_pass[fs_key][dst_layout],
+                                                               .framebuffer = fb,
+                                                               .renderArea = {
+                                                                       .offset = { dest_box.offset.x, dest_box.offset.y },
+                                                                       .extent = { dest_box.extent.width, dest_box.extent.height },
+                                                               },
+                                                       .clearValueCount = 0,
+                                                       .pClearValues = NULL,
+                                               });
                switch (src_image->type) {
                case VK_IMAGE_TYPE_1D:
                        pipeline = &device->meta_state.blit.pipeline_1d_src[fs_key];
@@ -379,18 +379,18 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
        }
        case VK_IMAGE_ASPECT_DEPTH_BIT: {
                enum radv_blit_ds_layout ds_layout = radv_meta_blit_ds_to_type(dest_image_layout);
-               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                             &(VkRenderPassBeginInfo) {
-                                                     .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                                             .renderPass = device->meta_state.blit.depth_only_rp[ds_layout],
-                                                             .framebuffer = fb,
-                                                             .renderArea = {
-                                                             .offset = { dest_box.offset.x, dest_box.offset.y },
-                                                             .extent = { dest_box.extent.width, dest_box.extent.height },
-                                                     },
-                                                             .clearValueCount = 0,
-                                                                      .pClearValues = NULL,
-                                                      }, VK_SUBPASS_CONTENTS_INLINE);
+               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                 &(VkRenderPassBeginInfo) {
+                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                                       .renderPass = device->meta_state.blit.depth_only_rp[ds_layout],
+                                                       .framebuffer = fb,
+                                                       .renderArea = {
+                                                               .offset = { dest_box.offset.x, dest_box.offset.y },
+                                                               .extent = { dest_box.extent.width, dest_box.extent.height },
+                                                       },
+                                                       .clearValueCount = 0,
+                                                       .pClearValues = NULL,
+                                                 });
                switch (src_image->type) {
                case VK_IMAGE_TYPE_1D:
                        pipeline = &device->meta_state.blit.depth_only_1d_pipeline;
@@ -408,18 +408,18 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
        }
        case VK_IMAGE_ASPECT_STENCIL_BIT: {
                enum radv_blit_ds_layout ds_layout = radv_meta_blit_ds_to_type(dest_image_layout);
-               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                             &(VkRenderPassBeginInfo) {
-                                                     .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                                             .renderPass = device->meta_state.blit.stencil_only_rp[ds_layout],
-                                                             .framebuffer = fb,
-                                                             .renderArea = {
-                                                             .offset = { dest_box.offset.x, dest_box.offset.y },
-                                                             .extent = { dest_box.extent.width, dest_box.extent.height },
-                                                             },
-                                                             .clearValueCount = 0,
-                                                                      .pClearValues = NULL,
-                                                      }, VK_SUBPASS_CONTENTS_INLINE);
+               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                 &(VkRenderPassBeginInfo) {
+                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                                       .renderPass = device->meta_state.blit.stencil_only_rp[ds_layout],
+                                                       .framebuffer = fb,
+                                                       .renderArea = {
+                                                               .offset = { dest_box.offset.x, dest_box.offset.y },
+                                                               .extent = { dest_box.extent.width, dest_box.extent.height },
+                                                       },
+                                                       .clearValueCount = 0,
+                                                       .pClearValues = NULL,
+                                                 });
                switch (src_image->type) {
                case VK_IMAGE_TYPE_1D:
                        pipeline = &device->meta_state.blit.stencil_only_1d_pipeline;
@@ -439,6 +439,9 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
                unreachable("bad VkImageType");
        }
 
+       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                   &cmd_buffer->state.pass->subpasses[0]);
+
        if (!*pipeline) {
                VkResult ret = build_pipeline(device, src_iview->aspect_mask, translate_sampler_dim(src_image->type), fs_key, pipeline);
                if (ret != VK_SUCCESS) {
@@ -491,7 +494,7 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
        radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
 
 fail_pipeline:
-       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+       radv_cmd_buffer_end_render_pass(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.
index 06d95ceeab47fc453b4ec4c655de32a7c0bb2d6f..38795038006d5cc35cdae2b109dad178e26112ed 100644 (file)
@@ -299,19 +299,21 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
                                        }
                                }
 
-                               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                                       &(VkRenderPassBeginInfo) {
-                                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                                 &(VkRenderPassBeginInfo) {
+                                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
                                                                        .renderPass = device->meta_state.blit2d_render_passes[fs_key][dst_layout],
                                                                        .framebuffer = dst_temps.fb,
                                                                        .renderArea = {
-                                                                       .offset = { rects[r].dst_x, rects[r].dst_y, },
-                                                                       .extent = { rects[r].width, rects[r].height },
-                                                               },
+                                                                               .offset = { rects[r].dst_x, rects[r].dst_y, },
+                                                                               .extent = { rects[r].width, rects[r].height },
+                                                                       },
                                                                        .clearValueCount = 0,
-                                                                               .pClearValues = NULL,
-                                                                               }, VK_SUBPASS_CONTENTS_INLINE);
+                                                                       .pClearValues = NULL,
+                                                                 });
 
+                               radv_cmd_buffer_set_subpass(cmd_buffer,
+                                                           &cmd_buffer->state.pass->subpasses[0]);
 
                                bind_pipeline(cmd_buffer, src_type, fs_key, log2_samples);
                        } else if (aspect_mask == VK_IMAGE_ASPECT_DEPTH_BIT) {
@@ -325,19 +327,21 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
                                        }
                                }
 
-                               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                                       &(VkRenderPassBeginInfo) {
-                                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                                 &(VkRenderPassBeginInfo) {
+                                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
                                                                        .renderPass = device->meta_state.blit2d_depth_only_rp[ds_layout],
                                                                        .framebuffer = dst_temps.fb,
                                                                        .renderArea = {
-                                                                       .offset = { rects[r].dst_x, rects[r].dst_y, },
-                                                                       .extent = { rects[r].width, rects[r].height },
-                                                               },
+                                                                               .offset = { rects[r].dst_x, rects[r].dst_y, },
+                                                                               .extent = { rects[r].width, rects[r].height },
+                                                                       },
                                                                        .clearValueCount = 0,
-                                                                               .pClearValues = NULL,
-                                                                               }, VK_SUBPASS_CONTENTS_INLINE);
+                                                                       .pClearValues = NULL,
+                                                                 });
 
+                               radv_cmd_buffer_set_subpass(cmd_buffer,
+                                                           &cmd_buffer->state.pass->subpasses[0]);
 
                                bind_depth_pipeline(cmd_buffer, src_type, log2_samples);
 
@@ -352,19 +356,21 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
                                        }
                                }
 
-                               radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                                       &(VkRenderPassBeginInfo) {
-                                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                               radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                                 &(VkRenderPassBeginInfo) {
+                                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
                                                                        .renderPass = device->meta_state.blit2d_stencil_only_rp[ds_layout],
                                                                        .framebuffer = dst_temps.fb,
                                                                        .renderArea = {
-                                                                       .offset = { rects[r].dst_x, rects[r].dst_y, },
-                                                                       .extent = { rects[r].width, rects[r].height },
-                                                               },
+                                                                               .offset = { rects[r].dst_x, rects[r].dst_y, },
+                                                                               .extent = { rects[r].width, rects[r].height },
+                                                                       },
                                                                        .clearValueCount = 0,
-                                                                               .pClearValues = NULL,
-                                                                               }, VK_SUBPASS_CONTENTS_INLINE);
+                                                                       .pClearValues = NULL,
+                                                                  });
 
+                               radv_cmd_buffer_set_subpass(cmd_buffer,
+                                                           &cmd_buffer->state.pass->subpasses[0]);
 
                                bind_stencil_pipeline(cmd_buffer, src_type, log2_samples);
                        } else
@@ -387,7 +393,7 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
 
 
                        radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
-                       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+                       radv_cmd_buffer_end_render_pass(cmd_buffer);
 
 fail_pipeline:
                        /* At the point where we emit the draw call, all data from the
index 6d6f11b0662bc2b79ce72e8ac804b1116fa5f372..5ca510dfd626285227367e4c369297c5d55b372d 100644 (file)
@@ -2153,22 +2153,24 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer,
                              &cmd_buffer->pool->alloc,
                              &pass);
 
-       radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                               &(VkRenderPassBeginInfo) {
-                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+       radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                         &(VkRenderPassBeginInfo) {
+                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
                                                .renderArea = {
                                                .offset = { 0, 0, },
                                                .extent = {
                                                        .width = width,
                                                        .height = height,
+                                                       },
                                                },
-                                       },
                                                .renderPass = pass,
                                                .framebuffer = fb,
                                                .clearValueCount = 0,
                                                .pClearValues = NULL,
-                                               },
-                               VK_SUBPASS_CONTENTS_INLINE);
+                                        });
+
+       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                   &cmd_buffer->state.pass->subpasses[0]);
 
        VkClearAttachment clear_att = {
                .aspectMask = range->aspectMask,
@@ -2187,7 +2189,7 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer,
 
        emit_clear(cmd_buffer, &clear_att, &clear_rect, NULL, NULL, 0, false);
 
-       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+       radv_cmd_buffer_end_render_pass(cmd_buffer);
        radv_DestroyRenderPass(device_h, pass,
                               &cmd_buffer->pool->alloc);
        radv_DestroyFramebuffer(device_h, fb,
index d2cb3f089865c9fc12ecb77c7db6f11b12b97934..43412f69a639dd04c809831722473b53546afa57 100644 (file)
@@ -454,28 +454,29 @@ radv_process_depth_image_layer(struct radv_cmd_buffer *cmd_buffer,
                                        .layers = 1
                               }, &cmd_buffer->pool->alloc, &fb_h);
 
-       radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                               &(VkRenderPassBeginInfo) {
-                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                       .renderPass = state->depth_decomp[samples_log2].pass,
-                                       .framebuffer = fb_h,
-                                       .renderArea = {
-                                               .offset = {
-                                                       0,
-                                                       0,
+       radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                         &(VkRenderPassBeginInfo) {
+                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                               .renderPass = state->depth_decomp[samples_log2].pass,
+                                               .framebuffer = fb_h,
+                                               .renderArea = {
+                                                       .offset = {
+                                                               0,
+                                                               0,
+                                                       },
+                                                       .extent = {
+                                                               width,
+                                                               height,
+                                                       }
                                                },
-                                               .extent = {
-                                                       width,
-                                                       height,
-                                               }
-                                       },
-                                       .clearValueCount = 0,
-                                       .pClearValues = NULL,
-                               },
-                               VK_SUBPASS_CONTENTS_INLINE);
+                                               .clearValueCount = 0,
+                                               .pClearValues = NULL,
+                                       });
+       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                   &cmd_buffer->state.pass->subpasses[0]);
 
        radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
-       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+       radv_cmd_buffer_end_render_pass(cmd_buffer);
 
        radv_DestroyFramebuffer(radv_device_to_handle(device), fb_h,
                                &cmd_buffer->pool->alloc);
index 84646a8b5dd8193da7faa7837a035840d6932412..fc80aaf74c89845f45ee1a93f1fc10117c3614e4 100644 (file)
@@ -626,31 +626,28 @@ radv_process_color_image_layer(struct radv_cmd_buffer *cmd_buffer,
                                        .layers = 1
                                }, &cmd_buffer->pool->alloc, &fb_h);
 
-       radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                               &(VkRenderPassBeginInfo) {
-                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                       .renderPass = device->meta_state.fast_clear_flush.pass,
-                                       .framebuffer = fb_h,
-                                       .renderArea = {
-                                               .offset = {
-                                                       0,
-                                                       0,
+       radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                         &(VkRenderPassBeginInfo) {
+                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                               .renderPass = device->meta_state.fast_clear_flush.pass,
+                                               .framebuffer = fb_h,
+                                               .renderArea = {
+                                                       .offset = { 0, 0, },
+                                                       .extent = { width, height, }
                                                },
-                                               .extent = {
-                                                       width,
-                                                       height,
-                                               }
-                                       },
-                                       .clearValueCount = 0,
-                                       .pClearValues = NULL,
-                               }, VK_SUBPASS_CONTENTS_INLINE);
+                                               .clearValueCount = 0,
+                                               .pClearValues = NULL,
+                                       });
+
+       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                   &cmd_buffer->state.pass->subpasses[0]);
 
        radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
 
        cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB |
                                        RADV_CMD_FLAG_FLUSH_AND_INV_CB_META;
 
-       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+       radv_cmd_buffer_end_render_pass(cmd_buffer);
 
        radv_DestroyFramebuffer(radv_device_to_handle(device), fb_h,
                                &cmd_buffer->pool->alloc);
index ed66a911284677033f1adff5f29d05ce4bab4d1a..0a03e62f9cbd1ee334ed6123a62ed5705f8e1916 100644 (file)
@@ -609,25 +609,27 @@ void radv_CmdResolveImage(
                                               &cmd_buffer->pool->alloc,
                                               &fb_h);
 
-                       radv_CmdBeginRenderPass(cmd_buffer_h,
-                                                     &(VkRenderPassBeginInfo) {
-                                                             .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                                                     .renderPass = device->meta_state.resolve.pass[fs_key],
-                                                                     .framebuffer = fb_h,
-                                                                     .renderArea = {
-                                                                     .offset = {
-                                                                             dstOffset.x,
-                                                                             dstOffset.y,
-                                                                     },
-                                                                     .extent = {
-                                                                             extent.width,
-                                                                             extent.height,
+                       radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                         &(VkRenderPassBeginInfo) {
+                                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                                               .renderPass = device->meta_state.resolve.pass[fs_key],
+                                                               .framebuffer = fb_h,
+                                                               .renderArea = {
+                                                                       .offset = {
+                                                                               dstOffset.x,
+                                                                               dstOffset.y,
+                                                                       },
+                                                                       .extent = {
+                                                                               extent.width,
+                                                                               extent.height,
                                                                      }
-                                                             },
-                                                             .clearValueCount = 0,
-                                                             .pClearValues = NULL,
-                                                     },
-                                                     VK_SUBPASS_CONTENTS_INLINE);
+                                                               },
+                                                               .clearValueCount = 0,
+                                                               .pClearValues = NULL,
+                                                     });
+
+                       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                                   &cmd_buffer->state.pass->subpasses[0]);
 
                        emit_resolve(cmd_buffer,
                                     dest_iview.vk_format,
@@ -640,7 +642,7 @@ void radv_CmdResolveImage(
                                             .height = extent.height,
                                     });
 
-                       radv_CmdEndRenderPass(cmd_buffer_h);
+                       radv_cmd_buffer_end_render_pass(cmd_buffer);
 
                        radv_DestroyFramebuffer(device_h, fb_h,
                                                &cmd_buffer->pool->alloc);
index 2e8d40f04af24fb3c5b2158c75224a81b5d291a1..12ff91ab3f33ddf3e4a5ab05929304502d3b7b32 100644 (file)
@@ -1127,20 +1127,21 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                       .layers = 1
                                }, &cmd_buffer->pool->alloc, &fb);
 
-                       radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
-                                               &(VkRenderPassBeginInfo) {
-                                                       .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
-                                                               .renderPass = rp,
-                                                               .framebuffer = fb,
-                                                               .renderArea = {
-                                                               .offset = { dstOffset.x, dstOffset.y, },
-                                                               .extent = { extent.width, extent.height },
-                                                       },
+                       radv_cmd_buffer_begin_render_pass(cmd_buffer,
+                                                         &(VkRenderPassBeginInfo) {
+                                                               .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+                                                                       .renderPass = rp,
+                                                                       .framebuffer = fb,
+                                                                       .renderArea = {
+                                                                               .offset = { dstOffset.x, dstOffset.y, },
+                                                                               .extent = { extent.width, extent.height },
+                                                                       },
                                                                .clearValueCount = 0,
                                                                .pClearValues = NULL,
-                                               }, VK_SUBPASS_CONTENTS_INLINE);
-
+                                               });
 
+                       radv_cmd_buffer_set_subpass(cmd_buffer,
+                                                   &cmd_buffer->state.pass->subpasses[0]);
 
                        emit_resolve(cmd_buffer,
                                     &src_iview,
@@ -1149,7 +1150,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                     &(VkOffset2D) { dstOffset.x, dstOffset.y },
                                     &(VkExtent2D) { extent.width, extent.height });
 
-                       radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
+                       radv_cmd_buffer_end_render_pass(cmd_buffer);
 
                        radv_DestroyFramebuffer(radv_device_to_handle(cmd_buffer->device), fb, &cmd_buffer->pool->alloc);
                }
index 83a41a607a3bd3384ef23e7682833503b9564c2e..42a1a43249b215743f286b58ae83e53605aed4dc 100644 (file)
@@ -2487,6 +2487,10 @@ si_conv_gl_prim_to_vertices(unsigned gl_prim)
        }
 }
 
+void radv_cmd_buffer_begin_render_pass(struct radv_cmd_buffer *cmd_buffer,
+                                      const VkRenderPassBeginInfo *pRenderPassBegin);
+void radv_cmd_buffer_end_render_pass(struct radv_cmd_buffer *cmd_buffer);
+
 #define RADV_DEFINE_HANDLE_CASTS(__radv_type, __VkType)                \
                                                                \
        static inline struct __radv_type *                      \