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 <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Daniel Schürmann
2019-07-18 13:39:49 +02:00
committed by Jason Ekstrand
parent 517005b4cf
commit e272fdd508
5 changed files with 38 additions and 22 deletions

View File

@@ -199,6 +199,7 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
{
switch (instr->intrinsic) {
case nir_intrinsic_demote:
case nir_intrinsic_demote_if:
case nir_intrinsic_discard:
case nir_intrinsic_discard_if:
assert(shader->info.stage == MESA_SHADER_FRAGMENT);