From 98d40b4d1195ebfaa2fd9ed43755ca6896422c1a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 1 Jun 2016 09:21:01 +1000 Subject: Revert "glsl: fix xfb_offset unsized array validation" This reverts commit aac90ba2920cf5ceb4df6dba776dd3952780e456. The commit caused a regression in: piglit.spec.glsl-1_50.compiler.gs-input-nonarray-named-block.geom Also the CTS test it was meant to fix seems like it may be bogus. Cc: "12.0" --- src/compiler/glsl/link_varyings.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/compiler/glsl/link_varyings.cpp') diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index 34c8906db2f..7c3bedf3574 100644 --- a/src/compiler/glsl/link_varyings.cpp +++ b/src/compiler/glsl/link_varyings.cpp @@ -40,6 +40,29 @@ #include "program.h" +/** + * Get the varying type stripped of the outermost array if we're processing + * a stage whose varyings are arrays indexed by a vertex number (such as + * geometry shader inputs). + */ +static const glsl_type * +get_varying_type(const ir_variable *var, gl_shader_stage stage) +{ + const glsl_type *type = var->type; + + if (!var->data.patch && + ((var->data.mode == ir_var_shader_out && + stage == MESA_SHADER_TESS_CTRL) || + (var->data.mode == ir_var_shader_in && + (stage == MESA_SHADER_TESS_CTRL || stage == MESA_SHADER_TESS_EVAL || + stage == MESA_SHADER_GEOMETRY)))) { + assert(type->is_array()); + type = type->fields.array; + } + + return type; +} + static void create_xfb_varying_names(void *mem_ctx, const glsl_type *t, char **name, size_t name_length, unsigned *count, -- cgit v1.2.3