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 <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
(cherry picked from commit e1964e1dde)
This commit is contained in:
Mike Blumenkrantz 2022-02-23 13:46:30 -05:00 committed by Dylan Baker
parent 65a55ea2a8
commit ee42fa621d
2 changed files with 4 additions and 3 deletions

View file

@ -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
},

View file

@ -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)