Mesa (master): panfrost: Use NIR helper invocations info
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jul 25 13:35:57 UTC 2019
Module: Mesa
Branch: master
Commit: 48991c7a1f07dc00821e3505b5d13ffdd1143e07
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48991c7a1f07dc00821e3505b5d13ffdd1143e07
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Tue Jul 23 16:49:37 2019 -0700
panfrost: Use NIR helper invocations info
We don't need to guesstimate this ourselves. This will help when we
bringup derivatives.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
src/gallium/drivers/panfrost/pan_assemble.c | 1 +
src/gallium/drivers/panfrost/pan_context.c | 2 +-
src/gallium/drivers/panfrost/pan_context.h | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index 5e6f9448668..334ea83305a 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -94,6 +94,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m
state->can_discard = program.can_discard;
state->writes_point_size = program.writes_point_size;
state->reads_point_coord = false;
+ state->helper_invocations = s->info.fs.needs_helper_invocations;
/* Separate as primary uniform count is truncated */
state->uniform_count = program.uniform_count;
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 0035f700518..8c2953cc219 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1132,7 +1132,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
/* Any time texturing is used, derivatives are implicitly
* calculated, so we need to enable helper invocations */
- if (ctx->sampler_view_count[PIPE_SHADER_FRAGMENT])
+ if (variant->helper_invocations)
flags |= MALI_HELPER_INVOCATIONS;
ctx->fragment_shader_core.midgard1.flags = flags;
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 83128677b97..c294195b4b5 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -227,6 +227,9 @@ struct panfrost_shader_state {
uint16_t point_sprite_mask;
unsigned point_sprite_upper_left : 1;
+
+ /* Should we enable helper invocations */
+ bool helper_invocations;
};
/* A collection of varyings (the CSO) */
More information about the mesa-commit
mailing list