From d8d7ba8b5db38770667d0bfa6d7ac19f609fee3f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 21 Mar 2022 16:20:21 -0400 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_draw.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 3a04b4ef526..25f6c87ecad 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -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) {