From 9fe9681db1e5dd968d6853aeb9a9e2e8a8eb8cb9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 2 Apr 2024 08:53:39 -0400 Subject: [PATCH] zink: assert that ntv interp handling isn't doing implicit component expansion the number of components that ntv loads should always be the number of components that the nir shader thinks it's loading Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index bedf84605744e..b4e56567e8af0 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -2754,6 +2754,7 @@ emit_interpolate(struct ntv_context *ctx, nir_intrinsic_instr *intr) SpvId ptr = get_src(ctx, &intr->src[0], &ptype); SpvId result; const struct glsl_type *gtype = nir_src_as_deref(intr->src[0])->type; + assert(glsl_get_vector_elements(gtype) == intr->num_components); assert(ptype == get_nir_alu_type(gtype)); if (intr->intrinsic == nir_intrinsic_interp_deref_at_centroid) result = emit_builtin_unop(ctx, op, get_glsl_type(ctx, gtype), ptr);