zink: stop referencing framebuffers
this is a waste of cycles now that surfaces are accurately tracked; no-attachment fbs are still deferred to avoid premature deletion Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12429>
This commit is contained in:
committed by
Marge Bot
parent
1af6618694
commit
8e2159a57f
@@ -80,12 +80,6 @@ zink_reset_batch_state(struct zink_context *ctx, struct zink_batch_state *bs)
|
||||
}
|
||||
}
|
||||
|
||||
set_foreach(bs->fbs, entry) {
|
||||
struct zink_framebuffer *fb = (void*)entry->key;
|
||||
zink_framebuffer_reference(screen, &fb, NULL);
|
||||
_mesa_set_remove(bs->fbs, entry);
|
||||
}
|
||||
|
||||
pipe_resource_reference(&bs->flush_res, NULL);
|
||||
|
||||
bs->resource_size = 0;
|
||||
@@ -145,7 +139,6 @@ zink_batch_state_destroy(struct zink_screen *screen, struct zink_batch_state *bs
|
||||
if (bs->cmdpool)
|
||||
vkDestroyCommandPool(screen->dev, bs->cmdpool, NULL);
|
||||
|
||||
_mesa_set_destroy(bs->fbs, NULL);
|
||||
util_dynarray_fini(&bs->zombie_samplers);
|
||||
util_dynarray_fini(&bs->dead_framebuffers);
|
||||
_mesa_set_destroy(bs->surfaces, NULL);
|
||||
@@ -189,7 +182,6 @@ create_batch_state(struct zink_context *ctx)
|
||||
bs->ctx = ctx;
|
||||
pipe_reference_init(&bs->reference, 1);
|
||||
|
||||
SET_CREATE_OR_FAIL(bs->fbs);
|
||||
SET_CREATE_OR_FAIL(bs->resources);
|
||||
SET_CREATE_OR_FAIL(bs->surfaces);
|
||||
SET_CREATE_OR_FAIL(bs->bufferviews);
|
||||
@@ -674,16 +666,6 @@ zink_batch_reference_sampler_view(struct zink_batch *batch,
|
||||
zink_batch_reference_surface(batch, sv->image_view);
|
||||
}
|
||||
|
||||
void
|
||||
zink_batch_reference_framebuffer(struct zink_batch *batch,
|
||||
struct zink_framebuffer *fb)
|
||||
{
|
||||
bool found;
|
||||
_mesa_set_search_or_add(batch->state->fbs, fb, &found);
|
||||
if (!found)
|
||||
pipe_reference(NULL, &fb->reference);
|
||||
}
|
||||
|
||||
void
|
||||
zink_batch_reference_program(struct zink_batch *batch,
|
||||
struct zink_program *pg)
|
||||
|
||||
@@ -41,7 +41,6 @@ struct pipe_reference;
|
||||
struct zink_buffer_view;
|
||||
struct zink_context;
|
||||
struct zink_descriptor_set;
|
||||
struct zink_framebuffer;
|
||||
struct zink_image_view;
|
||||
struct zink_program;
|
||||
struct zink_render_pass;
|
||||
@@ -77,7 +76,6 @@ struct zink_batch_state {
|
||||
|
||||
struct pipe_resource *flush_res;
|
||||
|
||||
struct set *fbs;
|
||||
struct set *programs;
|
||||
|
||||
struct set *resources;
|
||||
@@ -139,9 +137,6 @@ zink_batch_state_clear_resources(struct zink_screen *screen, struct zink_batch_s
|
||||
void
|
||||
zink_reset_batch(struct zink_context *ctx, struct zink_batch *batch);
|
||||
void
|
||||
zink_batch_reference_framebuffer(struct zink_batch *batch,
|
||||
struct zink_framebuffer *fb);
|
||||
void
|
||||
zink_start_batch(struct zink_context *ctx, struct zink_batch *batch);
|
||||
|
||||
void
|
||||
|
||||
@@ -1728,7 +1728,6 @@ begin_render_pass(struct zink_context *ctx)
|
||||
|
||||
assert(ctx->gfx_pipeline_state.render_pass && ctx->framebuffer);
|
||||
|
||||
zink_batch_reference_framebuffer(batch, ctx->framebuffer);
|
||||
for (int i = 0; i < ctx->framebuffer->state.num_attachments; i++) {
|
||||
if (ctx->framebuffer->surfaces[i]) {
|
||||
struct zink_surface *surf = zink_surface(ctx->framebuffer->surfaces[i]);
|
||||
|
||||
Reference in New Issue
Block a user