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>
(cherry picked from commit 8300bc1f16)
This commit is contained in:
Mike Blumenkrantz 2021-02-15 15:22:46 -05:00 committed by Dylan Baker
parent 0ba7fae491
commit fe83bea355
2 changed files with 4 additions and 3 deletions

View file

@ -1525,7 +1525,7 @@
"description": "zink: handle 1bit undef values in ntv",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "93af00502ebc32061c63927815d0d2255fe66a98"
},

View file

@ -2080,8 +2080,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));