glsl: rename 'interface' var to 'iface' to fix MSVC build
authorBrian Paul <brianp@vmware.com>
Fri, 13 Apr 2018 15:38:16 +0000 (09:38 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 13 Apr 2018 19:53:08 +0000 (13:53 -0600)
The recent mtypes.h removal patches seems to have exposed a MSVC
issue where 'interface' is defined as a macro in an MSVC header file.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
src/compiler/glsl/linker.cpp

index ecd267b24f3ac869b66703d09c6e8525f8e3ef8a..f060c5316fa850bf8d6f490c23bf4af5946bf2de 100644 (file)
@@ -4201,7 +4201,7 @@ get_array_size(struct gl_uniform_storage *uni, const glsl_struct_field *field,
 
 static int
 get_array_stride(struct gl_context *ctx, struct gl_uniform_storage *uni,
-                 const glsl_type *interface, const glsl_struct_field *field,
+                 const glsl_type *iface, const glsl_struct_field *field,
                  char *interface_name, char *var_name)
 {
    /* The ARB_program_interface_query spec says:
@@ -4227,7 +4227,7 @@ get_array_stride(struct gl_context *ctx, struct gl_uniform_storage *uni,
          return 0;
 
       if (GLSL_INTERFACE_PACKING_STD140 ==
-          interface->
+          iface->
              get_internal_ifc_packing(ctx->Const.UseSTD430AsDefaultPacking)) {
          if (array_type->is_record() || array_type->is_array())
             return glsl_align(array_type->std140_size(row_major), 16);
@@ -4281,17 +4281,17 @@ calculate_array_size_and_stride(struct gl_context *ctx,
              var->data.mode != ir_var_shader_storage)
             continue;
 
-         const glsl_type *interface = var->get_interface_type();
+         const glsl_type *iface = var->get_interface_type();
 
-         if (strcmp(interface_name, interface->name) != 0)
+         if (strcmp(interface_name, iface->name) != 0)
             continue;
 
-         for (unsigned i = 0; i < interface->length; i++) {
-            const glsl_struct_field *field = &interface->fields.structure[i];
+         for (unsigned i = 0; i < iface->length; i++) {
+            const glsl_struct_field *field = &iface->fields.structure[i];
             if (strcmp(field->name, var_name) != 0)
                continue;
 
-            array_stride = get_array_stride(ctx, uni, interface, field,
+            array_stride = get_array_stride(ctx, uni, iface, field,
                                             interface_name, var_name);
             array_size = get_array_size(uni, field, interface_name, var_name);
             goto write_top_level_array_size_and_stride;