iris: partial set_query_active_state
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 8 Nov 2018 09:14:27 +0000 (01:14 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
used to avoid OQ during clears for example

fixes occlusion_query_meta_no_fragments

src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_query.c
src/gallium/drivers/iris/iris_state.c

index 54aa1a509e864f3bcb553a80a9e70f764193adde..b2f90845024c310167760af8f084959a4a511699 100644 (file)
@@ -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;
 
index e3cd3b2ef141e6f2644645956ebfe76e80d6c4ef..a0df8c6504d1fea80a58ad7b3ca4c5085183916e 100644 (file)
@@ -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
index b97266f3ad306477957047cac1252ed2e2e84d37..dec914b550b1f111db33d2976fbd0cbd93c70be6 100644 (file)
@@ -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));