mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 14:40:10 +01:00
nir: Add a concept of a wildcard array dereference
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
b5143edaee
commit
4f8230e247
2 changed files with 12 additions and 0 deletions
|
|
@ -625,9 +625,18 @@ typedef struct {
|
|||
nir_variable *var;
|
||||
} nir_deref_var;
|
||||
|
||||
/* This enum describes how the array is referenced. If the deref is
|
||||
* direct then the base_offset is used. If the deref is indirect then then
|
||||
* offset is given by base_offset + indirect. If the deref is a wildcard
|
||||
* then the deref refers to all of the elements of the array at the same
|
||||
* time. Wildcard dereferences are only ever allowed in copy_var
|
||||
* intrinsics and the source and destination derefs must have matching
|
||||
* wildcards.
|
||||
*/
|
||||
typedef enum {
|
||||
nir_deref_array_type_direct,
|
||||
nir_deref_array_type_indirect,
|
||||
nir_deref_array_type_wildcard,
|
||||
} nir_deref_array_type;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -274,6 +274,9 @@ print_deref_array(nir_deref_array *deref, print_var_state *state, FILE *fp)
|
|||
fprintf(fp, "%u + ", deref->base_offset);
|
||||
print_src(&deref->indirect, fp);
|
||||
break;
|
||||
case nir_deref_array_type_wildcard:
|
||||
fprintf(fp, "*");
|
||||
break;
|
||||
}
|
||||
fprintf(fp, "]");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue