zink: disable queries when flushing clears from set_fb
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 15 Mar 2023 22:48:22 +0000 (18:48 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Mar 2023 14:38:00 +0000 (14:38 +0000)
this otherwise has weird side effects, especially with rp optimizing enabled

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>

src/gallium/drivers/zink/zink_context.c

index 56ede69..d58434e 100644 (file)
@@ -3277,8 +3277,12 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
    }
    if (ctx->fb_state.zsbuf != state->zsbuf)
       flush_clears |= zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS);
-   if (flush_clears)
+   if (flush_clears) {
+      bool queries_disabled = ctx->queries_disabled;
+      ctx->queries_disabled = true;
       zink_batch_rp(ctx);
+      ctx->queries_disabled = queries_disabled;
+   }
    for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
       struct pipe_surface *psurf = ctx->fb_state.cbufs[i];
       if (i < state->nr_cbufs)