summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2015-06-05 09:11:53 +0200
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>2015-07-14 07:04:03 +0200
commit1146696f75ea0f2b49e6379c2a62602dfeb51190 (patch)
tree7dd5455f4a88910f60f0f101f4ba4c6a3b3d3fcd /src
parent18feaa8f36b311c443fd56666507ec1768fb9582 (diff)
mesa: rename is_in_uniform_block to is_in_buffer_block
Since this now checks if a variable is inside a uniform or a shader storage block. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_to_hir.cpp2
-rw-r--r--src/glsl/ir.h5
-rw-r--r--src/glsl/link_uniform_block_active_visitor.cpp6
-rw-r--r--src/glsl/link_uniform_initializers.cpp4
-rw-r--r--src/glsl/link_uniforms.cpp6
-rw-r--r--src/glsl/linker.cpp2
-rw-r--r--src/glsl/lower_ubo_reference.cpp2
-rw-r--r--src/glsl/opt_dead_code.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp2
-rw-r--r--src/mesa/program/ir_to_mesa.cpp2
10 files changed, 17 insertions, 16 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index de6a86de07..00f35eb29d 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2007,7 +2007,7 @@ validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state,
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.
*/
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 2b9533a643..1c7829b032 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -442,9 +442,10 @@ public:
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) &&
diff --git a/src/glsl/link_uniform_block_active_visitor.cpp b/src/glsl/link_uniform_block_active_visitor.cpp
index 292cde343f..ddfd2b2374 100644
--- a/src/glsl/link_uniform_block_active_visitor.cpp
+++ b/src/glsl/link_uniform_block_active_visitor.cpp
@@ -73,7 +73,7 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var)
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()
@@ -124,7 +124,7 @@ link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir)
* function.
*/
if (var == NULL
- || !var->is_in_uniform_block()
+ || !var->is_in_buffer_block()
|| !var->is_interface_instance())
return visit_continue;
@@ -194,7 +194,7 @@ link_uniform_block_active_visitor::visit(ir_dereference_variable *ir)
{
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());
diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp
index 204acfa22b..d1f904e997 100644
--- a/src/glsl/link_uniform_initializers.cpp
+++ b/src/glsl/link_uniform_initializers.cpp
@@ -267,7 +267,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
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,
@@ -280,7 +280,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
* 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()) {
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 11ae06f9bf..5fdf25e0a6 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -298,7 +298,7 @@ public:
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);
@@ -431,7 +431,7 @@ public:
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);
@@ -763,7 +763,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
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);
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index b7a783c098..3005b70a4f 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1873,7 +1873,7 @@ update_array_sizes(struct gl_shader_program *prog)
* 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;
diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
index 4ea4ccb03f..a61ff29be3 100644
--- a/src/glsl/lower_ubo_reference.cpp
+++ b/src/glsl/lower_ubo_reference.cpp
@@ -228,7 +228,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
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);
diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp
index f45bf5dfdf..7b4730a39b 100644
--- a/src/glsl/opt_dead_code.cpp
+++ b/src/glsl/opt_dead_code.cpp
@@ -115,7 +115,7 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
* 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();
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index c9c26611d9..67f2b5c29f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1063,7 +1063,7 @@ vec4_visitor::visit(ir_variable *ir)
* 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
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 0b2eb12236..2bd212efaa 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2384,7 +2384,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
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);