mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
zink: initialize cache_get_thread unconditionally
this can also be used for precompiles Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
This commit is contained in:
parent
4cb4bb555e
commit
bd12fa86fc
1 changed files with 6 additions and 6 deletions
|
|
@ -186,16 +186,13 @@ disk_cache_init(struct zink_screen *screen)
|
|||
if (!screen->disk_cache)
|
||||
return true;
|
||||
|
||||
if (!util_queue_init(&screen->cache_put_thread, "zcq", 8, 1, UTIL_QUEUE_INIT_RESIZE_IF_FULL, screen) ||
|
||||
!util_queue_init(&screen->cache_get_thread, "zcfq", 8, 4,
|
||||
UTIL_QUEUE_INIT_RESIZE_IF_FULL | UTIL_QUEUE_INIT_SCALE_THREADS, screen)) {
|
||||
if (!util_queue_init(&screen->cache_put_thread, "zcq", 8, 1, UTIL_QUEUE_INIT_RESIZE_IF_FULL, screen)) {
|
||||
mesa_loge("zink: Failed to create disk cache queue\n");
|
||||
|
||||
disk_cache_destroy(screen->disk_cache);
|
||||
screen->disk_cache = NULL;
|
||||
|
||||
util_queue_destroy(&screen->cache_put_thread);
|
||||
util_queue_destroy(&screen->cache_get_thread);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1261,13 +1258,13 @@ zink_destroy_screen(struct pipe_screen *pscreen)
|
|||
}
|
||||
|
||||
u_transfer_helper_destroy(pscreen->transfer_helper);
|
||||
util_queue_finish(&screen->cache_get_thread);
|
||||
util_queue_destroy(&screen->cache_get_thread);
|
||||
#ifdef ENABLE_SHADER_CACHE
|
||||
if (screen->disk_cache) {
|
||||
util_queue_finish(&screen->cache_put_thread);
|
||||
util_queue_finish(&screen->cache_get_thread);
|
||||
disk_cache_wait_for_idle(screen->disk_cache);
|
||||
util_queue_destroy(&screen->cache_put_thread);
|
||||
util_queue_destroy(&screen->cache_get_thread);
|
||||
}
|
||||
#endif
|
||||
disk_cache_destroy(screen->disk_cache);
|
||||
|
|
@ -2306,6 +2303,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
zink_screen_init_compiler(screen);
|
||||
if (!disk_cache_init(screen))
|
||||
goto fail;
|
||||
if (!util_queue_init(&screen->cache_get_thread, "zcfq", 8, 4,
|
||||
UTIL_QUEUE_INIT_RESIZE_IF_FULL | UTIL_QUEUE_INIT_SCALE_THREADS, screen))
|
||||
goto fail;
|
||||
populate_format_props(screen);
|
||||
pre_hash_descriptor_states(screen);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue