For variables that are in an interface block or are an instance of an
interface block, this is the GLSL_TYPE_INTERFACE type for that block.
Convert the ir_variable::is_in_uniform_block method added in the
previous commit to use this field instead of ir_variable::uniform_block.
v2: Fix the place-holder comment on ir_variable::interface_type.
Suggested by Paul Berry.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
this->instance_name,
ir_var_uniform);
+ var->interface_type = block_type;
state->symbols->add_variable(var);
instructions->push_tail(var);
} else {
ralloc_strdup(state, fields[i].name),
ir_var_uniform);
var->uniform_block = ubo - state->uniform_blocks;
+ var->interface_type = block_type;
state->symbols->add_variable(var);
instructions->push_tail(var);
*/
inline bool is_in_uniform_block() const
{
- return this->mode == ir_var_uniform && this->uniform_block != -1;
+ return this->mode == ir_var_uniform && this->interface_type != NULL;
}
/**
* objects.
*/
ir_constant *constant_initializer;
+
+ /**
+ * For variables that are in an interface block or are an instance of an
+ * interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
+ *
+ * \sa ir_variable::location
+ */
+ const glsl_type *interface_type;
};
var->constant_initializer =
this->constant_initializer->clone(mem_ctx, ht);
+ var->interface_type = this->interface_type;
+
if (ht) {
hash_table_insert(ht, var, (void *)const_cast<ir_variable *>(this));
}