aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-19 16:32:15 -0500
committerJason Ekstrand <[email protected]>2018-10-26 11:45:29 -0500
commit18fb2c5d92b1fe3793f516cc7d45f058b61e57b5 (patch)
tree4073a8b2e81130e76a6d4d7e847e243e9c21cfc3 /src/compiler/spirv
parent8fa70cfcfdda1094bc19e9707eb9333477a2d2bf (diff)
spirv: Initialize subgroup destinations with the destination type
Instead of initializing them manually, just use the type that we already have sitting there. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_subgroup.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/spirv/vtn_subgroup.c b/src/compiler/spirv/vtn_subgroup.c
index ecec3aa62d0..419130515ec 100644
--- a/src/compiler/spirv/vtn_subgroup.c
+++ b/src/compiler/spirv/vtn_subgroup.c
@@ -81,7 +81,8 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
"OpGroupNonUniformElect must return a Bool");
nir_intrinsic_instr *elect =
nir_intrinsic_instr_create(b->nb.shader, nir_intrinsic_elect);
- nir_ssa_dest_init(&elect->instr, &elect->dest, 1, 32, NULL);
+ nir_ssa_dest_init_for_type(&elect->instr, &elect->dest,
+ val->type->type, NULL);
nir_builder_instr_insert(&b->nb, &elect->instr);
val->ssa->def = &elect->dest.ssa;
break;
@@ -112,7 +113,8 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
intrin->src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[4])->def);
intrin->src[1] = nir_src_for_ssa(nir_load_subgroup_invocation(&b->nb));
- nir_ssa_dest_init(&intrin->instr, &intrin->dest, 1, 32, NULL);
+ nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest,
+ val->type->type, NULL);
nir_builder_instr_insert(&b->nb, &intrin->instr);
val->ssa->def = &intrin->dest.ssa;
@@ -166,7 +168,8 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
if (src1)
intrin->src[1] = nir_src_for_ssa(src1);
- nir_ssa_dest_init(&intrin->instr, &intrin->dest, 1, 32, NULL);
+ nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest,
+ val->type->type, NULL);
nir_builder_instr_insert(&b->nb, &intrin->instr);
val->ssa->def = &intrin->dest.ssa;
@@ -225,7 +228,8 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
nir_intrinsic_instr_create(b->nb.shader, op);
intrin->num_components = src0->num_components;
intrin->src[0] = nir_src_for_ssa(src0);
- nir_ssa_dest_init(&intrin->instr, &intrin->dest, 1, 32, NULL);
+ nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest,
+ val->type->type, NULL);
nir_builder_instr_insert(&b->nb, &intrin->instr);
val->ssa->def = &intrin->dest.ssa;