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: 6c0c61cb48 ("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>
(cherry picked from commit 4df0eef188)
This commit is contained in:
Dave Airlie 2020-09-07 16:30:15 +10:00 committed by Dylan Baker
parent 66a14f9c41
commit efd20aa5b2
4 changed files with 10 additions and 1 deletions

View file

@ -967,7 +967,7 @@
"description": "llvmpipe: include gallivm perf flags in shader cache.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "6c0c61cb48e87d9b0fc545cf30016d3947a47b6a"
},

View file

@ -721,3 +721,8 @@ gallivm_jit_function(struct gallivm_state *gallivm,
return jit_func;
}
unsigned gallivm_get_perf_flags(void)
{
return gallivm_perf;
}

View 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

View file

@ -793,6 +793,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);
@ -801,6 +802,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);