spriv: don't set num_components for non-vectorised intrinsics
Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>
This commit is contained in:
@@ -2962,17 +2962,16 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
|
||||
struct vtn_type *type = vtn_value(b, w[1], vtn_value_type_type)->type;
|
||||
|
||||
unsigned dest_components = glsl_get_vector_elements(type->type);
|
||||
intrin->num_components = nir_intrinsic_infos[op].dest_components;
|
||||
if (intrin->num_components == 0)
|
||||
if (nir_intrinsic_infos[op].dest_components == 0)
|
||||
intrin->num_components = dest_components;
|
||||
|
||||
nir_ssa_dest_init(&intrin->instr, &intrin->dest,
|
||||
intrin->num_components, 32, NULL);
|
||||
nir_intrinsic_dest_components(intrin), 32, NULL);
|
||||
|
||||
nir_builder_instr_insert(&b->nb, &intrin->instr);
|
||||
|
||||
nir_ssa_def *result = &intrin->dest.ssa;
|
||||
if (intrin->num_components != dest_components)
|
||||
if (nir_intrinsic_dest_components(intrin) != dest_components)
|
||||
result = nir_channels(&b->nb, result, (1 << dest_components) - 1);
|
||||
|
||||
struct vtn_value *val =
|
||||
|
@@ -252,7 +252,8 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode,
|
||||
}
|
||||
nir_intrinsic_instr *intrin =
|
||||
nir_intrinsic_instr_create(b->nb.shader, op);
|
||||
intrin->num_components = src0->num_components;
|
||||
if (nir_intrinsic_infos[op].src_components[0] == 0)
|
||||
intrin->num_components = src0->num_components;
|
||||
intrin->src[0] = nir_src_for_ssa(src0);
|
||||
nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest,
|
||||
val->type->type, NULL);
|
||||
|
Reference in New Issue
Block a user