From de903ae0c773bef30f290d00f0ad970b298c42d8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 11 May 2021 10:13:45 -0400 Subject: [PATCH] zink: make samplerview bind mask apply to buffer resources too Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 ++--- src/gallium/drivers/zink/zink_resource.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 0602d3e13bb..708aed3d346 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1338,8 +1338,7 @@ unbind_samplerview(struct zink_context *ctx, enum pipe_shader_type stage, unsign struct zink_resource *res = zink_resource(sv->base.texture); check_samplerview_for_batch_ref(ctx, sv); update_res_bind_count(ctx, res, stage == PIPE_SHADER_COMPUTE, true); - if (!res->obj->is_buffer) - res->sampler_binds[stage] &= ~BITFIELD_BIT(slot); + res->sampler_binds[stage] &= ~BITFIELD_BIT(slot); } static void @@ -1401,12 +1400,12 @@ zink_set_sampler_views(struct pipe_context *pctx, } else if (a != b) update = true; flush_pending_clears(ctx, res); - res->sampler_binds[shader_type] |= BITFIELD_BIT(start_slot + i); 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) update = true; } + res->sampler_binds[shader_type] |= BITFIELD_BIT(start_slot + i); zink_batch_resource_usage_set(&ctx->batch, res, false); } else if (a) { unbind_samplerview(ctx, shader_type, start_slot + i); diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index d92258d8164..bd447898e0f 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -114,11 +114,11 @@ struct zink_resource { VkImageLayout layout; VkImageAspectFlags aspect; bool optimal_tiling; - uint32_t sampler_binds[PIPE_SHADER_TYPES]; uint8_t fb_binds; uint16_t image_bind_count[2]; //gfx, compute }; }; + uint32_t sampler_binds[PIPE_SHADER_TYPES]; uint16_t write_bind_count[2]; //gfx, compute uint16_t bind_count[2]; //gfx, compute