[Mesa-dev] [PATCH 038.1/129] FIXUP: nir: Support deref instructions in opt_undef
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Sun Jun 3 23:10:06 UTC 2018
---
src/compiler/nir/nir_opt_undef.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
index 1439ca9c165..e42a9af2bdf 100644
--- a/src/compiler/nir/nir_opt_undef.c
+++ b/src/compiler/nir/nir_opt_undef.c
@@ -107,20 +107,24 @@ opt_undef_vecN(nir_builder *b, nir_alu_instr *alu)
static bool
opt_undef_store(nir_intrinsic_instr *intrin)
{
+ int arg_index;
switch (intrin->intrinsic) {
case nir_intrinsic_store_deref:
+ arg_index = 1;
+ break;
case nir_intrinsic_store_var:
case nir_intrinsic_store_output:
case nir_intrinsic_store_per_vertex_output:
case nir_intrinsic_store_ssbo:
case nir_intrinsic_store_shared:
+ arg_index = 0;
break;
default:
return false;
}
- if (!intrin->src[0].is_ssa ||
- intrin->src[0].ssa->parent_instr->type != nir_instr_type_ssa_undef)
+ if (!intrin->src[arg_index].is_ssa ||
+ intrin->src[arg_index].ssa->parent_instr->type != nir_instr_type_ssa_undef)
return false;
nir_instr_remove(&intrin->instr);
--
2.17.0
More information about the mesa-dev
mailing list