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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
This commit is contained in:
Mike Blumenkrantz
2023-08-04 15:14:21 -04:00
committed by Marge Bot
parent 235ae7c3c6
commit 01d3c691a5

View File

@@ -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;