const glsl_type *type,
ir_variable *var)
{
- if (var && !var->is_in_uniform_block()) {
+ if (var && !var->is_in_buffer_block()) {
/* Layout qualifiers may only apply to interface blocks and fields in
* them.
*/
glsl_interp_qualifier determine_interpolation_mode(bool flat_shade);
/**
- * Determine whether or not a variable is part of a uniform block.
+ * Determine whether or not a variable is part of a uniform or
+ * shader storage block.
*/
- inline bool is_in_uniform_block() const
+ inline bool is_in_buffer_block() const
{
return (this->data.mode == ir_var_uniform ||
this->data.mode == ir_var_shader_storage) &&
ir_visitor_status
link_uniform_block_active_visitor::visit(ir_variable *var)
{
- if (!var->is_in_uniform_block())
+ if (!var->is_in_buffer_block())
return visit_continue;
const glsl_type *const block_type = var->is_interface_instance()
* function.
*/
if (var == NULL
- || !var->is_in_uniform_block()
+ || !var->is_in_buffer_block()
|| !var->is_interface_instance())
return visit_continue;
{
ir_variable *var = ir->var;
- if (!var->is_in_uniform_block())
+ if (!var->is_in_buffer_block())
return visit_continue;
assert(!var->is_interface_instance() || !var->type->is_array());
if (type->without_array()->is_sampler()) {
linker::set_sampler_binding(prog, var->name, var->data.binding);
- } else if (var->is_in_uniform_block()) {
+ } else if (var->is_in_buffer_block()) {
const glsl_type *const iface_type = var->get_interface_type();
/* If the variable is an array and it is an interface instance,
* float f[4];
* };
*
- * In this case "f" would pass is_in_uniform_block (above) and
+ * In this case "f" would pass is_in_buffer_block (above) and
* type->is_array(), but it will fail is_interface_instance().
*/
if (var->is_interface_instance() && var->type->is_array()) {
void process(ir_variable *var)
{
- this->is_ubo_var = var->is_in_uniform_block();
+ this->is_ubo_var = var->is_in_buffer_block();
if (var->is_interface_instance())
program_resource_visitor::process(var->get_interface_type(),
var->get_interface_type()->name);
field_counter = 0;
ubo_block_index = -1;
- if (var->is_in_uniform_block()) {
+ if (var->is_in_buffer_block()) {
if (var->is_interface_instance() && var->type->is_array()) {
unsigned l = strlen(var->get_interface_type()->name);
foreach_in_list(ir_instruction, node, shader->ir) {
ir_variable *const var = node->as_variable();
- if ((var == NULL) || !var->is_in_uniform_block())
+ if ((var == NULL) || !var->is_in_buffer_block())
continue;
assert(var->data.mode == ir_var_uniform);
* locations assigned based on the declaration ordering and
* sizes, array compaction would mess that up.
*/
- if (var->is_in_uniform_block() || var->type->contains_atomic())
+ if (var->is_in_buffer_block() || var->type->contains_atomic())
continue;
unsigned int size = var->data.max_array_access;
return;
ir_variable *var = deref->variable_referenced();
- if (!var || !var->is_in_uniform_block())
+ if (!var || !var->is_in_buffer_block())
return;
mem_ctx = ralloc_parent(*rvalue);
* If the variable is in a uniform block with one of those
* layouts, do not eliminate it.
*/
- if (entry->var->is_in_uniform_block()) {
+ if (entry->var->is_in_buffer_block()) {
const glsl_type *const block_type =
entry->var->is_interface_instance()
? entry->var->type : entry->var->get_interface_type();
* Some uniforms, such as samplers and atomic counters, have no actual
* storage, so we should ignore them.
*/
- if (ir->is_in_uniform_block() || type_size(ir->type) == 0)
+ if (ir->is_in_buffer_block() || type_size(ir->type) == 0)
return;
/* Track how big the whole uniform variable is, in case we need to put a
ir_variable *var = node->as_variable();
if ((var == NULL) || (var->data.mode != ir_var_uniform)
- || var->is_in_uniform_block() || (strncmp(var->name, "gl_", 3) == 0))
+ || var->is_in_buffer_block() || (strncmp(var->name, "gl_", 3) == 0))
continue;
add.process(var);