summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-08-26 13:45:47 -0700
committerEric Anholt <eric@anholt.net>2016-08-29 10:56:59 -0700
commita99d70d105df8a20f3ea98640afdeab7ed69b685 (patch)
tree2b32020c289fed5b9da8ccd0841a9e83a482e118 /src/compiler/nir
parentfa8f87132a87c8bb89b52b66255ad9ffa002adf6 (diff)
downloadexternal_mesa3d-a99d70d105df8a20f3ea98640afdeab7ed69b685.tar.gz
external_mesa3d-a99d70d105df8a20f3ea98640afdeab7ed69b685.tar.bz2
external_mesa3d-a99d70d105df8a20f3ea98640afdeab7ed69b685.zip
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>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_bitmap.c2
-rw-r--r--src/compiler/nir/nir_lower_clip.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_bitmap.c b/src/compiler/nir/nir_lower_bitmap.c
index bd5c30f8dc..216bedf574 100644
--- a/src/compiler/nir/nir_lower_bitmap.c
+++ b/src/compiler/nir/nir_lower_bitmap.c
@@ -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
diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 80db653a42..b74e6cca39 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -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;
}
}
}