mesa: Track the vertex program active at BeginTransformFeedback() time.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 6 Sep 2013 21:47:19 +0000 (14:47 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Sep 2013 17:19:07 +0000 (10:19 -0700)
The next few patches will use this for API error checking.

All of the drivers appear to CALLOC_STRUCT transform feedback objects,
so this should be properly NULL initialized on creation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/mtypes.h
src/mesa/main/transformfeedback.c

index 9df165403bdb2d01dc19d4f58fe67af30e203848..b9625e8e72b322a58d81d6070f6a6b04da402b89 100644 (file)
@@ -1717,6 +1717,12 @@ struct gl_transform_feedback_object
                                 at least once? */
    GLboolean EverBound; /**< Has this object been bound? */
 
+   /**
+    * The shader program active when BeginTransformFeedback() was called.
+    * When active and unpaused, this equals ctx->Shader.CurrentVertexProgram.
+    */
+   struct gl_shader_program *shader_program;
+
    /**
     * GLES: if Active is true, remaining number of primitives which can be
     * rendered without overflow.  This is necessary to track because GLES
index eca0e5f55c95dd9173fee9cac96fe3ac644b6e0c..c2c14a1d33948f1bcfa06d5ea48b0bde2910b487 100644 (file)
@@ -406,6 +406,8 @@ _mesa_BeginTransformFeedback(GLenum mode)
       obj->GlesRemainingPrims = max_vertices / vertices_per_prim;
    }
 
+   obj->shader_program = ctx->Shader.CurrentVertexProgram;
+
    assert(ctx->Driver.BeginTransformFeedback);
    ctx->Driver.BeginTransformFeedback(ctx, mode, obj);
 }