Mesa (master): iris: Remove context from iris_disk_cache_retrieve
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 11 20:57:04 UTC 2021
Module: Mesa
Branch: master
Commit: dcf6247fcbb94e249db2d940335fb57daa951df7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcf6247fcbb94e249db2d940335fb57daa951df7
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Feb 8 18:38:22 2021 -0800
iris: Remove context from iris_disk_cache_retrieve
We don't use the context other than getting the screen and uploader.
Fixes: 84a38ec1336 ("iris: Enable PIPE_CAP_SHAREABLE_SHADERS.")
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8922>
---
src/gallium/drivers/iris/iris_context.h | 3 +-
src/gallium/drivers/iris/iris_disk_cache.c | 5 ++--
src/gallium/drivers/iris/iris_program.c | 48 +++++++++++++++++++-----------
3 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 591454db9af..986ac0d4694 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -906,7 +906,8 @@ void iris_disk_cache_store(struct disk_cache *cache,
const void *prog_key,
uint32_t prog_key_size);
struct iris_compiled_shader *
-iris_disk_cache_retrieve(struct iris_context *ice,
+iris_disk_cache_retrieve(struct iris_screen *screen,
+ struct u_upload_mgr *uploader,
struct iris_uncompiled_shader *ish,
const void *prog_key,
uint32_t prog_key_size);
diff --git a/src/gallium/drivers/iris/iris_disk_cache.c b/src/gallium/drivers/iris/iris_disk_cache.c
index d5b415df7b5..023db20cf89 100644
--- a/src/gallium/drivers/iris/iris_disk_cache.c
+++ b/src/gallium/drivers/iris/iris_disk_cache.c
@@ -142,14 +142,13 @@ static const enum iris_program_cache_id cache_id_for_stage[] = {
* to the in-memory program cache so we can use it.
*/
struct iris_compiled_shader *
-iris_disk_cache_retrieve(struct iris_context *ice,
+iris_disk_cache_retrieve(struct iris_screen *screen,
+ struct u_upload_mgr *uploader,
struct iris_uncompiled_shader *ish,
const void *prog_key,
uint32_t key_size)
{
#ifdef ENABLE_SHADER_CACHE
- struct iris_screen *screen = (void *) ice->ctx.screen;
- struct u_upload_mgr *uploader = ice->shaders.uploader;
struct disk_cache *cache = screen->disk_cache;
gl_shader_stage stage = ish->nir->info.stage;
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index cb0295ff673..e0661ec2d84 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -1249,8 +1249,10 @@ iris_update_compiled_vs(struct iris_context *ice)
struct iris_compiled_shader *shader =
find_variant(screen, ish, &key, sizeof(key));
- if (!shader)
- shader = iris_disk_cache_retrieve(ice, ish, &key, sizeof(key));
+ if (!shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, ish,
+ &key, sizeof(key));
+ }
if (!shader)
shader = iris_compile_vs(screen, uploader, &ice->dbg, ish, &key);
@@ -1453,8 +1455,10 @@ iris_update_compiled_tcs(struct iris_context *ice)
tcs ? find_variant(screen, tcs, &key, sizeof(key)) :
iris_find_cached_shader(ice, IRIS_CACHE_TCS, sizeof(key), &key);
- if (tcs && !shader)
- shader = iris_disk_cache_retrieve(ice, tcs, &key, sizeof(key));
+ if (tcs && !shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, tcs,
+ &key, sizeof(key));
+ }
if (!shader) {
shader = iris_compile_tcs(screen, ice->shaders.cache,
@@ -1573,8 +1577,10 @@ iris_update_compiled_tes(struct iris_context *ice)
struct iris_compiled_shader *shader =
find_variant(screen, ish, &key, sizeof(key));
- if (!shader)
- shader = iris_disk_cache_retrieve(ice, ish, &key, sizeof(key));
+ if (!shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, ish,
+ &key, sizeof(key));
+ }
if (!shader)
shader = iris_compile_tes(screen, uploader, &ice->dbg, ish, &key);
@@ -1697,8 +1703,10 @@ iris_update_compiled_gs(struct iris_context *ice)
shader = find_variant(screen, ish, &key, sizeof(key));
- if (!shader)
- shader = iris_disk_cache_retrieve(ice, ish, &key, sizeof(key));
+ if (!shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, ish,
+ &key, sizeof(key));
+ }
if (!shader)
shader = iris_compile_gs(screen, uploader, &ice->dbg, ish, &key);
@@ -1816,8 +1824,10 @@ iris_update_compiled_fs(struct iris_context *ice)
struct iris_compiled_shader *shader =
find_variant(screen, ish, &key, sizeof(key));
- if (!shader)
- shader = iris_disk_cache_retrieve(ice, ish, &key, sizeof(key));
+ if (!shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, ish,
+ &key, sizeof(key));
+ }
if (!shader) {
shader = iris_compile_fs(screen, uploader, &ice->dbg,
@@ -2066,8 +2076,10 @@ iris_update_compiled_cs(struct iris_context *ice)
struct iris_compiled_shader *shader =
find_variant(screen, ish, &key, sizeof(key));
- if (!shader)
- shader = iris_disk_cache_retrieve(ice, ish, &key, sizeof(key));
+ if (!shader) {
+ shader = iris_disk_cache_retrieve(screen, uploader, ish,
+ &key, sizeof(key));
+ }
if (!shader)
shader = iris_compile_cs(screen, uploader, &ice->dbg, ish, &key);
@@ -2275,7 +2287,7 @@ iris_create_vs_state(struct pipe_context *ctx,
if (screen->precompile) {
struct iris_vs_prog_key key = { KEY_ID(vue.base) };
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_vs(screen, uploader, &ice->dbg, ish, &key);
}
@@ -2313,7 +2325,7 @@ iris_create_tcs_state(struct pipe_context *ctx,
if (compiler->use_tcs_8_patch)
key.input_vertices = info->tess.tcs_vertices_out;
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_tcs(screen, NULL, uploader, &ice->dbg, ish, &key);
}
@@ -2342,7 +2354,7 @@ iris_create_tes_state(struct pipe_context *ctx,
.patch_inputs_read = info->patch_inputs_read,
};
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_tes(screen, uploader, &ice->dbg, ish, &key);
}
@@ -2365,7 +2377,7 @@ iris_create_gs_state(struct pipe_context *ctx,
if (screen->precompile) {
struct iris_gs_prog_key key = { KEY_ID(vue.base) };
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_gs(screen, uploader, &ice->dbg, ish, &key);
}
@@ -2411,7 +2423,7 @@ iris_create_fs_state(struct pipe_context *ctx,
can_rearrange_varyings ? 0 : info->inputs_read | VARYING_BIT_POS,
};
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_fs(screen, uploader, &ice->dbg, ish, &key, NULL);
}
@@ -2464,7 +2476,7 @@ iris_create_compute_state(struct pipe_context *ctx,
if (screen->precompile) {
struct iris_cs_prog_key key = { KEY_ID(base) };
- if (!iris_disk_cache_retrieve(ice, ish, &key, sizeof(key)))
+ if (!iris_disk_cache_retrieve(screen, uploader, ish, &key, sizeof(key)))
iris_compile_cs(screen, uploader, &ice->dbg, ish, &key);
}
More information about the mesa-commit
mailing list