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 <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
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;