panfrost: Use nir_gather_info information about discards
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 23 Jul 2019 23:52:40 +0000 (16:52 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 25 Jul 2019 13:34:21 +0000 (06:34 -0700)
No need to track this ourselves!

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

index 334ea83305ad7804ab9f6468d8a9ce0659119dca..75158089c88567ce686936ecf7e60e033e6e5896 100644 (file)
@@ -91,7 +91,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m
         meta->varying_count = program.varying_count;
         meta->midgard1.work_count = program.work_register_count;
 
-        state->can_discard = program.can_discard;
+        state->can_discard = s->info.fs.uses_discard;
         state->writes_point_size = program.writes_point_size;
         state->reads_point_coord = false;
         state->helper_invocations = s->info.fs.needs_helper_invocations;
index a3e174cb30c8f9b0447eee2a4d8959282fa3580d..2d5f07451a5d0e5be27e7ae30b070386913ae1b0 100644 (file)
@@ -244,9 +244,6 @@ typedef struct compiler_context {
         /* Mapping of texture register -> SSA index for unaliasing */
         int texture_index[2];
 
-        /* If any path hits a discard instruction */
-        bool can_discard;
-
         /* The number of uniforms allowable for the fast path */
         int uniform_cutoff;
 
index 5e5356ff72b73bc8d2aa13fc9a9ff0d5dad023ce..251eaed44e0831eb38b46943955795bf1fde2900 100644 (file)
@@ -1248,8 +1248,6 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
                 struct midgard_instruction discard = v_branch(conditional, false);
                 discard.branch.target_type = TARGET_DISCARD;
                 emit_mir_instruction(ctx, discard);
-
-                ctx->can_discard = true;
                 break;
         }
 
@@ -2702,8 +2700,6 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga
 
         /* Deal with off-by-one related to the fencepost problem */
         program->work_register_count = ctx->work_registers + 1;
-
-        program->can_discard = ctx->can_discard;
         program->uniform_cutoff = ctx->uniform_cutoff;
 
         program->blend_patch_offset = ctx->blend_constant_offset;
index 2c86ccbca7bf62da8329c1cb004d3af18854899f..f76715e7a537b81c676fc0e415f27c8d5a9e38c4 100644 (file)
@@ -89,7 +89,6 @@ typedef struct {
         unsigned varyings[32];
 
         /* Boolean properties of the program */
-        bool can_discard;
         bool writes_point_size;
 
         int first_tag;