From 2727a942a483648135ad9fdb310e70304eb7617e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 8 Nov 2018 01:14:27 -0800 Subject: [PATCH] iris: partial set_query_active_state used to avoid OQ during clears for example fixes occlusion_query_meta_no_fragments --- src/gallium/drivers/iris/iris_context.h | 2 ++ src/gallium/drivers/iris/iris_query.c | 19 +++++++++++++++++-- src/gallium/drivers/iris/iris_state.c | 5 ++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 54aa1a509e8..b2f90845024 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -453,6 +453,8 @@ struct iris_context { struct pipe_stream_output_target *so_target[PIPE_MAX_SO_BUFFERS]; bool streamout_active; + bool statistics_counters_enabled; + /** Is a PIPE_QUERY_PRIMITIVES_GENERATED query active? */ bool prims_generated_query_active; diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index e3cd3b2ef14..a0df8c6504d 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -560,9 +560,24 @@ iris_get_query_result_resource(struct pipe_context *ctx, } static void -iris_set_active_query_state(struct pipe_context *pipe, boolean enable) +iris_set_active_query_state(struct pipe_context *ctx, boolean enable) { - /* Do nothing, intentionally - only u_blitter uses this. */ + struct iris_context *ice = (void *) ctx; + + if (ice->state.statistics_counters_enabled == enable) + return; + + // XXX: most packets aren't paying attention to this yet, because it'd + // have to be done dynamically at draw time, which is a pain + ice->state.statistics_counters_enabled = enable; + ice->state.dirty |= IRIS_DIRTY_CLIP | + IRIS_DIRTY_GS | + IRIS_DIRTY_RASTER | + IRIS_DIRTY_STREAMOUT | + IRIS_DIRTY_TCS | + IRIS_DIRTY_TES | + IRIS_DIRTY_VS | + IRIS_DIRTY_WM; } void diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index b97266f3ad3..dec914b550b 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1132,7 +1132,6 @@ iris_create_rasterizer_state(struct pipe_context *ctx, wm.LineAntialiasingRegionWidth = _10pixels; wm.LineEndCapAntialiasingRegionWidth = _05pixels; wm.PointRasterizationRule = RASTRULE_UPPER_RIGHT; - wm.StatisticsEnable = true; wm.LineStippleEnable = state->line_stipple_enable; wm.PolygonStippleEnable = state->poly_stipple_enable; } @@ -4132,6 +4131,8 @@ iris_upload_dirty_render_state(struct iris_context *ice, uint32_t dynamic_wm[GENX(3DSTATE_WM_length)]; iris_pack_command(GENX(3DSTATE_WM), &dynamic_wm, wm) { + wm.StatisticsEnable = ice->state.statistics_counters_enabled; + wm.BarycentricInterpolationMode = wm_prog_data->barycentric_interp_modes; @@ -5183,6 +5184,8 @@ genX(init_state)(struct iris_context *ice) ice->state.dirty = ~0ull; + ice->state.statistics_counters_enabled = true; + ice->state.sample_mask = 0xffff; ice->state.num_viewports = 1; ice->state.genx = calloc(1, sizeof(struct iris_genx_state)); -- 2.30.2