summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2018-04-10 16:41:01 +0200
committerKarol Herbst <[email protected]>2019-03-17 10:33:28 +0100
commit78c5336ca9b37e59ecb3d8f44c988dc87d595b9b (patch)
tree2b65046b7b40ddbdcafc5e7d6c15001f4151062a
parentf014ae3c7cce504afe5d3c3de154f9cf9aea0821 (diff)
nouveau: fix nir and TGSI shader cache collision
v9: rename variable to driver_flags use constants for shader cache flags Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c8
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.h3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 98b44b7df0b..cbd45a1dc35 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -151,6 +151,7 @@ nouveau_disk_cache_create(struct nouveau_screen *screen)
struct mesa_sha1 ctx;
unsigned char sha1[20];
char cache_id[20 * 2 + 1];
+ uint64_t driver_flags = 0;
_mesa_sha1_init(&ctx);
if (!disk_cache_get_function_identifier(nouveau_disk_cache_create,
@@ -160,9 +161,14 @@ nouveau_disk_cache_create(struct nouveau_screen *screen)
_mesa_sha1_final(&ctx, sha1);
disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
+ if (screen->prefer_nir)
+ driver_flags |= NOUVEAU_SHADER_CACHE_FLAGS_IR_NIR;
+ else
+ driver_flags |= NOUVEAU_SHADER_CACHE_FLAGS_IR_TGSI;
+
screen->disk_shader_cache =
disk_cache_create(nouveau_screen_get_name(&screen->base),
- cache_id, 0);
+ cache_id, driver_flags);
}
int
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h
index 4598d6a60e3..1302c608bec 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -17,6 +17,9 @@ extern int nouveau_mesa_debug;
struct nouveau_bo;
+#define NOUVEAU_SHADER_CACHE_FLAGS_IR_TGSI 0 << 0
+#define NOUVEAU_SHADER_CACHE_FLAGS_IR_NIR 1 << 0
+
struct nouveau_screen {
struct pipe_screen base;
struct nouveau_drm *drm;