diff options
author | Vasily Khoruzhick <[email protected]> | 2019-05-31 22:30:54 -0700 |
---|---|---|
committer | Vasily Khoruzhick <[email protected]> | 2019-06-06 04:30:36 +0000 |
commit | 5980565a37909c01281b483c371f5eec03e9689a (patch) | |
tree | 36ebabe25b6845916ca0fbc3ef0b1787bf8c9781 /src/gallium/drivers/lima | |
parent | b38dab101ca7e0896255dccbd85fd510c47d84d1 (diff) |
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 <[email protected]>
Reviewed-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima')
-rw-r--r-- | src/gallium/drivers/lima/ir/pp/regalloc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/regalloc.c b/src/gallium/drivers/lima/ir/pp/regalloc.c index 6aa71e91cfe..dee530ca2b6 100644 --- a/src/gallium/drivers/lima/ir/pp/regalloc.c +++ b/src/gallium/drivers/lima/ir/pp/regalloc.c @@ -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)) |