From ec28714b7810b07d48164f8efa90c8d47e65e19f Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Wed, 4 Dec 2019 14:29:58 -0500 Subject: [PATCH] turnip: allow writes to draw_cs outside of render pass This is for state commands like CmdSetViewport that can be used outside of a renderpass. Accumulating those into draw_cs outside of the renderpass should have the desired effect. Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt --- src/freedreno/vulkan/tu_cmd_buffer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 91baac6f7ec..5e93395dff5 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -1640,6 +1640,7 @@ tu_BeginCommandBuffer(VkCommandBuffer commandBuffer, cmd_buffer->usage_flags = pBeginInfo->flags; tu_cs_begin(&cmd_buffer->cs); + tu_cs_begin(&cmd_buffer->draw_cs); cmd_buffer->marker_seqno = 0; cmd_buffer->scratch_seqno = 0; @@ -1788,6 +1789,7 @@ tu_EndCommandBuffer(VkCommandBuffer commandBuffer) } tu_cs_end(&cmd_buffer->cs); + tu_cs_end(&cmd_buffer->draw_cs); assert(!cmd_buffer->state.attachments); @@ -2084,10 +2086,6 @@ tu_CmdBeginRenderPass(VkCommandBuffer commandBuffer, tu_cmd_update_tiling_config(cmd_buffer, &pRenderPassBegin->renderArea); tu_cmd_prepare_tile_load_ib(cmd_buffer); tu_cmd_prepare_tile_store_ib(cmd_buffer); - - /* draw_cs should contain entries only for this render pass */ - assert(!cmd_buffer->draw_cs.entry_count); - tu_cs_begin(&cmd_buffer->draw_cs); } void @@ -2988,6 +2986,7 @@ tu_CmdEndRenderPass(VkCommandBuffer commandBuffer) /* discard draw_cs entries now that the tiles are rendered */ tu_cs_discard_entries(&cmd_buffer->draw_cs); + tu_cs_begin(&cmd_buffer->draw_cs); vk_free(&cmd_buffer->pool->alloc, cmd_buffer->state.attachments); cmd_buffer->state.attachments = NULL; -- 2.30.2