summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-01-17 13:45:30 -0800
committerPaul Berry <[email protected]>2013-01-24 16:30:46 -0800
commitcd53457ffad322813ddf2f78f43e9fc1a154a004 (patch)
treebd11eeb62a234859acb7a3d56e41670da40b3db5 /src/glsl
parent1ecd23dea944dbf4cdd2c6bfa8ce0e0e09de8239 (diff)
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/link_varyings.cpp11
1 files changed, 10 insertions, 1 deletions
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: