diff options
author | Jason Ekstrand <[email protected]> | 2018-03-27 07:56:49 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-22 20:54:00 -0700 |
commit | e5db1b951cbe0d3ba566887d62672a52a6229e52 (patch) | |
tree | e928ffaf3adc5baf3c0cc2c2bf48433bb2fde7d4 /src/compiler/nir | |
parent | 6bdd867968224467f4d6b50d70f3bcd29c87c157 (diff) |
nir: Remove deref chain support from remove_unused_varyings
Acked-by: Rob Clark <[email protected]>
Acked-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Dave Airlie <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_linking_helpers.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 1a0cb910b80..13234757ce8 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; @@ -137,6 +134,8 @@ nir_remove_unused_varyings(nir_shader *producer, nir_shader *consumer) { assert(producer->info.stage != MESA_SHADER_FRAGMENT); assert(consumer->info.stage != MESA_SHADER_VERTEX); + nir_assert_unlowered_derefs(producer, nir_lower_load_store_derefs); + nir_assert_unlowered_derefs(consumer, nir_lower_load_store_derefs); uint64_t read[4] = { 0 }, written[4] = { 0 }; uint64_t patches_read[4] = { 0 }, patches_written[4] = { 0 }; |