lima/ppir: fix crash when program uses no registers at all

Program may need no regalloc at all, e.g. in case when program consists
of single discard op.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
This commit is contained in:
Vasily Khoruzhick 2019-05-31 22:30:54 -07:00
parent b38dab101c
commit 5980565a37

View file

@ -747,6 +747,10 @@ bool ppir_regalloc_prog(ppir_compiler *comp)
ppir_regalloc_update_reglist_ssa(comp);
/* No registers? Probably shader consists of discard instruction */
if (list_empty(&comp->reg_list))
return true;
/* this will most likely succeed in the first
* try, except for very complicated shaders */
while (!ppir_regalloc_prog_try(comp, &spilled))