From 630967b2521bbc52a941d78e7b1adf9222020231 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 22 Sep 2022 11:28:51 -0400 Subject: [PATCH] zink: rename fb_binds -> fb_bind_count this is more accurate Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_context.c | 12 ++++++------ src/gallium/drivers/zink/zink_descriptors.c | 2 +- src/gallium/drivers/zink/zink_resource.c | 4 ++-- src/gallium/drivers/zink/zink_resource.h | 2 +- src/gallium/drivers/zink/zink_types.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index a1ba192..9c26659 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1563,7 +1563,7 @@ update_binds_for_samplerviews(struct zink_context *ctx, struct zink_resource *re static void flush_pending_clears(struct zink_context *ctx, struct zink_resource *res) { - if (res->fb_binds && ctx->clears_enabled) + if (res->fb_bind_count && ctx->clears_enabled) zink_fb_clears_apply(ctx, &res->base.b); } @@ -2802,8 +2802,8 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned if (changed) { ctx->rp_changed = true; } - res->fb_binds--; - if (!res->fb_binds) { + res->fb_bind_count--; + if (!res->fb_bind_count) { check_resource_for_batch_ref(ctx, res); if (res->sampler_bind_count[0]) update_res_sampler_layouts(ctx, res); @@ -2930,7 +2930,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx, } } } - res->fb_binds++; + res->fb_bind_count++; if (util_format_has_alpha1(psurf->format)) { if (!res->valid && !zink_fb_clear_full_exists(ctx, i)) ctx->void_clears |= (PIPE_CLEAR_COLOR0 << i); @@ -2947,7 +2947,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx, samples = MAX3(transient ? transient->base.nr_samples : 1, psurf->texture->nr_samples, 1); if (zink_csurface(psurf)->info.layerCount > layers) ctx->fb_layer_mismatch |= BITFIELD_BIT(PIPE_MAX_COLOR_BUFS); - zink_resource(psurf->texture)->fb_binds++; + zink_resource(psurf->texture)->fb_bind_count++; switch (psurf->format) { case PIPE_FORMAT_Z16_UNORM: case PIPE_FORMAT_Z16_UNORM_S8_UINT: @@ -3294,7 +3294,7 @@ resource_check_defer_image_barrier(struct zink_context *ctx, struct zink_resourc bool is_shader = is_shader_pipline_stage(pipeline); if ((is_shader || !res->bind_count[is_compute]) && /* if no layout change is needed between gfx and compute, do nothing */ - !res->bind_count[!is_compute] && (!is_compute || !res->fb_binds)) + !res->bind_count[!is_compute] && (!is_compute || !res->fb_bind_count)) return; if (res->bind_count[!is_compute] && is_shader) { diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index b450344..31ec089 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -268,7 +268,7 @@ zink_descriptor_util_image_layout_eval(const struct zink_context *ctx, const str if (res->image_bind_count[is_compute]) return VK_IMAGE_LAYOUT_GENERAL; if (res->aspect & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { - if (!is_compute && res->fb_binds && + if (!is_compute && res->fb_bind_count && ctx->gfx_pipeline_state.render_pass && ctx->gfx_pipeline_state.render_pass->state.rts[ctx->fb_state.nr_cbufs].mixed_zs) return VK_IMAGE_LAYOUT_GENERAL; if (res->obj->vkusage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 1529a2a..b1a273c 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1632,7 +1632,7 @@ zink_resource_invalidate(struct pipe_context *pctx, struct pipe_resource *pres) invalidate_buffer(zink_context(pctx), zink_resource(pres)); else { struct zink_resource *res = zink_resource(pres); - if (res->valid && res->fb_binds) + if (res->valid && res->fb_bind_count) zink_context(pctx)->rp_loadop_changed = true; res->valid = false; } @@ -2027,7 +2027,7 @@ zink_image_map(struct pipe_context *pctx, if (!ptr) goto fail; if (usage & PIPE_MAP_WRITE) { - if (!res->valid && res->fb_binds) + if (!res->valid && res->fb_bind_count) ctx->rp_loadop_changed = true; res->valid = true; } diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index 25afa81..5ec3561 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -160,7 +160,7 @@ zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *re util_dynarray_append(&batch->state->acquires, VkSemaphore, acquire); } if (write && !res->obj->is_buffer) { - if (!res->valid && res->fb_binds) + if (!res->valid && res->fb_bind_count) batch->state->ctx->rp_loadop_changed = true; res->valid = true; } diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index c713201..1f94f5d 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -998,7 +998,7 @@ struct zink_resource { bool linear; bool need_2D; bool valid; - uint8_t fb_binds; //not counted in all_binds + uint8_t fb_bind_count; //not counted in all_binds }; }; uint32_t sampler_binds[MESA_SHADER_STAGES]; -- 2.7.4