i965: Save max_index in brw_transform_feedback_object.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 17 Feb 2017 05:31:57 +0000 (21:31 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 21 Feb 2017 20:38:13 +0000 (12:38 -0800)
I'm going to need this in a new Resume hook shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen6_sol.c

index ca956dee5ea67a3e9779088da51b2ad10f7abc0b..dde52cce67f0d1cc13c0cacb384abc511ab435a9 100644 (file)
@@ -556,6 +556,12 @@ struct brw_transform_feedback_object {
    /** The most recent primitive mode (GL_TRIANGLES/GL_POINTS/GL_LINES). */
    GLenum primitive_mode;
 
+   /**
+    * The maximum number of vertices that we can write without overflowing
+    * any of the buffers currently being used for transform feedback.
+    */
+   unsigned max_index;
+
    /**
     * Count of primitives generated during this transform feedback operation.
     *  @{
index 8adac92d07d89d855ec4c44f2c728da9d5c32651..f1cc2d59fd4ef74734510584025baaff2a27ff1b 100644 (file)
@@ -382,6 +382,8 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
    const struct gl_transform_feedback_info *linked_xfb_info;
    struct gl_transform_feedback_object *xfb_obj =
       ctx->TransformFeedback.CurrentObject;
+   struct brw_transform_feedback_object *brw_obj =
+      (struct brw_transform_feedback_object *) xfb_obj;
 
    assert(brw->gen == 6);
 
@@ -397,7 +399,7 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
    /* Compute the maximum number of vertices that we can write without
     * overflowing any of the buffers currently being used for feedback.
     */
-   unsigned max_index
+   brw_obj->max_index
       = _mesa_compute_max_transform_feedback_vertices(ctx, xfb_obj,
                                                       linked_xfb_info);
 
@@ -406,7 +408,7 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
    OUT_BATCH(_3DSTATE_GS_SVB_INDEX << 16 | (4 - 2));
    OUT_BATCH(0); /* SVBI 0 */
    OUT_BATCH(0); /* starting index */
-   OUT_BATCH(max_index);
+   OUT_BATCH(brw_obj->max_index);
    ADVANCE_BATCH();
 
    /* Initialize the rest of the unused streams to sane values.  Otherwise,