[Mesa-dev] [PATCH 1/2] i965: Disable unused transform feedback buffers.
Iago Toral Quiroga
itoral at igalia.com
Mon Jun 30 01:36:04 PDT 2014
If we are not recording any varying data to a particular transform feedback
buffer, disable it.
---
src/mesa/drivers/dri/i965/gen7_sol_state.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index d2c3ae3..1aae659 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -220,6 +220,8 @@ upload_3dstate_streamout(struct brw_context *brw, bool active,
/* BRW_NEW_TRANSFORM_FEEDBACK */
struct gl_transform_feedback_object *xfb_obj =
ctx->TransformFeedback.CurrentObject;
+ const struct gl_transform_feedback_info *linked_xfb_info =
+ &xfb_obj->shader_program->LinkedTransformFeedback;
uint32_t dw1 = 0, dw2 = 0;
int i;
@@ -250,9 +252,9 @@ upload_3dstate_streamout(struct brw_context *brw, bool active,
dw1 |= SO_REORDER_TRAILING;
for (i = 0; i < 4; i++) {
- if (xfb_obj->Buffers[i]) {
- dw1 |= SO_BUFFER_ENABLE(i);
- }
+ if (xfb_obj->Buffers[i] && linked_xfb_info->BufferStride[i] > 0) {
+ dw1 |= SO_BUFFER_ENABLE(i);
+ }
}
/* We always read the whole vertex. This could be reduced at some
--
1.9.1
More information about the mesa-dev
mailing list