panfrost: Refactor variant rebind code

For point sprite lowering on Bifrost and Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16173>
This commit is contained in:
Alyssa Rosenzweig
2022-04-26 15:46:00 -04:00
parent 39788ac703
commit b6909ebb36
2 changed files with 15 additions and 3 deletions
+12 -3
View File
@@ -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);
@@ -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,