zink: create compute pipeline after updating shader variants

it turns out shader variants don't work if you generate them after you
determine which variant to use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15501>
This commit is contained in:
Mike Blumenkrantz
2022-03-21 16:20:21 -04:00
committed by Marge Bot
parent 582e7f1599
commit d8d7ba8b5d

View File

@@ -964,20 +964,20 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
zink_program_update_compute_pipeline_state(ctx, ctx->curr_compute, info->block);
VkPipeline prev_pipeline = ctx->compute_pipeline_state.pipeline;
VkPipeline pipeline = zink_get_compute_pipeline(screen, ctx->curr_compute,
&ctx->compute_pipeline_state);
if (BATCH_CHANGED) {
zink_update_descriptor_refs(ctx, true);
zink_batch_reference_program(&ctx->batch, &ctx->curr_compute->base);
}
if (ctx->dirty_shader_stages & BITFIELD_BIT(PIPE_SHADER_COMPUTE)) {
/* update inlinable constants */
zink_update_compute_program(ctx);
ctx->dirty_shader_stages &= ~BITFIELD_BIT(PIPE_SHADER_COMPUTE);
}
VkPipeline pipeline = zink_get_compute_pipeline(screen, ctx->curr_compute,
&ctx->compute_pipeline_state);
if (prev_pipeline != pipeline || BATCH_CHANGED)
VKCTX(CmdBindPipeline)(batch->state->cmdbuf, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
if (BATCH_CHANGED) {