diff options
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r-- | mesalib/src/mesa/main/shaderapi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 4fe9d9ca2..4c0484aaf 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -42,6 +42,7 @@ #include "main/dispatch.h" #include "main/enums.h" #include "main/hash.h" +#include "main/hash_table.h" #include "main/mtypes.h" #include "main/shaderapi.h" #include "main/shaderobj.h" @@ -812,19 +813,19 @@ static void link_program(struct gl_context *ctx, GLuint program) { struct gl_shader_program *shProg; - struct gl_transform_feedback_object *obj = - ctx->TransformFeedback.CurrentObject; shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram"); if (!shProg) return; - if (obj->Active - && (shProg == ctx->Shader.CurrentVertexProgram - || shProg == ctx->Shader.CurrentGeometryProgram - || shProg == ctx->Shader.CurrentFragmentProgram)) { + /* From the ARB_transform_feedback2 specification: + * "The error INVALID_OPERATION is generated by LinkProgram if <program> is + * the name of a program being used by one or more transform feedback + * objects, even if the objects are not currently bound or are paused." + */ + if (_mesa_transform_feedback_is_using_program(ctx, shProg)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glLinkProgram(transform feedback active)"); + "glLinkProgram(transform feedback is using the program)"); return; } @@ -1872,6 +1873,7 @@ _mesa_copy_linked_program_data(gl_shader_type type, dst_gp->InputType = src->Geom.InputType; dst_gp->OutputType = src->Geom.OutputType; dst_gp->UsesClipDistance = src->Geom.UsesClipDistance; + dst_gp->UsesEndPrimitive = src->Geom.UsesEndPrimitive; } break; default: |