diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 59c3f9bed4e..757c6efc494 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -485,12 +485,21 @@ panfrost_bind_shader_state( ctx->dirty |= PAN_DIRTY_TLS_SIZE; ctx->dirty_shader[type] |= PAN_DIRTY_STAGE_SHADER; - if (!hwcso) return; + if (hwcso) + panfrost_update_shader_variant(ctx, type); +} + +void +panfrost_update_shader_variant(struct panfrost_context *ctx, + enum pipe_shader_type type) +{ + /* No shader variants for compute */ + if (type == PIPE_SHADER_COMPUTE) + return; /* Match the appropriate variant */ - signed variant = -1; - struct panfrost_shader_variants *variants = (struct panfrost_shader_variants *) hwcso; + struct panfrost_shader_variants *variants = ctx->shader[type]; simple_mtx_lock(&variants->lock); diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index a1791452786..b6465e11011 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -373,6 +373,9 @@ panfrost_flush( bool panfrost_render_condition_check(struct panfrost_context *ctx); +void +panfrost_update_shader_variant(struct panfrost_context *ctx, + enum pipe_shader_type type); void panfrost_shader_compile(struct pipe_screen *pscreen, struct panfrost_pool *shader_pool,