[Mesa-dev] [PATCH v3 085/104] nir: Remove deref chain support from remove_unused_varyings

Jason Ekstrand jason at jlekstrand.net
Tue Apr 3 18:39:29 UTC 2018


---
 src/compiler/nir/nir_linking_helpers.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index 1a0cb91..85712a7 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -71,14 +71,11 @@ tcs_add_output_reads(nir_shader *shader, uint64_t *read, uint64_t *patches_read)
                continue;
 
             nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
-            nir_variable *var;
-            if (intrin->intrinsic == nir_intrinsic_load_var) {
-               var = intrin->variables[0]->var;
-            } else if (intrin->intrinsic == nir_intrinsic_load_deref) {
-               var = nir_deref_instr_get_variable(nir_src_as_deref(intrin->src[0]));
-            } else {
+            if (intrin->intrinsic != nir_intrinsic_load_deref)
                continue;
-            }
+
+            nir_variable *var =
+               nir_deref_instr_get_variable(nir_src_as_deref(intrin->src[0]));
 
             if (var->data.mode != nir_var_shader_out)
                continue;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list