summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-26 18:08:14 -0700
committerJason Ekstrand <[email protected]>2018-06-22 20:54:00 -0700
commitc290e8c4b00500bbe4b8ac7da5d2b021e4a0b0a7 (patch)
treeee909aa1ff29190c9aeb166e567c6b812040442a /src/compiler
parent41c52c963a6a252fcb7208f70c0b11730fc40784 (diff)
nir: Remove deref chain support from lower_global_vars_to_local
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')
-rw-r--r--src/compiler/nir/nir_lower_global_vars_to_local.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/compiler/nir/nir_lower_global_vars_to_local.c b/src/compiler/nir/nir_lower_global_vars_to_local.c
index 14aa366ea3a..9ca4aadb88a 100644
--- a/src/compiler/nir/nir_lower_global_vars_to_local.c
+++ b/src/compiler/nir/nir_lower_global_vars_to_local.c
@@ -55,27 +55,10 @@ mark_global_var_uses_block(nir_block *block, nir_function_impl *impl,
struct hash_table *var_func_table)
{
nir_foreach_instr(instr, block) {
- switch (instr->type) {
- case nir_instr_type_deref: {
+ if (instr->type == nir_instr_type_deref) {
nir_deref_instr *deref = nir_instr_as_deref(instr);
if (deref->deref_type == nir_deref_type_var)
register_var_use(deref->var, impl, var_func_table);
- break;
- }
-
- case nir_instr_type_intrinsic: {
- nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
- unsigned num_vars =
- nir_intrinsic_infos[intrin->intrinsic].num_variables;
-
- for (unsigned i = 0; i < num_vars; i++)
- register_var_use(intrin->variables[i]->var, impl, var_func_table);
- break;
- }
-
- default:
- /* Nothing to do */
- break;
}
}
@@ -95,6 +78,9 @@ nir_lower_global_vars_to_local(nir_shader *shader)
_mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
+ nir_assert_unlowered_derefs(shader, nir_lower_load_store_derefs | nir_lower_interp_derefs |
+ nir_lower_atomic_counter_derefs | nir_lower_atomic_derefs | nir_lower_image_derefs);
+
nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl)