summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-06-05 09:11:53 +0200
committerSamuel Iglesias Gonsalvez <[email protected]>2015-07-14 07:04:03 +0200
commit1146696f75ea0f2b49e6379c2a62602dfeb51190 (patch)
tree7dd5455f4a88910f60f0f101f4ba4c6a3b3d3fcd /src/glsl
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 <[email protected]>
Diffstat (limited to 'src/glsl')
-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
8 files changed, 15 insertions, 14 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index de6a86de07e..00f35eb29df 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 2b9533a6437..1c7829b0326 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 292cde343f9..ddfd2b23748 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 204acfa22b2..d1f904e9972 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 11ae06f9bfb..5fdf25e0a66 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 b7a783c0984..3005b70a4f6 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 4ea4ccb03f2..a61ff29be3e 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 f45bf5dfdf8..7b4730a39bb 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();