Mesa (master): panfrost: Generate shader variants on framebuffer bind
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 13 14:04:07 UTC 2020
Module: Mesa
Branch: master
Commit: b9869e0e5e632893994a2d70cbf352b078c6c642
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9869e0e5e632893994a2d70cbf352b078c6c642
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Fri Jul 10 12:12:14 2020 -0400
panfrost: Generate shader variants on framebuffer bind
If we keyed the shader for the framebuffer.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
---
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 *
More information about the mesa-commit
mailing list