From a8ba8eb12f8bc03927effebd926f18952a26f13a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 15 Apr 2021 10:23:21 -0400 Subject: [PATCH] zink: fix tcs slot map eval for user vars tcs user inputs need to have their size adjusted in order to determine whether they'll overflow the existing slot map Fixes: 5c5e1abea24 ("zink: evaluate existing slot map during program init and force new map as needed") Acked-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_program.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index f9a7239db4a..32a81e8068d 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -519,7 +519,10 @@ init_slot_map(struct zink_context *ctx, struct zink_gfx_program *prog) nir_variable *var = nir_find_variable_with_location(ctx->gfx_stages[i]->nir, nir_var_shader_out, slot); assert(var); - user_outputs_count += glsl_count_vec4_slots(var->type, false, false); + if (i == PIPE_SHADER_TESS_CTRL && var->data.location >= VARYING_SLOT_VAR0) + user_outputs_count += (glsl_count_vec4_slots(var->type, false, false) / 32 /*MAX_PATCH_VERTICES*/); + else + user_outputs_count += glsl_count_vec4_slots(var->type, false, false); } } max_outputs = MAX2(max_outputs, user_outputs_count);