summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_indirect_derefs.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-11 13:38:02 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-13 12:44:07 -0700
commit2caaf0ac5e0266c69e64309af9307e422e48b44d (patch)
tree8f3e4ed1c2ec4c27a59f1f9065d1fbf3ba6b892d /src/compiler/nir/nir_lower_indirect_derefs.c
parentffa0e12e15bdfd0116446bfc5697e9e250770981 (diff)
downloadexternal_mesa3d-2caaf0ac5e0266c69e64309af9307e422e48b44d.zip
external_mesa3d-2caaf0ac5e0266c69e64309af9307e422e48b44d.tar.gz
external_mesa3d-2caaf0ac5e0266c69e64309af9307e422e48b44d.tar.bz2
nir/lower_indirect: nir_variable_mode is now a bitfield
Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/compiler/nir/nir_lower_indirect_derefs.c')
-rw-r--r--src/compiler/nir/nir_lower_indirect_derefs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c
index 62b8c84..a69dd61 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -161,7 +161,7 @@ deref_has_indirect(nir_deref_var *deref)
struct lower_indirect_state {
nir_builder builder;
- uint32_t mode_mask;
+ nir_variable_mode modes;
bool progress;
};
@@ -183,7 +183,7 @@ lower_indirect_block(nir_block *block, void *void_state)
continue;
/* Only lower variables whose mode is in the mask */
- if (!(state->mode_mask & (1 << intrin->variables[0]->var->data.mode)))
+ if (!(state->modes & intrin->variables[0]->var->data.mode))
continue;
state->builder.cursor = nir_before_instr(&intrin->instr);
@@ -206,12 +206,12 @@ lower_indirect_block(nir_block *block, void *void_state)
}
static bool
-lower_indirects_impl(nir_function_impl *impl, uint32_t mode_mask)
+lower_indirects_impl(nir_function_impl *impl, nir_variable_mode modes)
{
struct lower_indirect_state state;
state.progress = false;
- state.mode_mask = mode_mask;
+ state.modes = modes;
nir_builder_init(&state.builder, impl);
nir_foreach_block(impl, lower_indirect_block, &state);
@@ -228,13 +228,13 @@ lower_indirects_impl(nir_function_impl *impl, uint32_t mode_mask)
* that does a binary search on the array index.
*/
bool
-nir_lower_indirect_derefs(nir_shader *shader, uint32_t mode_mask)
+nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes)
{
bool progress = false;
nir_foreach_function(shader, function) {
if (function->impl)
- progress = lower_indirects_impl(function->impl, mode_mask) || progress;
+ progress = lower_indirects_impl(function->impl, modes) || progress;
}
return progress;