radv: add radv_cmd_buffer_after_draw() helper function
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 11 Sep 2017 12:50:12 +0000 (14:50 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Sep 2017 08:37:57 +0000 (10:37 +0200)
To share common code after every draw/compute calls.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 2f030a2d8b57ee1595c29f45b8168b915b06d8d0..bf6d157bf9a7a7f9ec3be72a83a0c7fa935565af 100644 (file)
@@ -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(