zink: add param to allow cache_get jobs to run directly

this will be useful 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:
Mike Blumenkrantz 2022-08-12 10:34:14 -04:00 committed by Marge Bot
parent 40878e212f
commit 8cdb227fe7
3 changed files with 8 additions and 5 deletions

View file

@ -676,7 +676,7 @@ zink_create_gfx_program(struct zink_context *ctx,
if (!zink_descriptor_program_init(ctx, &prog->base))
goto fail;
zink_screen_get_pipeline_cache(screen, &prog->base);
zink_screen_get_pipeline_cache(screen, &prog->base, false);
return prog;
fail:
@ -751,7 +751,7 @@ create_compute_program(struct zink_context *ctx, nir_shader *nir)
if (!zink_descriptor_program_init(ctx, &comp->base))
goto fail;
zink_screen_get_pipeline_cache(screen, &comp->base);
zink_screen_get_pipeline_cache(screen, &comp->base, false);
return comp;
fail:

View file

@ -265,12 +265,15 @@ cache_get_job(void *data, void *gdata, int thread_index)
}
void
zink_screen_get_pipeline_cache(struct zink_screen *screen, struct zink_program *pg)
zink_screen_get_pipeline_cache(struct zink_screen *screen, struct zink_program *pg, bool in_thread)
{
if (!screen->disk_cache)
return;
util_queue_add_job(&screen->cache_get_thread, pg, &pg->cache_fence, cache_get_job, NULL, 0);
if (in_thread)
cache_get_job(pg, screen, 0);
else
util_queue_add_job(&screen->cache_get_thread, pg, &pg->cache_fence, cache_get_job, NULL, 0);
}
static int

View file

@ -111,7 +111,7 @@ void
zink_screen_update_pipeline_cache(struct zink_screen *screen, struct zink_program *pg);
void
zink_screen_get_pipeline_cache(struct zink_screen *screen, struct zink_program *pg);
zink_screen_get_pipeline_cache(struct zink_screen *screen, struct zink_program *pg, bool in_thread);
void
zink_stub_function_not_loaded(void);