summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_validate.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-21 16:48:35 -0700
committerJason Ekstrand <[email protected]>2018-06-22 20:15:57 -0700
commit39bf61aa37b0336aa27d8e3d2bf64587f07ff477 (patch)
tree71862af4a722fd8a2ef95aa5de09820fc0e7e411 /src/compiler/nir/nir_validate.c
parenteb40540b8aa30279b80fa3a879e20bbb5d16838f (diff)
nir: Add a concept of per-member structs and a lowering pass
This adds a concept of "members" to a variable with an interface type. It allows you to specify the full variable data for each member of the interface instead of once for the variable. We also add a lowering pass to lower those variables to a sequence of variables and rewrite all the derefs accordingly. 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/nir/nir_validate.c')
-rw-r--r--src/compiler/nir/nir_validate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 191e3b72325..5144886c926 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -1100,6 +1100,13 @@ validate_var_decl(nir_variable *var, bool is_global, validate_state *state)
}
}
+ if (var->num_members > 0) {
+ const struct glsl_type *without_array = glsl_without_array(var->type);
+ validate_assert(state, glsl_type_is_struct(without_array));
+ validate_assert(state, var->num_members == glsl_get_length(without_array));
+ validate_assert(state, var->members != NULL);
+ }
+
/*
* TODO validate some things ir_validate.cpp does (requires more GLSL type
* support)