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 Eric Engestrom
parent 969b7b4a8a
commit ffee465701
2 changed files with 3 additions and 1 deletions

View file

@ -1669,7 +1669,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

@ -557,6 +557,7 @@ void
zink_destroy_gfx_program(struct zink_screen *screen,
struct zink_gfx_program *prog)
{
util_queue_fence_wait(&prog->base.cache_fence);
if (prog->base.layout)
VKSCR(DestroyPipelineLayout)(screen->dev, prog->base.layout, NULL);
@ -601,6 +602,7 @@ void
zink_destroy_compute_program(struct zink_screen *screen,
struct zink_compute_program *comp)
{
util_queue_fence_wait(&comp->base.cache_fence);
if (comp->base.layout)
VKSCR(DestroyPipelineLayout)(screen->dev, comp->base.layout, NULL);