summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-25 21:36:25 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:02 -0800
commit829aa98320fcd529407d16991b476b71af017479 (patch)
tree5ff603507c7cded684a6ee460126b64c1e02f112 /src/glsl/nir/nir.c
parent4f8230e247a222314ab124e348482628adb5af32 (diff)
nir: Use an integer index for specifying structure fields
Previously, we used a string name. It was nice for translating out of GLSL IR (which also does that) but cumbersome the rest of the time. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r--src/glsl/nir/nir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index 0514158bbde..3f04de2fee6 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -529,12 +529,12 @@ nir_deref_array_create(void *mem_ctx)
}
nir_deref_struct *
-nir_deref_struct_create(void *mem_ctx, const char *field)
+nir_deref_struct_create(void *mem_ctx, unsigned field_index)
{
nir_deref_struct *deref = ralloc(mem_ctx, nir_deref_struct);
deref->deref.deref_type = nir_deref_type_struct;
deref->deref.child = NULL;
- deref->elem = ralloc_strdup(deref, field);
+ deref->index = field_index;
return deref;
}
@@ -566,7 +566,7 @@ copy_deref_array(void *mem_ctx, nir_deref_array *deref)
static nir_deref_struct *
copy_deref_struct(void *mem_ctx, nir_deref_struct *deref)
{
- nir_deref_struct *ret = nir_deref_struct_create(mem_ctx, deref->elem);
+ nir_deref_struct *ret = nir_deref_struct_create(mem_ctx, deref->index);
ret->deref.type = deref->deref.type;
if (deref->deref.child)
ret->deref.child = nir_copy_deref(mem_ctx, deref->deref.child);