From b6909ebb36b7c0ee9a5efa89a4e48eb8f47fa0cd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 26 Apr 2022 15:46:00 -0400 Subject: [PATCH] panfrost: Refactor variant rebind code For point sprite lowering on Bifrost and Valhall. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 15 ++++++++++++--- src/gallium/drivers/panfrost/pan_context.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) 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,