mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
lima: ppir: fix check for discard_block in optimization
uses_discard may be set when the nir shader contains a 'discard'
implemented with a nir 'terminate', in that case it may stil not
necessarily have a discard block.
Fixes a crash in shaders that have comp->uses_discard but no
comp->discard_block.
Fixes: fa9ddbe82b ("lima: ppir: optimize branches")
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36350>
This commit is contained in:
parent
740daef360
commit
d620529ddb
1 changed files with 1 additions and 1 deletions
|
|
@ -374,7 +374,7 @@ static bool ppir_dce(ppir_compiler *comp)
|
|||
/* Block 0 is entry, it is always reachable */
|
||||
BITSET_SET(reachable, 0);
|
||||
/* Discard block is always reachable */
|
||||
if (comp->uses_discard)
|
||||
if (comp->discard_block)
|
||||
BITSET_SET(reachable, comp->discard_block->index);
|
||||
list_for_each_entry(ppir_block, block, &comp->block_list, list) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue