nir: Add a halt instruction type

Halt is like a return for the entire shader or exit() if you prefer to
think of it that way.  Once an invocation hits a halt, it's 100% dead.
Any writes to output variables which happened before the halt do,
however, still apply.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>
This commit is contained in:
Jason Ekstrand
2020-05-15 15:46:08 -05:00
committed by Marge Bot
parent a1281f8a99
commit 630e54a08b
7 changed files with 87 additions and 4 deletions

View File

@@ -1330,6 +1330,10 @@ print_jump_instr(nir_jump_instr *instr, print_state *state)
fprintf(fp, "return");
break;
case nir_jump_halt:
fprintf(fp, "halt");
break;
case nir_jump_goto:
fprintf(fp, "goto block_%u",
instr->target ? instr->target->index : -1);