mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
zink: always add a per-prog ref for gpl libs
previously non-separable progs had their libs owned exclusively by
the shaders, which meant it was possible for a background compile job
to crash while the context was being destroyed when accessing libs
which no longer had active shaders
fixes #9234
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25088>
(cherry picked from commit fd297ecf98)
This commit is contained in:
parent
47b531ce42
commit
6bc350389e
2 changed files with 4 additions and 2 deletions
|
|
@ -5854,7 +5854,7 @@
|
|||
"description": "zink: always add a per-prog ref for gpl libs",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1121,6 +1121,8 @@ zink_create_gfx_program(struct zink_context *ctx,
|
|||
|
||||
if (screen->optimal_keys)
|
||||
prog->libs = find_or_create_lib_cache(screen, prog);
|
||||
if (prog->libs)
|
||||
p_atomic_inc(&prog->libs->refcount);
|
||||
|
||||
struct mesa_sha1 sctx;
|
||||
_mesa_sha1_init(&sctx);
|
||||
|
|
@ -1545,7 +1547,7 @@ zink_destroy_gfx_program(struct zink_screen *screen,
|
|||
blob_finish(&prog->blobs[i]);
|
||||
}
|
||||
}
|
||||
if (prog->is_separable && prog->libs)
|
||||
if (prog->libs)
|
||||
zink_gfx_lib_cache_unref(screen, prog->libs);
|
||||
|
||||
ralloc_free(prog);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue