diff options
author | Jason Ekstrand <[email protected]> | 2018-03-26 18:13:59 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-22 20:15:56 -0700 |
commit | 1e1733aaf06fe2aac62fe4c36d951ce09dc0dfbd (patch) | |
tree | 9375549f8ccee9ccab9d00f9ccba5bfa290019d2 /src | |
parent | 775ef1338428d2f48bb606c1a3c06467d5948f36 (diff) |
nir: Consider deref instructions in lower_phis_to_scalar
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
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')
-rw-r--r-- | src/compiler/nir/nir_lower_phis_to_scalar.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c index d055e781074..6cb9420d0f2 100644 --- a/src/compiler/nir/nir_lower_phis_to_scalar.c +++ b/src/compiler/nir/nir_lower_phis_to_scalar.c @@ -83,10 +83,19 @@ is_phi_src_scalarizable(nir_phi_src *src, nir_intrinsic_instr *src_intrin = nir_instr_as_intrinsic(src_instr); switch (src_intrin->intrinsic) { + case nir_intrinsic_load_deref: { + nir_deref_instr *deref = nir_src_as_deref(src_intrin->src[0]); + return deref->mode == nir_var_shader_in || + deref->mode == nir_var_uniform; + } + case nir_intrinsic_load_var: return src_intrin->variables[0]->var->data.mode == nir_var_shader_in || src_intrin->variables[0]->var->data.mode == nir_var_uniform; + case nir_intrinsic_interp_deref_at_centroid: + case nir_intrinsic_interp_deref_at_sample: + case nir_intrinsic_interp_deref_at_offset: case nir_intrinsic_interp_var_at_centroid: case nir_intrinsic_interp_var_at_sample: case nir_intrinsic_interp_var_at_offset: @@ -299,8 +308,6 @@ nir_lower_phis_to_scalar(nir_shader *shader) { bool progress = false; - nir_assert_lowered_derefs(shader, nir_lower_load_store_derefs); - nir_foreach_function(function, shader) { if (function->impl) progress = lower_phis_to_scalar_impl(function->impl) || progress; |