Skip to content
Snippets Groups Projects
Commit 64cb143b authored by Caio Oliveira's avatar Caio Oliveira Committed by Marge Bot
Browse files

spirv: Fix handling of OpBranchConditional with same THEN and ELSE


When an OpBranchConditional that had two equal branches was parsed, we
were treating it as a regular OpBranch.  However this doesn't work
well when there's an associated OpSelectionMerge.  We ended up
skipping marking the merge block as such, and depending on what was
inside the construct we would end up trying to process the block
twice.

Fix this by keeping the vtn_if around, but when emitting NIR identify
the two equal branch case.

Fixes: 9c2a1143 ("spirv: Rewrite CFG construction")
Closes: #3786, #4580
Reviewed-by: default avatarYevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Acked-by: default avatarJason Ekstrand <jason@jlekstrand.net>
Part-of: <mesa/mesa!9297>
parent 38e8d7af
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment