From 405d45f00963b142d56ab3d2c9c1e5405cbace2d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 11 May 2021 16:20:09 -0400 Subject: [PATCH] zink: flatten descriptor_refs_dirty into BATCH_CHANGED template that's all this is now Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 -- src/gallium/drivers/zink/zink_context.h | 1 - src/gallium/drivers/zink/zink_draw.cpp | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 7b87a14df1a..600c26bb03c 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1853,7 +1853,6 @@ zink_update_descriptor_refs(struct zink_context *ctx, bool compute) if (ctx->curr_program) zink_batch_reference_program(batch, &ctx->curr_program->base); } - ctx->descriptor_refs_dirty[compute] = false; } static void @@ -1876,7 +1875,6 @@ flush_batch(struct zink_context *ctx, bool sync) zink_start_batch(ctx, batch); if (zink_screen(ctx->base.screen)->info.have_EXT_transform_feedback && ctx->num_so_targets) ctx->dirty_so_targets = true; - ctx->descriptor_refs_dirty[0] = ctx->descriptor_refs_dirty[1] = true; ctx->pipeline_changed[0] = ctx->pipeline_changed[1] = true; zink_select_draw_vbo(ctx); zink_select_launch_grid(ctx); diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 2202b9ee6dc..ded384a32dc 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -288,7 +288,6 @@ struct zink_context { struct zink_descriptor_surface sampler_surfaces[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; struct zink_descriptor_surface image_surfaces[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_IMAGES]; } di; - bool descriptor_refs_dirty[2]; struct set *need_barriers[2]; //gfx, compute struct set update_barriers[2][2]; //[gfx, compute][current, next] uint8_t barrier_set_idx[2]; diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 253a7dfeb65..30b8c6d7d34 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -491,7 +491,7 @@ zink_draw_vbo(struct pipe_context *pctx, barrier_draw_buffers(ctx, dinfo, dindirect, index_buffer); - if (ctx->descriptor_refs_dirty[0]) + if (BATCH_CHANGED) zink_update_descriptor_refs(ctx, false); batch = zink_batch_rp(ctx); @@ -776,7 +776,7 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info) VkPipeline pipeline = zink_get_compute_pipeline(screen, ctx->curr_compute, &ctx->compute_pipeline_state); - if (ctx->descriptor_refs_dirty[1]) + if (BATCH_CHANGED) zink_update_descriptor_refs(ctx, true); if (prev_pipeline != pipeline || BATCH_CHANGED)