glsl: Rename the fourth argument to get_interface_instance.
authorPaul Berry <stereotype441@gmail.com>
Tue, 8 Oct 2013 21:09:48 +0000 (14:09 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 9 Oct 2013 23:49:16 +0000 (16:49 -0700)
Interface declarations have two names associated with them: the block
name and the instance name.  It's the block name that needs to be
passed to get_interface_instance().  This patch renames the argument
so that there's no confusion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_types.cpp
src/glsl/glsl_types.h

index 4782d159df22906236e56046499fb856e10d5dcf..c4c04fe32ecf580dbcd2e3c0a32b5a9ea58bd8eb 100644 (file)
@@ -509,9 +509,9 @@ const glsl_type *
 glsl_type::get_interface_instance(const glsl_struct_field *fields,
                                  unsigned num_fields,
                                  enum glsl_interface_packing packing,
-                                 const char *name)
+                                 const char *block_name)
 {
-   const glsl_type key(fields, num_fields, packing, name);
+   const glsl_type key(fields, num_fields, packing, block_name);
 
    if (interface_types == NULL) {
       interface_types = hash_table_ctor(64, record_key_hash, record_key_compare);
@@ -519,14 +519,14 @@ glsl_type::get_interface_instance(const glsl_struct_field *fields,
 
    const glsl_type *t = (glsl_type *) hash_table_find(interface_types, & key);
    if (t == NULL) {
-      t = new glsl_type(fields, num_fields, packing, name);
+      t = new glsl_type(fields, num_fields, packing, block_name);
 
       hash_table_insert(interface_types, (void *) t, t);
    }
 
    assert(t->base_type == GLSL_TYPE_INTERFACE);
    assert(t->length == num_fields);
-   assert(strcmp(t->name, name) == 0);
+   assert(strcmp(t->name, block_name) == 0);
 
    return t;
 }
index 61c86358ad0580767f9a300b30840ce8f7d6f5c8..e60c19132d60415c21e9a493581e18dfa5a3eddb 100644 (file)
@@ -234,7 +234,7 @@ struct glsl_type {
    static const glsl_type *get_interface_instance(const glsl_struct_field *fields,
                                                  unsigned num_fields,
                                                  enum glsl_interface_packing packing,
-                                                 const char *name);
+                                                 const char *block_name);
 
    /**
     * Query the total number of scalars that make up a scalar, vector or matrix