aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_blit.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-03-10 18:35:15 +0100
committerMarge Bot <[email protected]>2020-03-11 07:54:43 +0000
commitb6cebf64394858be8e896c73de7d896f2bb071f7 (patch)
tree915557fd52ae1fbfbb6a953a9f1133fcfc487872 /src/amd/vulkan/radv_meta_blit.c
parentc78e88e8a60fdc44cd5f95177a00aae480616559 (diff)
radv: do not recursively begin/end render pass for meta operations
To avoid breaking SQTT user markers that are emitted to report barriers and layout transitions to RGP. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136>
Diffstat (limited to 'src/amd/vulkan/radv_meta_blit.c')
-rw-r--r--src/amd/vulkan/radv_meta_blit.c77
1 files changed, 40 insertions, 37 deletions
diff --git a/src/amd/vulkan/radv_meta_blit.c b/src/amd/vulkan/radv_meta_blit.c
index c19c1203db6..b7a9205085e 100644
--- a/src/amd/vulkan/radv_meta_blit.c
+++ b/src/amd/vulkan/radv_meta_blit.c
@@ -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.