From e272fdd508f844f6545827273b3cf2f109759a6d Mon Sep 17 00:00:00 2001 From: Daniel Schürmann Date: Thu, 18 Jul 2019 13:39:49 +0200 Subject: nir,intel: lower if (cond) demote() to new intrinsic demote_if(cond) This will effectively enable the optimization in anv. Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_fs_nir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/intel') diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 6ea012c74b6..0b3982737dd 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -3568,6 +3568,7 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld, case nir_intrinsic_demote: case nir_intrinsic_discard: + case nir_intrinsic_demote_if: case nir_intrinsic_discard_if: { /* We track our discarded pixels in f0.1. By predicating on it, we can * update just the flag bits that aren't yet discarded. If there's no @@ -3575,7 +3576,8 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld, * channels will get turned off. */ fs_inst *cmp = NULL; - if (instr->intrinsic == nir_intrinsic_discard_if) { + if (instr->intrinsic == nir_intrinsic_demote_if || + instr->intrinsic == nir_intrinsic_discard_if) { nir_alu_instr *alu = nir_src_as_alu_instr(instr->src[0]); if (alu != NULL && -- cgit v1.2.3