mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
glsl: stop cascading errors if process_parameters() fails
Generally we do not completely stop compilation as soon as we see an error, instead we continue on to attemp to find any futher errors. This means we shouldn't be checking state->error to see if any error has happened during the compilation process, doing so was causing process_parameters() to fail on completely valid functions if there was any error found in the shader previously. This then caused the valid functions not to be found because the paramlist was considered empty, resulting in the compiler spewing out misleading error messages. Here we simply add the IR error value to the param list when we have an issue with processing a parameter, this leads to much better error messaging. Fixes:53e4159eaa("glsl: stop processing function parameters if error happened") Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5205> (cherry picked from commitf6214750eb)
This commit is contained in:
parent
f9c4314d35
commit
bcab0cc6d8
2 changed files with 7 additions and 4 deletions
|
|
@ -67,7 +67,7 @@
|
|||
"description": "glsl: stop cascading errors if process_parameters() fails",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "53e4159eaaf692071bf63365eb27a16c97c9a3e5"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -49,9 +49,12 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
|
|||
ast->set_is_lhs(true);
|
||||
ir_rvalue *result = ast->hir(instructions, state);
|
||||
|
||||
/* Error happened, bail out. */
|
||||
if (state->error)
|
||||
return 0;
|
||||
/* Error happened processing function parameter */
|
||||
if (!result) {
|
||||
actual_parameters->push_tail(ir_rvalue::error_value(mem_ctx));
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
ir_constant *const constant =
|
||||
result->constant_expression_value(mem_ctx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue