From: Ian Romanick <ian.d.roman...@intel.com> This prevents the next change from breaking the build, and I felt that it was different enough from the rest of that patch to stand on its own.
Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> --- src/compiler/nir/nir_validate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 9bf8c70..ca191d2 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -979,8 +979,9 @@ validate_var_decl(nir_variable *var, bool is_global, validate_state *state) validate_assert(state, is_global == nir_variable_is_global(var)); - /* Must have exactly one mode set */ - validate_assert(state, util_bitcount(var->data.mode) == 1); + /* Must have exactly one mode set (i.e., is a power of two) */ + validate_assert(state, (var->data.mode != 0 && + !(var->data.mode & (var->data.mode - 1)))); if (var->data.compact) { /* The "compact" flag is only valid on arrays of scalars. */ -- 2.9.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev