nir: Update shader info when adding discards
authorEric Anholt <eric@anholt.net>
Fri, 26 Aug 2016 20:45:47 +0000 (13:45 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Aug 2016 17:56:59 +0000 (10:56 -0700)
vc4 is about to start using the shader info field to set up discard
handling.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_bitmap.c
src/compiler/nir/nir_lower_clip.c

index bd5c30f8dc197f27b112cd8b9b839e8ee139d4dd..216bedf574031daef32e3ae79302ea686412f305 100644 (file)
@@ -107,6 +107,8 @@ lower_bitmap(nir_shader *shader, nir_builder *b,
    discard = nir_intrinsic_instr_create(shader, nir_intrinsic_discard_if);
    discard->src[0] = nir_src_for_ssa(cond);
    nir_builder_instr_insert(b, &discard->instr);
+
+   shader->info.fs.uses_discard = true;
 }
 
 static void
index 80db653a4286cb4176ea7f15e04e201939d04734..b74e6cca39f405a7cd68e10a4589565c1de0f66a 100644 (file)
@@ -286,6 +286,8 @@ lower_clip_fs(nir_function_impl *impl, unsigned ucp_enables,
                                               nir_intrinsic_discard_if);
          discard->src[0] = nir_src_for_ssa(cond);
          nir_builder_instr_insert(&b, &discard->instr);
+
+         b.shader->info.fs.uses_discard = true;
       }
    }
 }