From b9869e0e5e632893994a2d70cbf352b078c6c642 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 10 Jul 2020 12:12:14 -0400 Subject: [PATCH] panfrost: Generate shader variants on framebuffer bind If we keyed the shader for the framebuffer. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 56706a5fe46..70ef7249362 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1147,6 +1147,13 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx, util_copy_framebuffer_state(&ctx->pipe_framebuffer, fb); ctx->batch = NULL; panfrost_invalidate_frame(ctx); + + /* We may need to generate a new variant if the fragment shader is + * keyed to the framebuffer format (due to EXT_framebuffer_fetch) */ + struct panfrost_shader_variants *fs = ctx->shader[PIPE_SHADER_FRAGMENT]; + + if (fs && fs->variant_count && fs->variants[fs->active_variant].outputs_read) + ctx->base.bind_fs_state(&ctx->base, fs); } static void * -- 2.30.2