Mesa (master): iris: Expose the disk cache to the state tracker as well.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 21 22:06:14 UTC 2019


Module: Mesa
Branch: master
Commit: fb1d08dcfd53cad8d933592c4515a9dc123376e3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fb1d08dcfd53cad8d933592c4515a9dc123376e3

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue May 21 12:06:02 2019 -0700

iris: Expose the disk cache to the state tracker as well.

This lets st/nir cache the NIR for shaders, based on the shader source
string hash, allowing us to skip initial compiles altogether, and also
letting us start from there should we need to recompile for NOS.

Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

---

 src/gallium/drivers/iris/iris_screen.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index fcd1bf72d73..4a62f15fa3f 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -532,6 +532,13 @@ iris_get_compiler_options(struct pipe_screen *pscreen,
    return screen->compiler->glsl_compiler_options[stage].NirOptions;
 }
 
+static struct disk_cache *
+iris_get_disk_shader_cache(struct pipe_screen *pscreen)
+{
+   struct iris_screen *screen = (struct iris_screen *) pscreen;
+   return screen->disk_cache;
+}
+
 static int
 iris_getparam(struct iris_screen *screen, int param, int *value)
 {
@@ -661,6 +668,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
    pscreen->get_compute_param = iris_get_compute_param;
    pscreen->get_paramf = iris_get_paramf;
    pscreen->get_compiler_options = iris_get_compiler_options;
+   pscreen->get_disk_shader_cache = iris_get_disk_shader_cache;
    pscreen->is_format_supported = iris_is_format_supported;
    pscreen->context_create = iris_create_context;
    pscreen->flush_frontbuffer = iris_flush_frontbuffer;




More information about the mesa-commit mailing list