From cd53457ffad322813ddf2f78f43e9fc1a154a004 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Thu, 17 Jan 2013 13:45:30 -0800 Subject: glsl: Disable transform feedback of varying structs. It is not clear from the GLSL ES 3.00 spec how transform feedback is supposed to apply to varying structs: - There is no specification for how the structure is to be packed when it is recorded into the transform feedback buffer. - There is no reasonable value for GetTransformFeedbackVarying to return as the "type" of the variable. We currently have a Khronos bug requesting clarification on how this feature is supposed to work (https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9856). This patch just disables transform feedback of varying structs for now; we can implement the proper behaviour once we find out from Khronos what it is. Reviewed-by: Jordan Justen Reviewed-by: Eric Anholt --- src/glsl/link_varyings.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index d8f501cfd8b..25681d6185b 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -411,8 +411,17 @@ tfeedback_decl::find_output_var(gl_shader_program *prog, const char *name = this->is_clip_distance_mesa ? "gl_ClipDistanceMESA" : this->var_name; ir_variable *var = producer->symbols->get_variable(name); - if (var && var->mode == ir_var_shader_out) + if (var && var->mode == ir_var_shader_out) { + const glsl_type *type = var->type; + while (type->base_type == GLSL_TYPE_ARRAY) + type = type->fields.array; + if (type->base_type == GLSL_TYPE_STRUCT) { + linker_error(prog, "Transform feedback of varying structs not " + "implemented yet."); + return NULL; + } return var; + } /* From GL_EXT_transform_feedback: * A program will fail to link if: -- cgit v1.2.3