nir/lower_indirect: nir_variable_mode is now a bitfield
[mesa.git] / src / compiler / nir / nir_validate.c
index 9f18d1c33e4a3cab0854c7b7f53a7f6fba358d73..3c3306c75fb924e1e3e67cd13b5515a4e9dcd26c 100644 (file)
@@ -903,6 +903,9 @@ validate_var_decl(nir_variable *var, bool is_global, validate_state *state)
 {
    assert(is_global == nir_variable_is_global(var));
 
+   /* Must have exactly one mode set */
+   assert(util_bitcount(var->data.mode) == 1);
+
    /*
     * TODO validate some things ir_validate.cpp does (requires more GLSL type
     * support)