mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 07:10:15 +01: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>
This commit is contained in:
parent
4303ea7b9a
commit
fd297ecf98
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
@ -1547,7 +1549,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