Mesa (master): mesa: Track the vertex program active at BeginTransformFeedback() time.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Sep 12 21:41:37 UTC 2013


Module: Mesa
Branch: master
Commit: c732f68cf4aca06bac03e6a70c49047057c0c357
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c732f68cf4aca06bac03e6a70c49047057c0c357

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Sep  6 14:47:19 2013 -0700

mesa: Track the vertex program active at BeginTransformFeedback() time.

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 at whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/mtypes.h            |    6 ++++++
 src/mesa/main/transformfeedback.c |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9df1654..b9625e8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1718,6 +1718,12 @@ struct gl_transform_feedback_object
    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
     * requires us to generate INVALID_OPERATION if a call to glDrawArrays or
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index eca0e5f..c2c14a1 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -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);
 }




More information about the mesa-commit mailing list