mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
spirv: workaround for tests assuming that OpKill terminates invocations or loops
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27617>
This commit is contained in:
parent
7af16e9f1e
commit
cfa5beeeab
1 changed files with 11 additions and 2 deletions
|
|
@ -1256,10 +1256,19 @@ vtn_emit_branch(struct vtn_builder *b, const struct vtn_block *block,
|
|||
break;
|
||||
|
||||
case vtn_branch_type_discard:
|
||||
if (b->convert_discard_to_demote)
|
||||
if (b->convert_discard_to_demote) {
|
||||
nir_demote(&b->nb);
|
||||
else
|
||||
|
||||
/* Workaround for outdated test cases from CTS and Tint which assume
|
||||
* that OpKill always terminates the invocation. Break from the
|
||||
* current loop if it exists in order to prevent infinite loops.
|
||||
*/
|
||||
struct vtn_construct *loop = block->parent->innermost_loop;
|
||||
if (loop)
|
||||
vtn_emit_break_for_construct(b, block, loop);
|
||||
} else {
|
||||
nir_discard(&b->nb);
|
||||
}
|
||||
break;
|
||||
|
||||
case vtn_branch_type_terminate_invocation:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue