From: Samuel Pitoiset Date: Mon, 11 Sep 2017 12:50:12 +0000 (+0200) Subject: radv: add radv_cmd_buffer_after_draw() helper function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=061f5b7d73a975b82e22acfb99883c8f6e954472;p=mesa.git radv: add radv_cmd_buffer_after_draw() helper function To share common code after every draw/compute calls. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 2f030a2d8b5..bf6d157bf9a 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -365,6 +365,12 @@ void radv_cmd_buffer_trace_emit(struct radv_cmd_buffer *cmd_buffer) radeon_emit(cs, AC_ENCODE_TRACE_POINT(cmd_buffer->state.trace_id)); } +static void +radv_cmd_buffer_after_draw(struct radv_cmd_buffer *cmd_buffer) +{ + radv_cmd_buffer_trace_emit(cmd_buffer); +} + static void radv_save_pipeline(struct radv_cmd_buffer *cmd_buffer, struct radv_pipeline *pipeline, enum ring_type ring) @@ -2812,7 +2818,7 @@ void radv_CmdDraw( assert(cmd_buffer->cs->cdw <= cdw_max); - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } @@ -2878,7 +2884,7 @@ void radv_CmdDrawIndexed( } assert(cmd_buffer->cs->cdw <= cdw_max); - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } static void @@ -2963,7 +2969,7 @@ radv_emit_indirect_draw(struct radv_cmd_buffer *cmd_buffer, radv_cs_emit_indirect_draw_packet(cmd_buffer, indexed, draw_count, count_va, stride); } } - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } static void @@ -3115,7 +3121,7 @@ void radv_CmdDispatch( radeon_emit(cmd_buffer->cs, 1); assert(cmd_buffer->cs->cdw <= cdw_max); - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } void radv_CmdDispatchIndirect( @@ -3168,7 +3174,7 @@ void radv_CmdDispatchIndirect( } assert(cmd_buffer->cs->cdw <= cdw_max); - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } void radv_unaligned_dispatch( @@ -3225,7 +3231,7 @@ void radv_unaligned_dispatch( S_00B800_PARTIAL_TG_EN(1)); assert(cmd_buffer->cs->cdw <= cdw_max); - radv_cmd_buffer_trace_emit(cmd_buffer); + radv_cmd_buffer_after_draw(cmd_buffer); } void radv_CmdEndRenderPass(