aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_subgroup.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-01-22 11:57:48 -0600
committerJason Ekstrand <[email protected]>2019-02-01 17:34:02 +0000
commit9b37e93e4256ab1610bff5cdacc1e846467fc19d (patch)
treef8d236dffbbf14fee18c71416e34739007c81095 /src/compiler/spirv/vtn_subgroup.c
parent5e7f800f32a3d7299b157bd3028fc46455f77e83 (diff)
spirv: Replace vtn_constant_value with vtn_constant_uint
The uint version is less typing, supports different bit sizes, and is probably a bit more safe because we're actually verifying that the SPIR-V value is an integer scalar constant. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_subgroup.c')
-rw-r--r--src/compiler/spirv/vtn_subgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_subgroup.c b/src/compiler/spirv/vtn_subgroup.c
index 419130515ec..1b066f9340c 100644
--- a/src/compiler/spirv/vtn_subgroup.c
+++ b/src/compiler/spirv/vtn_subgroup.c
@@ -269,7 +269,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
break;
case SpvOpGroupNonUniformQuadSwap: {
- unsigned direction = vtn_constant_value(b, w[5])->values[0].u32[0];
+ unsigned direction = vtn_constant_uint(b, w[5]);
nir_intrinsic_op op;
switch (direction) {
case 0:
@@ -368,7 +368,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
case SpvGroupOperationClusteredReduce:
op = nir_intrinsic_reduce;
assert(count == 7);
- cluster_size = vtn_constant_value(b, w[6])->values[0].u32[0];
+ cluster_size = vtn_constant_uint(b, w[6]);
break;
default:
unreachable("Invalid group operation");