From: Timothy Arceri Date: Sun, 19 Feb 2017 22:29:01 +0000 (+1100) Subject: gallium: add get_disk_shader_cache() callback X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4be98ed5fd23e42c19a20b322a0207326f834c64;p=mesa.git gallium: add get_disk_shader_cache() callback V2: Provide more detail in callback description and add description to screen.rst Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 74c8ceca20f..858eb9f9100 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -763,6 +763,16 @@ The driver-specific query group is described with the pipe_driver_query_group_info structure. + +get_disk_shader_cache +^^^^^^^^^^^^^^^^^^^^^ + +Returns a pointer to a driver-specific on-disk shader cache. If the driver +failed to create the cache or does not support an on-disk shader cache NULL is +returned. The callback itself may also be NULL if the driver doesn't support +an on-disk shader cache. + + Thread safety ------------- diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index b6203f1da0c..eb2ac65ea4a 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -58,6 +58,7 @@ struct pipe_surface; struct pipe_transfer; struct pipe_box; struct pipe_memory_info; +struct disk_cache; /** @@ -318,6 +319,14 @@ struct pipe_screen { const void *(*get_compiler_options)(struct pipe_screen *screen, enum pipe_shader_ir ir, unsigned shader); + + /** + * Returns a pointer to a driver-specific on-disk shader cache. If the + * driver failed to create the cache or does not support an on-disk shader + * cache NULL is returned. The callback itself may also be NULL if the + * driver doesn't support an on-disk shader cache. + */ + struct disk_cache *(*get_disk_shader_cache)(struct pipe_screen *screen); };