Module: Mesa
Branch: master
Commit: 2f44a76ab437cc8c3a600aeeb5e220aeb9f0a1a3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f44a76ab437cc8c3a600aeeb5e220aeb9f0a1a3

Author: Alyssa Rosenzweig <[email protected]>
Date:   Thu Aug 13 18:41:11 2020 -0400

panfrost: Set barriers flag for compute shaders

Pipe in the info from NIR. Fix incorrect handling of helper invocations,
which also use the barrier flag.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6312>

---

 src/gallium/drivers/panfrost/pan_assemble.c | 16 ++++++++++++----
 src/gallium/drivers/panfrost/pan_context.h  |  3 ---
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_assemble.c 
b/src/gallium/drivers/panfrost/pan_assemble.c
index bd8c0fd5718..771cb2d7f61 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -347,6 +347,8 @@ panfrost_shader_compile(struct panfrost_context *ctx,
                         s->info.writes_memory ||
                         s->info.fs.uses_discard ||
                         s->info.fs.uses_demote;
+
+                state->can_discard = s->info.fs.uses_discard;
                 break;
         case MESA_SHADER_COMPUTE:
                 attribute_count = util_bitcount(s->info.images_used);
@@ -356,10 +358,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
                 unreachable("Unknown shader state");
         }
 
-        state->can_discard = s->info.fs.uses_discard;
-        state->helper_invocations = s->info.fs.needs_quad_helper_invocations;
         state->stack_size = program->tls_size;
-
         state->reads_frag_coord = (s->info.inputs_read & (1 << 
VARYING_SLOT_POS)) ||
                                   BITSET_TEST(s->info.system_values_read, 
SYSTEM_VALUE_FRAG_COORD);
         state->reads_point_coord = s->info.inputs_read & (1 << 
VARYING_SLOT_PNTC);
@@ -411,8 +410,17 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         else
                 pan_prepare_midgard_props(state, program, stage);
 
+        state->properties.shader_contains_barrier =
+                s->info.uses_memory_barrier |
+                s->info.uses_control_barrier;
+
+        /* Ordering gaurantees are the same */
+        if (stage == MESA_SHADER_FRAGMENT) {
+                state->properties.shader_contains_barrier |=
+                       s->info.fs.needs_quad_helper_invocations;
+        }
+
         state->properties.stencil_from_shader = state->writes_stencil;
-        state->properties.shader_contains_barrier = state->helper_invocations;
         state->properties.depth_source = state->writes_depth ?
                                          MALI_DEPTH_SOURCE_SHADER :
                                          MALI_DEPTH_SOURCE_FIXED_FUNCTION;
diff --git a/src/gallium/drivers/panfrost/pan_context.h 
b/src/gallium/drivers/panfrost/pan_context.h
index c9fb1e3cfa6..c4a3cd7b9bf 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -245,9 +245,6 @@ struct panfrost_shader_state {
 
         struct panfrost_ubo_push push;
 
-        /* Should we enable helper invocations */
-        bool helper_invocations;
-
         /* GPU-executable memory */
         struct panfrost_bo *bo;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to