zink: restrict clear flushing on sampler/image bind to compute binds
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 8 Feb 2022 16:03:48 +0000 (11:03 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 28 Feb 2022 17:42:58 +0000 (17:42 +0000)
this is otherwise going to be handled on the next renderpass start

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>

src/gallium/drivers/zink/zink_context.c

index 35193ad..07fc69f 100644 (file)
@@ -1337,7 +1337,8 @@ create_image_surface(struct zink_context *ctx, const struct pipe_image_view *vie
    /* this is actually a zink_ctx_surface, but we just want the inner surface */
    struct zink_surface *surface = zink_csurface(psurf);
    FREE(psurf);
-   flush_pending_clears(ctx, res);
+   if (is_compute)
+      flush_pending_clears(ctx, res);
    return surface;
 }
 
@@ -1487,7 +1488,8 @@ zink_set_sampler_views(struct pipe_context *pctx,
                 update |= iv != b->image_view->image_view;
              } else  if (a != b)
                 update = true;
-             flush_pending_clears(ctx, res);
+             if (shader_type == PIPE_SHADER_COMPUTE)
+                flush_pending_clears(ctx, res);
              check_for_layout_update(ctx, res, shader_type == PIPE_SHADER_COMPUTE);
              zink_batch_usage_set(&b->image_view->batch_uses, ctx->batch.state);
              if (!a)