mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 13:00:22 +01:00
nir/spirv: Allow loop breaks in a switch body.
Per the SPIR-V spec 2.11 Structured Control Flow:
"The only blocks in a construct that can branch outside the construct are
...
- a break block for the innermost loop it is inside of.
..."
With
"Break block: A block containing a branch to the Merge Block of a loop header's merge instruction."
Note that it puts no restriction on not being in an if or switch within the innermost loop.
This passes the loop_break block to the switch body so it can properly detect loop breaks.
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit ef61d09d5b)
This commit is contained in:
parent
18db986354
commit
f5f515a023
1 changed files with 1 additions and 1 deletions
|
|
@ -427,7 +427,7 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list,
|
|||
list_for_each_entry(struct vtn_case, cse, &swtch->cases, link) {
|
||||
assert(cse->start_block != break_block);
|
||||
vtn_cfg_walk_blocks(b, &cse->body, cse->start_block, cse,
|
||||
break_block, NULL, loop_cont, NULL);
|
||||
break_block, loop_break, loop_cont, NULL);
|
||||
}
|
||||
|
||||
/* Finally, we walk over all of the cases one more time and put
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue