From: Marek Olšák Date: Tue, 23 Jul 2019 22:03:39 +0000 (-0400) Subject: radeonsi/nir: accurately set reads_*_outputs for TCS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37527f8a1181dc250c220bc58d12aefde0dac103;p=mesa.git radeonsi/nir: accurately set reads_*_outputs for TCS --- diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 5c23ea50bee..56ab23a2c89 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -95,6 +95,16 @@ static void gather_intrinsic_load_deref_output_info(const nir_shader *nir, assert(var && var->data.mode == nir_var_shader_out); switch (nir->info.stage) { + case MESA_SHADER_TESS_CTRL: + if (var->data.location == VARYING_SLOT_TESS_LEVEL_INNER || + var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER) + info->reads_tessfactor_outputs = true; + else if (var->data.patch) + info->reads_perpatch_outputs = true; + else + info->reads_pervertex_outputs = true; + break; + case MESA_SHADER_FRAGMENT: if (var->data.fb_fetch_output) info->uses_fbfetch = true; @@ -663,20 +673,6 @@ void si_nir_scan_shader(const struct nir_shader *nir, info->writes_position = true; break; } - - if (nir->info.stage == MESA_SHADER_TESS_CTRL) { - switch (semantic_name) { - case TGSI_SEMANTIC_PATCH: - info->reads_perpatch_outputs = true; - break; - case TGSI_SEMANTIC_TESSINNER: - case TGSI_SEMANTIC_TESSOUTER: - info->reads_tessfactor_outputs = true; - break; - default: - info->reads_pervertex_outputs = true; - } - } } unsigned loc = variable->data.location;