diff options
author | Erico Nunes <[email protected]> | 2019-04-30 00:10:02 +0200 |
---|---|---|
committer | Erico Nunes <[email protected]> | 2019-05-02 00:02:58 +0000 |
commit | 257a9b0a94ddf2e88bc29771f1f46abdd2d4464d (patch) | |
tree | 8baabf8e58a21c2c34d34301143c2e2ca14286e4 /src | |
parent | 09c669260f6d311d0d99f2c63ebd0ec5b68853f8 (diff) |
lima/gpir: add limit of max 512 instructions
It has been noted that the lima GP has a limit of 512 instructions,
after which the shaders don't work and fail silently.
This commit adds a check to make the shader compilation abort when the
shader exceeds this limit, so that we get a clear reason for why the
program will not work.
Signed-off-by: Erico Nunes <[email protected]>
Reviewed-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/lima/ir/gp/codegen.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/ir/gp/codegen.c b/src/gallium/drivers/lima/ir/gp/codegen.c index 798cf8ec88e..1b7c8903c97 100644 --- a/src/gallium/drivers/lima/ir/gp/codegen.c +++ b/src/gallium/drivers/lima/ir/gp/codegen.c @@ -560,6 +560,12 @@ bool gpir_codegen_prog(gpir_compiler *comp) num_instr += list_length(&block->instr_list); } + if (num_instr > 512) { + gpir_error("shader too big (%d), GP has a 512 instruction limit.\n", + num_instr); + return false; + } + gpir_codegen_instr *code = rzalloc_array(comp->prog, gpir_codegen_instr, num_instr); if (!code) return false; |