From e0335ad8881d3feeb89b571b1047bb8799ae23b7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 16 Oct 2021 16:14:00 -0400 Subject: [PATCH] panfrost: Fix gl_FragColor lowering The gl_FragColor lowering in the fragment shader depends on the number of render targets, which can change every set_framebuffer_state. set_framebuffer_state thus needs to force a rebind of the fragment shader. Fixes a regression in Piglit fbo-drawbuffers-none gl_FragColor -auto -fbo from enabling AFBC on Mali G52. Fixes: 28ac4d1e005 ("panfrost: Call nir_lower_fragcolor based on key") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 51d4530..69bbc43 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -688,11 +688,10 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx, } /* We may need to generate a new variant if the fragment shader is - * keyed to the framebuffer format (due to EXT_framebuffer_fetch) */ + * keyed to the framebuffer format or render target count */ struct panfrost_shader_variants *fs = ctx->shader[PIPE_SHADER_FRAGMENT]; - if (fs && fs->variant_count && - fs->variants[fs->active_variant].info.fs.outputs_read) + if (fs && fs->variant_count) ctx->base.bind_fs_state(&ctx->base, fs); } -- 2.7.4