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: 5c5e1abea2 ("zink: evaluate existing slot map during program init and force new map as needed")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
(cherry picked from commit a8ba8eb12f)
This commit is contained in:
Mike Blumenkrantz 2021-04-15 10:23:21 -04:00 committed by Eric Engestrom
parent 5ecd135d03
commit 54908b2307
2 changed files with 5 additions and 2 deletions

View file

@ -940,7 +940,7 @@
"description": "zink: fix tcs slot map eval for user vars",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "5c5e1abea24f44adaa904239031af71b4ff283c0"
},

View file

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