mesa: rename is_in_uniform_block to is_in_buffer_block
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 5 Jun 2015 07:11:53 +0000 (09:11 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 14 Jul 2015 05:04:03 +0000 (07:04 +0200)
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>
src/glsl/ast_to_hir.cpp
src/glsl/ir.h
src/glsl/link_uniform_block_active_visitor.cpp
src/glsl/link_uniform_initializers.cpp
src/glsl/link_uniforms.cpp
src/glsl/linker.cpp
src/glsl/lower_ubo_reference.cpp
src/glsl/opt_dead_code.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/program/ir_to_mesa.cpp

index de6a86de07e1b8445edf3ab50c18db94a7b9e554..00f35eb29dfce49b92d2d84c058858301850cc5f 100644 (file)
@@ -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.
        */
index 2b9533a64378890bc672d9ede9cffef13f1c59d0..1c7829b0326f3e62762df60be3bb13c084fc6223 100644 (file)
@@ -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) &&
index 292cde343f90ba2999e44a1971576e1fe0d3bc2a..ddfd2b23748db4e3850af36e6de901a9fa9dfb56 100644 (file)
@@ -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());
index 204acfa22b2d133003be2547be1103de00bcf45b..d1f904e99722e742d349ab74b91535413880576f 100644 (file)
@@ -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()) {
index 11ae06f9bfba523748ab708d0449b26def20e83a..5fdf25e0a6680ca186339925a2483bf249a5c1ab 100644 (file)
@@ -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);
index b7a783c0984be2fe5c9432f3f22f4d5183ab14d3..3005b70a4f674efc91fcc1dc22da5b8d2e2ba694 100644 (file)
@@ -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;
index 4ea4ccb03f2b9de4006d1c688adec3f194d38725..a61ff29be3ece81df19a9baac9bdcf164b2f284a 100644 (file)
@@ -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);
index f45bf5dfdf817434f03a3e723fafc56bca1b9d83..7b4730a39bb78f84e63fca084e60338d65205ea2 100644 (file)
@@ -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();
index c9c26611d95569c146e06fab370c036099d289c0..67f2b5c29ff420ab944b353b1e518e3e2ddd3eb6 100644 (file)
@@ -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
index 0b2eb122364140eaf5d6255941498eb9c3039513..2bd212efaa1ec8078457bdc28e77f8f0c022580a 100644 (file)
@@ -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);