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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16018>
This commit is contained in:
Mike Blumenkrantz 2022-04-18 15:06:58 -04:00 committed by Marge Bot
parent 3d97367a60
commit 75e4a861cb

View file

@ -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<BATCH_CHANGED>(ctx, batch->state, mode);
bool pipeline_changed = update_gfx_pipeline<BATCH_CHANGED>(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<BATCH_CHANGED>(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)) {