From 69ec429c00ee32d5bf51e549876b9ca2daf2cbf6 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 8 Feb 2022 11:03:48 -0500 Subject: [PATCH] zink: restrict clear flushing on sampler/image bind to compute binds this is otherwise going to be handled on the next renderpass start Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 35193add6c1..07fc69f8c85 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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)