lima: gpir: abort compilation if load_uniform instrinsic src isn't const

GP supports indirect indexing of uniforms, but it's never been
implemented in GPIR, so just abort compilation instead of crashing an
app with assertion failure.

Backport-to: 23.3
Backport-to: 24.0
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24855>
(cherry picked from commit feccf4121b)
This commit is contained in:
Vasily Khoruzhick 2023-08-23 12:14:30 -07:00 committed by Eric Engestrom
parent c679b07111
commit d45476c079
2 changed files with 6 additions and 1 deletions

View file

@ -1414,7 +1414,7 @@
"description": "lima: gpir: abort compilation if load_uniform instrinsic src isn't const",
"nominated": false,
"nomination_type": 3,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -253,6 +253,11 @@ static bool gpir_emit_intrinsic(gpir_block *block, nir_instr *ni)
case nir_intrinsic_load_uniform:
{
int offset = nir_intrinsic_base(instr);
if (!nir_src_is_const(instr->src[0])) {
gpir_error("indirect indexing for uniforms is not implemented\n");
return false;
}
offset += (int)nir_src_as_float(instr->src[0]);
return gpir_create_load(block, &instr->def,