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>
This commit is contained in:
Mike Blumenkrantz 2022-03-02 08:48:52 -05:00 committed by Marge Bot
parent 382798ddbd
commit c5f585f45a
1 changed files with 2 additions and 0 deletions

View File

@ -657,6 +657,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);
@ -702,6 +703,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);