mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 00:08:16 +02:00
ac/nir: When loading an arg, assert that it's used
To avoid weird crashes caused by trying to load unused attributes. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Natalie Vock <natalie.vock@gmx.de> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41780>
This commit is contained in:
parent
7f2130c86e
commit
3ff698e9fc
1 changed files with 2 additions and 0 deletions
|
|
@ -182,6 +182,8 @@ nir_def *
|
|||
ac_nir_load_arg_at_offset(nir_builder *b, const struct ac_shader_args *ac_args,
|
||||
struct ac_arg arg, unsigned relative_index)
|
||||
{
|
||||
assert(arg.used);
|
||||
|
||||
unsigned arg_index = arg.arg_index + relative_index;
|
||||
unsigned num_components = ac_args->args[arg_index].size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue