From ac0d5b6b119e21b84f687b1b38a22c6f09332a12 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 3 Mar 2020 14:06:26 +0100 Subject: [PATCH] radv/sqtt: describe render pass color/depthstencil clears Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/layers/radv_sqtt_layer.c | 14 ++++++++++++++ src/amd/vulkan/radv_meta_clear.c | 4 ++++ src/amd/vulkan/radv_private.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c index e962b27f65e..1d999c5917f 100644 --- a/src/amd/vulkan/layers/radv_sqtt_layer.c +++ b/src/amd/vulkan/layers/radv_sqtt_layer.c @@ -398,6 +398,20 @@ radv_describe_dispatch(struct radv_cmd_buffer *cmd_buffer, int x, int y, int z) x, y, z); } +void +radv_describe_begin_render_pass_clear(struct radv_cmd_buffer *cmd_buffer, + VkImageAspectFlagBits aspects) +{ + cmd_buffer->state.current_event_type = (aspects & VK_IMAGE_ASPECT_COLOR_BIT) ? + EventRenderPassColorClear : EventRenderPassDepthStencilClear; +} + +void +radv_describe_end_render_pass_clear(struct radv_cmd_buffer *cmd_buffer) +{ + cmd_buffer->state.current_event_type = EventInternalUnknown; +} + #define EVENT_MARKER(cmd_name, args...) \ RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); \ radv_write_begin_general_api_marker(cmd_buffer, ApiCmd##cmd_name); \ diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index 6a66665d06d..6d6f11b0662 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -1957,12 +1957,16 @@ radv_subpass_clear_attachment(struct radv_cmd_buffer *cmd_buffer, .layerCount = cmd_state->framebuffer->layers, }; + radv_describe_begin_render_pass_clear(cmd_buffer, clear_att->aspectMask); + emit_clear(cmd_buffer, clear_att, &clear_rect, pre_flush, post_flush, view_mask & ~attachment->cleared_views, ds_resolve_clear); if (view_mask) attachment->cleared_views |= view_mask; else attachment->pending_clear_aspects = 0; + + radv_describe_end_render_pass_clear(cmd_buffer); } /** diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 8817a743fb3..e4c6a67032c 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -2428,6 +2428,9 @@ void radv_describe_begin_cmd_buffer(struct radv_cmd_buffer *cmd_buffer); void radv_describe_end_cmd_buffer(struct radv_cmd_buffer *cmd_buffer); void radv_describe_draw(struct radv_cmd_buffer *cmd_buffer); void radv_describe_dispatch(struct radv_cmd_buffer *cmd_buffer, int x, int y, int z); +void radv_describe_begin_render_pass_clear(struct radv_cmd_buffer *cmd_buffer, + VkImageAspectFlagBits aspects); +void radv_describe_end_render_pass_clear(struct radv_cmd_buffer *cmd_buffer); struct radeon_winsys_sem; -- 2.30.2