zink: handle 1bit undef values in ntv

spirv requires that 1bit values be bool types, not uints

Fixes: 93af00502e ("zink: use uvec for undefs")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9059>
This commit is contained in:
Mike Blumenkrantz 2021-02-15 15:22:46 -05:00 committed by Marge Bot
parent e3428419fb
commit 8300bc1f16

View file

@ -2860,8 +2860,9 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
static void
emit_undef(struct ntv_context *ctx, nir_ssa_undef_instr *undef)
{
SpvId type = get_uvec_type(ctx, undef->def.bit_size,
undef->def.num_components);
SpvId type = undef->def.bit_size == 1 ? get_bvec_type(ctx, undef->def.num_components) :
get_uvec_type(ctx, undef->def.bit_size,
undef->def.num_components);
store_ssa_def(ctx, &undef->def,
spirv_builder_emit_undef(&ctx->builder, type));