nir: Get rid of nir_constant_data

This has bothered me for about as long as NIR has been around.  Why do we
have two different unions for constants?  No good reason other than one of
them is a direct port from GLSL IR.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
Jason Ekstrand
2016-11-29 22:19:28 -08:00
parent c45d84ad83
commit 19a541f496
7 changed files with 98 additions and 105 deletions

View File

@@ -938,9 +938,9 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
nir_var->data.read_only = true;
nir_constant *c = rzalloc(nir_var, nir_constant);
c->value.u[0] = b->shader->info->cs.local_size[0];
c->value.u[1] = b->shader->info->cs.local_size[1];
c->value.u[2] = b->shader->info->cs.local_size[2];
c->values[0].u32[0] = b->shader->info->cs.local_size[0];
c->values[0].u32[1] = b->shader->info->cs.local_size[1];
c->values[0].u32[2] = b->shader->info->cs.local_size[2];
nir_var->constant_initializer = c;
break;
}
@@ -1388,7 +1388,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
struct vtn_value *link_val = vtn_untyped_value(b, w[i]);
if (link_val->value_type == vtn_value_type_constant) {
chain->link[idx].mode = vtn_access_mode_literal;
chain->link[idx].id = link_val->constant->value.u[0];
chain->link[idx].id = link_val->constant->values[0].u32[0];
} else {
chain->link[idx].mode = vtn_access_mode_id;
chain->link[idx].id = w[i];