summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2015-05-07 16:07:15 +0300
committerTopi Pohjolainen <[email protected]>2015-05-07 22:30:18 +0300
commitb1119ce838462ff533512188c969fc28ab6a89a9 (patch)
tree47895e5a9e579c2066af5ac549e68ad030eded0a
parentdae7183cdd3a73a14b1b9098d1fc8456dd5a8f93 (diff)
i965/wm/gen6: Add option for disabling statistics collection
Normally this is always needed but for internal blits and clears we need to be able to disable it. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_state.h3
-rw-r--r--src/mesa/drivers/dri/i965/gen6_wm_state.c14
2 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index 18449c43c18..26fdae64ea4 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -339,7 +339,8 @@ gen6_upload_wm_state(struct brw_context *brw,
bool multisampled_fbo, int min_inv_per_frag,
bool dual_source_blend_enable, bool kill_enable,
bool color_buffer_write_enable, bool msaa_enabled,
- bool line_stipple_enable, bool polygon_stipple_enable);
+ bool line_stipple_enable, bool polygon_stipple_enable,
+ bool statistic_enable);
/* gen6_sf_state.c */
void
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index e5b0f5ab030..7081eb73428 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -73,7 +73,8 @@ gen6_upload_wm_state(struct brw_context *brw,
bool multisampled_fbo, int min_inv_per_frag,
bool dual_source_blend_enable, bool kill_enable,
bool color_buffer_write_enable, bool msaa_enabled,
- bool line_stipple_enable, bool polygon_stipple_enable)
+ bool line_stipple_enable, bool polygon_stipple_enable,
+ bool statistic_enable)
{
uint32_t dw2, dw4, dw5, dw6, ksp0, ksp2;
@@ -109,7 +110,10 @@ gen6_upload_wm_state(struct brw_context *brw,
}
dw2 = dw4 = dw5 = dw6 = ksp2 = 0;
- dw4 |= GEN6_WM_STATISTICS_ENABLE;
+
+ if (statistic_enable)
+ dw4 |= GEN6_WM_STATISTICS_ENABLE;
+
dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0;
dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5;
@@ -300,6 +304,9 @@ upload_wm_state(struct brw_context *brw)
ctx->Multisample.SampleAlphaToCoverage ||
prog_data->uses_omask;
+ /* Rendering against the gl-context is always taken into account. */
+ const bool statistic_enable = true;
+
/* _NEW_LINE | _NEW_POLYGON | _NEW_BUFFERS | _NEW_COLOR |
* _NEW_MULTISAMPLE
*/
@@ -308,7 +315,8 @@ upload_wm_state(struct brw_context *brw)
dual_src_blend_enable, kill_enable,
brw_color_buffer_write_enabled(brw),
ctx->Multisample.Enabled,
- ctx->Line.StippleFlag, ctx->Polygon.StippleFlag);
+ ctx->Line.StippleFlag, ctx->Polygon.StippleFlag,
+ statistic_enable);
}
const struct brw_tracked_state gen6_wm_state = {