mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 07:58:16 +02:00
nak: Don't do a scope break cascade for nir_jump_halt
Fixes: 9312356d99 ("nak/nir: Add a control-flow lowering pass")
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28456>
This commit is contained in:
parent
b593de2c49
commit
3f50d72ec5
1 changed files with 12 additions and 3 deletions
|
|
@ -97,7 +97,6 @@ jump_target_scope_type(nir_jump_type jump_type)
|
|||
switch (jump_type) {
|
||||
case nir_jump_break: return SCOPE_TYPE_LOOP_BREAK;
|
||||
case nir_jump_continue: return SCOPE_TYPE_LOOP_CONT;
|
||||
case nir_jump_halt: return SCOPE_TYPE_SHADER;
|
||||
default:
|
||||
unreachable("Unknown jump type");
|
||||
}
|
||||
|
|
@ -268,8 +267,18 @@ lower_cf_list(nir_builder *b, nir_def *esc_reg, struct scope *parent_scope,
|
|||
nir_cf_extract(&instrs, start, end);
|
||||
b->cursor = nir_cf_reinsert(&instrs, b->cursor);
|
||||
|
||||
if (jump != NULL)
|
||||
break_scopes(b, esc_reg, parent_scope, jump->type);
|
||||
if (jump != NULL) {
|
||||
if (jump->type == nir_jump_halt) {
|
||||
/* Halt instructions map to OpExit on NVIDIA hardware and
|
||||
* exited lanes never block a bsync.
|
||||
*/
|
||||
nir_instr_remove(&jump->instr);
|
||||
nir_builder_instr_insert(b, &jump->instr);
|
||||
} else {
|
||||
/* Everything else needs a break cascade */
|
||||
break_scopes(b, esc_reg, parent_scope, jump->type);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue