Browse Source

nir: Update shader info when adding discards

vc4 is about to start using the shader info field to set up discard
handling.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
tags/13.0-branchpoint
Eric Anholt 10 years ago
parent
commit
a99d70d105
2 changed files with 4 additions and 0 deletions
  1. 2
    0
      src/compiler/nir/nir_lower_bitmap.c
  2. 2
    0
      src/compiler/nir/nir_lower_clip.c

+ 2
- 0
src/compiler/nir/nir_lower_bitmap.c View 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

+ 2
- 0
src/compiler/nir/nir_lower_clip.c View 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;
}
}
}

Loading…
Cancel
Save