From: Samuel Pitoiset Date: Fri, 12 Jul 2019 16:12:36 +0000 (+0200) Subject: radv: add radv_emit_streamout_{begin,end} helpers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=afa102d65bb6df27b3cbbb78355101cdd2e139cf;p=mesa.git radv: add radv_emit_streamout_{begin,end} helpers Signed-off-by: Samuel Pitoiset Reviewed-by: Dave Airlie --- diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 4f8137906e3..6a0db2b67e9 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -5640,14 +5640,14 @@ static void radv_flush_vgt_streamout(struct radv_cmd_buffer *cmd_buffer) radeon_emit(cs, 4); /* poll interval */ } -void radv_CmdBeginTransformFeedbackEXT( - VkCommandBuffer commandBuffer, - uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VkBuffer* pCounterBuffers, - const VkDeviceSize* pCounterBufferOffsets) +static void +radv_emit_streamout_begin(struct radv_cmd_buffer *cmd_buffer, + uint32_t firstCounterBuffer, + uint32_t counterBufferCount, + const VkBuffer *pCounterBuffers, + const VkDeviceSize *pCounterBufferOffsets) + { - RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); struct radv_streamout_binding *sb = cmd_buffer->streamout_bindings; struct radv_streamout_state *so = &cmd_buffer->state.streamout; struct radeon_cmdbuf *cs = cmd_buffer->cs; @@ -5705,7 +5705,7 @@ void radv_CmdBeginTransformFeedbackEXT( radv_set_streamout_enable(cmd_buffer, true); } -void radv_CmdEndTransformFeedbackEXT( +void radv_CmdBeginTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, @@ -5713,6 +5713,19 @@ void radv_CmdEndTransformFeedbackEXT( const VkDeviceSize* pCounterBufferOffsets) { RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); + + radv_emit_streamout_begin(cmd_buffer, + firstCounterBuffer, counterBufferCount, + pCounterBuffers, pCounterBufferOffsets); +} + +static void +radv_emit_streamout_end(struct radv_cmd_buffer *cmd_buffer, + uint32_t firstCounterBuffer, + uint32_t counterBufferCount, + const VkBuffer *pCounterBuffers, + const VkDeviceSize *pCounterBufferOffsets) +{ struct radv_streamout_state *so = &cmd_buffer->state.streamout; struct radeon_cmdbuf *cs = cmd_buffer->cs; uint32_t i; @@ -5758,6 +5771,20 @@ void radv_CmdEndTransformFeedbackEXT( radv_set_streamout_enable(cmd_buffer, false); } +void radv_CmdEndTransformFeedbackEXT( + VkCommandBuffer commandBuffer, + uint32_t firstCounterBuffer, + uint32_t counterBufferCount, + const VkBuffer* pCounterBuffers, + const VkDeviceSize* pCounterBufferOffsets) +{ + RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); + + radv_emit_streamout_end(cmd_buffer, + firstCounterBuffer, counterBufferCount, + pCounterBuffers, pCounterBufferOffsets); +} + void radv_CmdDrawIndirectByteCountEXT( VkCommandBuffer commandBuffer, uint32_t instanceCount,