summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/spirv_to_nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-06-06 09:49:55 -0500
committerJason Ekstrand <[email protected]>2019-06-19 21:05:54 +0000
commit280e5442e5d98a4967a35a5c1cadf5a1f786af6a (patch)
tree724717377960fe4687168672c8de2e2c701739e0 /src/compiler/spirv/spirv_to_nir.c
parentaa11c2e75e191f8201fe5462ef8c14e81dde964e (diff)
spirv: Use vtn_constan_uint() for array lengths and gather components
Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/spirv/spirv_to_nir.c')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index ccd11fa6329..559408e3a08 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1271,8 +1271,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
/* A length of 0 is used to denote unsized arrays */
val->type->length = 0;
} else {
- val->type->length =
- vtn_value(b, w[3], vtn_value_type_constant)->constant->values[0][0].u32;
+ val->type->length = vtn_constant_uint(b, w[3]);
}
val->type->base_type = vtn_base_type_array;
@@ -2280,8 +2279,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
case SpvOpImageGather:
/* This has a component as its next source */
- gather_component =
- vtn_value(b, w[idx++], vtn_value_type_constant)->constant->values[0][0].u32;
+ gather_component = vtn_constant_uint(b, w[idx++]);
break;
default: