diff --git a/.pick_status.json b/.pick_status.json index 158ad7e294d..750a811bde0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4114,7 +4114,7 @@ "description": "zink: don't use screen ralloc context for screen::pipeline_libs", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index ba5371f99fe..f2a32fdb8e8 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -1324,14 +1324,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 93bdd325299..5eb32f4505c 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -1483,6 +1483,11 @@ 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++) { + ralloc_free(screen->pipeline_libs[i].table); + screen->pipeline_libs[i].table = NULL; + } + u_transfer_helper_destroy(pscreen->transfer_helper); if (util_queue_is_initialized(&screen->cache_get_thread)) { util_queue_finish(&screen->cache_get_thread); @@ -1497,11 +1502,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);