intel/blorp: Work around Sandy Bridge occlusion query issue
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 8 Jun 2017 16:36:15 +0000 (09:36 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jun 2017 01:15:05 +0000 (18:15 -0700)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/blorp/blorp_clear.c

index 3d5c41cc714698bc91768017aedc4c743eebb21e..efacadfebe45d1af664f32e12b8c288d7794cc0b 100644 (file)
@@ -479,6 +479,16 @@ blorp_clear_depth_stencil(struct blorp_batch *batch,
    params.x1 = x1;
    params.y1 = y1;
 
+   if (ISL_DEV_GEN(batch->blorp->isl_dev) == 6) {
+      /* For some reason, Sandy Bridge gets occlusion queries wrong if we
+       * don't have a shader.  In particular, it records samples even though
+       * we disable statistics in 3DSTATE_WM.  Give it the usual clear shader
+       * to work around the issue.
+       */
+      if (!blorp_params_get_clear_kernel(batch->blorp, &params, false))
+         return;
+   }
+
    while (num_layers > 0) {
       params.num_layers = num_layers;