From 5dc7233f444a84f6317509e690c861a87562775e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Apr 2018 09:38:16 -0600 Subject: [PATCH] glsl: rename 'interface' var to 'iface' to fix MSVC build 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 Reviewed-by: Neha Bhende --- src/compiler/glsl/linker.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index ecd267b24f3..f060c5316fa 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -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; -- 2.30.2