mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
nir/lower_shader_calls: Repair SSA after wrap_instrs
Wrapping jump instructions that are located inside ifs can break SSA
invariants because the else block no longer dominates the merge block.
Repair the SSA to make the validator happy again.
Cc: mesa-stable
(cherry picked from commit 50e65dac79)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
parent
5ae8474029
commit
05e5db1a4d
2 changed files with 11 additions and 3 deletions
|
|
@ -244,7 +244,7 @@
|
|||
"description": "nir/lower_shader_calls: Repair SSA after wrap_instrs",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1228,8 +1228,16 @@ wrap_instr(nir_builder *b, nir_instr *instr, void *data)
|
|||
static bool
|
||||
wrap_instrs(nir_shader *shader, wrap_instr_callback callback)
|
||||
{
|
||||
return nir_shader_instructions_pass(shader, wrap_instr,
|
||||
nir_metadata_none, callback);
|
||||
bool progress = nir_shader_instructions_pass(shader, wrap_instr,
|
||||
nir_metadata_none, callback);
|
||||
/* Wrapping jump instructions that are located inside ifs can break SSA
|
||||
* invariants because the else block no longer dominates the merge block.
|
||||
* Repair the SSA to make the validator happy again.
|
||||
*/
|
||||
if (progress)
|
||||
nir_repair_ssa(shader);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue