llvmpipe: include gallivm perf flags in shader cache.
authorDave Airlie <airlied@redhat.com>
Mon, 7 Sep 2020 06:30:15 +0000 (16:30 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Sep 2020 23:21:41 +0000 (09:21 +1000)
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@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6630>

src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_init.h
src/gallium/drivers/llvmpipe/lp_screen.c

index fe3ef4a..685ed0e 100644 (file)
@@ -723,3 +723,8 @@ gallivm_jit_function(struct gallivm_state *gallivm,
 
    return jit_func;
 }
+
+unsigned gallivm_get_perf_flags(void)
+{
+   return gallivm_perf;
+}
index 4b00ceb..7c516b2 100644 (file)
@@ -85,6 +85,8 @@ func_pointer
 gallivm_jit_function(struct gallivm_state *gallivm,
                      LLVMValueRef func);
 
+unsigned gallivm_get_perf_flags(void);
+
 #ifdef __cplusplus
 }
 #endif
index fb4d983..2367af8 100644 (file)
@@ -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);