From 01d3c691a50e1510437a7d313f73fba592538ece Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 4 Aug 2023 15:14:21 -0400 Subject: [PATCH] zink: fix clip/cull dist xfb inlining these are compact arrays which don't take up slots according to normal array i/o sizing rules Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index a5d6483..088bb6f 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -1908,7 +1908,9 @@ update_so_info(struct zink_shader *zs, nir_shader *nir, const struct pipe_stream if (var->data.is_xfb) goto out; - unsigned num_slots = glsl_count_vec4_slots(var->type, false, false); + unsigned num_slots = var->data.location >= VARYING_SLOT_CLIP_DIST0 && var->data.location <= VARYING_SLOT_CULL_DIST1 ? + glsl_array_size(var->type) / 4 : + glsl_count_vec4_slots(var->type, false, false); /* for each variable, iterate over all the variable's slots and inline the outputs */ for (unsigned j = 0; j < num_slots; j++) { slot = var->data.location + j; -- 2.7.4