From ee42fa621d12638bffcfa0d458c747ef24fcb1da Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 23 Feb 2022 13:46:30 -0500 Subject: [PATCH] zink: don't free non-fbfetch dsl structs when switching to fbfetch this triggers invalid access when recycling in-flight non-fbfetch sets cc: mesa-stable Reviewed-by: Emma Anholt Part-of: (cherry picked from commit e1964e1dde7bf44ceeaf3fa8b3869e791af4a369) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_descriptors.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 83b376b9bfd..64d1346a1f8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2713,7 +2713,7 @@ "description": "zink: don't free non-fbfetch dsl structs when switching to fbfetch", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index eb93583954c..91274442a77 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1787,8 +1787,9 @@ zink_descriptor_util_init_fbfetch(struct zink_context *ctx) struct zink_screen *screen = zink_screen(ctx->base.screen); VKSCR(DestroyDescriptorSetLayout)(screen->dev, ctx->dd->push_dsl[0]->layout, NULL); - ralloc_free(ctx->dd->push_dsl[0]); - ralloc_free(ctx->dd->push_layout_keys[0]); + //don't free these now, let ralloc free on teardown to avoid invalid access + //ralloc_free(ctx->dd->push_dsl[0]); + //ralloc_free(ctx->dd->push_layout_keys[0]); ctx->dd->push_dsl[0] = create_gfx_layout(ctx, &ctx->dd->push_layout_keys[0], true); ctx->dd->has_fbfetch = true; if (screen->descriptor_mode != ZINK_DESCRIPTOR_MODE_LAZY)