Mesa (master): llvmpipe: include gallivm perf flags in shader cache.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 8 23:50:19 UTC 2020


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Sep  7 16:30:15 2020 +1000

llvmpipe: include gallivm perf flags in shader cache.

Otherwise if you set perf flags, then don't set them,
they won't take affect.

Fixes: 6c0c61cb48e8 ("llvmpipe: add infrastructure for disk cache support")
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6630>

---

 src/gallium/auxiliary/gallivm/lp_bld_init.c | 5 +++++
 src/gallium/auxiliary/gallivm/lp_bld_init.h | 2 ++
 src/gallium/drivers/llvmpipe/lp_screen.c    | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index fe3ef4a48df..685ed0e58aa 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -723,3 +723,8 @@ gallivm_jit_function(struct gallivm_state *gallivm,
 
    return jit_func;
 }
+
+unsigned gallivm_get_perf_flags(void)
+{
+   return gallivm_perf;
+}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h
index 4b00cebaef5..7c516b2b266 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h
@@ -85,6 +85,8 @@ func_pointer
 gallivm_jit_function(struct gallivm_state *gallivm,
                      LLVMValueRef func);
 
+unsigned gallivm_get_perf_flags(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index fb4d9835af7..2367af870c4 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -801,6 +801,7 @@ llvmpipe_get_timestamp(struct pipe_screen *_screen)
 static void lp_disk_cache_create(struct llvmpipe_screen *screen)
 {
    struct mesa_sha1 ctx;
+   unsigned gallivm_perf = gallivm_get_perf_flags();
    unsigned char sha1[20];
    char cache_id[20 * 2 + 1];
    _mesa_sha1_init(&ctx);
@@ -809,6 +810,7 @@ static void lp_disk_cache_create(struct llvmpipe_screen *screen)
        !disk_cache_get_function_identifier(LLVMLinkInMCJIT, &ctx))
       return;
 
+   _mesa_sha1_update(&ctx, &gallivm_perf, sizeof(gallivm_perf));
    _mesa_sha1_final(&ctx, sha1);
    disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
 



More information about the mesa-commit mailing list