i965/cnl: Implement depth count workaround
authorBen Widawsky <benjamin.widawsky@intel.com>
Mon, 4 Jan 2016 18:48:39 +0000 (10:48 -0800)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 9 Jun 2017 23:02:59 +0000 (16:02 -0700)
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_queryobj.c

index a7b896243d6fbf3559e966252d1ae1d984f9f2b7..9ad4779322b2fd0a63a9164778224084355c524d 100644 (file)
@@ -111,6 +111,14 @@ brw_write_depth_count(struct brw_context *brw, struct brw_bo *query_bo, int idx)
    if (brw->gen == 9 && brw->gt == 4)
       flags |= PIPE_CONTROL_CS_STALL;
 
+   if (brw->gen >= 10) {
+      /* "Driver must program PIPE_CONTROL with only Depth Stall Enable bit set
+       * prior to programming a PIPE_CONTROL with Write PS Depth Count Post sync
+       * operation."
+       */
+      brw_emit_pipe_control_flush(brw, PIPE_CONTROL_DEPTH_STALL);
+   }
+
    brw_emit_pipe_control_write(brw, flags,
                                query_bo, idx * sizeof(uint64_t),
                                0, 0);