From 75e4a861cb1b679a55a386b6fdac4aeb0dfbba17 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 18 Apr 2022 15:06:58 -0400 Subject: [PATCH] zink: always bind gfx pipeline at the top of draw at one point I thought it'd be cool to try and async compile a pipeline between shader bind and draw emit, but this is an unrealistic pipe dream that just makes things more complicated Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_draw.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index da2b53742e6..c1c0625ccaf 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -601,9 +601,7 @@ zink_draw(struct pipe_context *pctx, if (have_streamout && ctx->dirty_so_targets) zink_emit_stream_output_targets(pctx); - bool pipeline_changed = false; - if (DYNAMIC_STATE == ZINK_NO_DYNAMIC_STATE) - pipeline_changed = update_gfx_pipeline(ctx, batch->state, mode); + bool pipeline_changed = update_gfx_pipeline(ctx, batch->state, mode); if (BATCH_CHANGED || ctx->vp_state_changed || (DYNAMIC_STATE == ZINK_NO_DYNAMIC_STATE && pipeline_changed)) { VkViewport viewports[PIPE_MAX_VIEWPORTS]; @@ -759,10 +757,8 @@ zink_draw(struct pipe_context *pctx, zink_select_draw_vbo(ctx); } - if (DYNAMIC_STATE != ZINK_NO_DYNAMIC_STATE) { - update_gfx_pipeline(ctx, batch->state, mode); - if (BATCH_CHANGED || mode_changed) - VKCTX(CmdSetPrimitiveTopologyEXT)(batch->state->cmdbuf, zink_primitive_topology(mode)); + if (DYNAMIC_STATE != ZINK_NO_DYNAMIC_STATE && (BATCH_CHANGED || mode_changed)) { + VKCTX(CmdSetPrimitiveTopologyEXT)(batch->state->cmdbuf, zink_primitive_topology(mode)); } if (DYNAMIC_STATE >= ZINK_DYNAMIC_STATE2 && (BATCH_CHANGED || ctx->primitive_restart != dinfo->primitive_restart)) {