summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-07-23 18:03:39 -0400
committerMarek Olšák <[email protected]>2019-07-30 22:06:23 -0400
commit37527f8a1181dc250c220bc58d12aefde0dac103 (patch)
tree2861e5cd193cf83bf969465f20c8edf9c16cac21
parent6697e42c3c3488bc8aec811398f21e7cec2a557a (diff)
radeonsi/nir: accurately set reads_*_outputs for TCS
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c24
1 files changed, 10 insertions, 14 deletions
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;