diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 104d770b0e3..617fba9f9e0 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -1361,14 +1361,14 @@ zink_init_grid_functions(struct zink_context *ctx) void zink_init_screen_pipeline_libs(struct zink_screen *screen) { - _mesa_set_init(&screen->pipeline_libs[0], screen, hash_gfx_program<0>, equals_gfx_program<0>); - _mesa_set_init(&screen->pipeline_libs[1], screen, hash_gfx_program<1>, equals_gfx_program<1>); - _mesa_set_init(&screen->pipeline_libs[2], screen, hash_gfx_program<2>, equals_gfx_program<2>); - _mesa_set_init(&screen->pipeline_libs[3], screen, hash_gfx_program<3>, equals_gfx_program<3>); - _mesa_set_init(&screen->pipeline_libs[4], screen, hash_gfx_program<4>, equals_gfx_program<4>); - _mesa_set_init(&screen->pipeline_libs[5], screen, hash_gfx_program<5>, equals_gfx_program<5>); - _mesa_set_init(&screen->pipeline_libs[6], screen, hash_gfx_program<6>, equals_gfx_program<6>); - _mesa_set_init(&screen->pipeline_libs[7], screen, hash_gfx_program<7>, equals_gfx_program<7>); + _mesa_set_init(&screen->pipeline_libs[0], NULL, hash_gfx_program<0>, equals_gfx_program<0>); + _mesa_set_init(&screen->pipeline_libs[1], NULL, hash_gfx_program<1>, equals_gfx_program<1>); + _mesa_set_init(&screen->pipeline_libs[2], NULL, hash_gfx_program<2>, equals_gfx_program<2>); + _mesa_set_init(&screen->pipeline_libs[3], NULL, hash_gfx_program<3>, equals_gfx_program<3>); + _mesa_set_init(&screen->pipeline_libs[4], NULL, hash_gfx_program<4>, equals_gfx_program<4>); + _mesa_set_init(&screen->pipeline_libs[5], NULL, hash_gfx_program<5>, equals_gfx_program<5>); + _mesa_set_init(&screen->pipeline_libs[6], NULL, hash_gfx_program<6>, equals_gfx_program<6>); + _mesa_set_init(&screen->pipeline_libs[7], NULL, hash_gfx_program<7>, equals_gfx_program<7>); for (unsigned i = 0; i < ARRAY_SIZE(screen->pipeline_libs_lock); i++) simple_mtx_init(&screen->pipeline_libs_lock[i], mtx_plain); } diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index f3c82a7216f..80a1849eff2 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -1491,6 +1491,9 @@ zink_destroy_screen(struct pipe_screen *pscreen) if (screen->gfx_push_constant_layout) VKSCR(DestroyPipelineLayout)(screen->dev, screen->gfx_push_constant_layout, NULL); + for (unsigned i = 0; i < ARRAY_SIZE(screen->pipeline_libs); i++) + _mesa_set_fini(&screen->pipeline_libs[i], NULL); + u_transfer_helper_destroy(pscreen->transfer_helper); if (util_queue_is_initialized(&screen->cache_get_thread)) { util_queue_finish(&screen->cache_get_thread); @@ -1505,11 +1508,6 @@ zink_destroy_screen(struct pipe_screen *pscreen) #endif disk_cache_destroy(screen->disk_cache); - /* we don't have an API to check if a set is already initialized */ - for (unsigned i = 0; i < ARRAY_SIZE(screen->pipeline_libs); i++) - if (screen->pipeline_libs[i].table) - _mesa_set_clear(&screen->pipeline_libs[i], NULL); - zink_bo_deinit(screen); util_live_shader_cache_deinit(&screen->shaders);