panfrost: Use NIR helper invocations info
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 23 Jul 2019 23:49:37 +0000 (16:49 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 25 Jul 2019 13:34:21 +0000 (06:34 -0700)
We don't need to guesstimate this ourselves. This will help when we
bringup derivatives.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index 5e6f94486688d2121d58b6752326b51a99230c69..334ea83305ad7804ab9f6468d8a9ce0659119dca 100644 (file)
@@ -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;
index 0035f7005184721ea43af2f1e7171e7dee2410db..8c2953cc21958d69a1fddb627d9a61deffe5a96d 100644 (file)
@@ -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;
index 83128677b97874a5bca3e82b1f3485efc3db04a4..c294195b4b5b9ba7efc1f2a0d4116a5446170608 100644 (file)
@@ -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) */