panfrost: Generate shader variants on framebuffer bind

If we keyed the shader for the framebuffer.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
This commit is contained in:
Alyssa Rosenzweig 2020-07-10 12:12:14 -04:00 committed by Marge Bot
parent a3952e927e
commit b9869e0e5e

View file

@ -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 *