aco: Use context variables instead of calculating TCS inputs/outputs.
VS needs the number of TCS inputs, and TES needs the number of TCS outputs. It is error-prone to repeat those calculations in both instruction selection and setup. Just set them in one place instead. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4388>
This commit is contained in:
@@ -812,6 +812,8 @@ setup_vs_variables(isel_context *ctx, nir_shader *nir)
|
||||
*/
|
||||
/* radv_es_output_info *outinfo = &ctx->program->info->vs.es_info;
|
||||
outinfo->esgs_itemsize = util_bitcount64(ctx->output_masks[nir->info.stage]) * 16u; */
|
||||
} else if (ctx->stage == vertex_ls) {
|
||||
ctx->tcs_num_inputs = util_last_bit64(ctx->args->shader_info->vs.ls_outputs_written);
|
||||
}
|
||||
|
||||
if (ctx->stage == ngg_vertex_gs && ctx->args->options->key.vs_common_out.export_prim_id) {
|
||||
@@ -918,6 +920,7 @@ void
|
||||
setup_tes_variables(isel_context *ctx, nir_shader *nir)
|
||||
{
|
||||
ctx->tcs_num_patches = ctx->args->options->key.tes.num_patches;
|
||||
ctx->tcs_num_outputs = ctx->args->options->key.tes.tcs_num_outputs;
|
||||
|
||||
nir_foreach_variable(variable, &nir->inputs) {
|
||||
variable->data.driver_location = shader_io_get_unique_index((gl_varying_slot) variable->data.location) * 4;
|
||||
|
||||
Reference in New Issue
Block a user