zink: wait on program cache fences before destroying programs

if these still have outstanding cache jobs, deleting the object now
will cause a crash

maybe fixes some cts flakiness?

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
(cherry picked from commit c5f585f45a)
This commit is contained in:
Mike Blumenkrantz 2022-03-02 08:48:52 -05:00 committed by Dylan Baker
parent eadc089854
commit 4f1a3be5f6
2 changed files with 3 additions and 1 deletions

View file

@ -481,7 +481,7 @@
"description": "zink: wait on program cache fences before destroying programs",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -643,6 +643,7 @@ zink_destroy_gfx_program(struct zink_context *ctx,
struct zink_gfx_program *prog)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
util_queue_fence_wait(&prog->base.cache_fence);
if (prog->base.layout)
VKSCR(DestroyPipelineLayout)(screen->dev, prog->base.layout, NULL);
@ -688,6 +689,7 @@ zink_destroy_compute_program(struct zink_context *ctx,
struct zink_compute_program *comp)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
util_queue_fence_wait(&comp->base.cache_fence);
if (comp->base.layout)
VKSCR(DestroyPipelineLayout)(screen->dev, comp->base.layout, NULL);