summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-02-16 21:31:57 -0800
committerKenneth Graunke <[email protected]>2017-02-21 12:38:13 -0800
commiteb0331382aab7322380c330b015dca2d54ca2881 (patch)
treedc8bbad8278fcb9a36e8c9e0caca05a2108d355d
parent8513090cd751b35d03462b6ee8bef46c1f49f608 (diff)
i965: Save max_index in brw_transform_feedback_object.
I'm going to need this in a new Resume hook shortly. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h6
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sol.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index ca956dee5ea..dde52cce67f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -557,6 +557,12 @@ struct brw_transform_feedback_object {
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.
* @{
*/
diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index 8adac92d07d..f1cc2d59fd4 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -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,