static void *
compile_function(struct llvmpipe_context *ctx, struct gallivm_state *gallivm, LLVMValueRef function,
+ bool needs_caching,
uint8_t cache_key[SHA1_DIGEST_LENGTH])
{
gallivm_verify_function(gallivm, function);
void *function_ptr = func_to_pointer(gallivm_jit_function(gallivm, function));
- if (!gallivm->cache->data_size)
+ if (needs_caching)
lp_disk_cache_insert_shader(llvmpipe_screen(ctx->pipe.screen), gallivm->cache, cache_key);
gallivm_free_ir(gallivm);
_mesa_sha1_update(&hash_ctx, image_function_base_hash, strlen(image_function_base_hash));
_mesa_sha1_update(&hash_ctx, texture, sizeof(*texture));
_mesa_sha1_update(&hash_ctx, &op, sizeof(op));
+ _mesa_sha1_update(&hash_ctx, &ms, sizeof(ms));
_mesa_sha1_final(&hash_ctx, cache_key);
struct lp_cached_code cached = { 0 };
lp_disk_cache_find_shader(llvmpipe_screen(ctx->pipe.screen), &cached, cache_key);
+ bool needs_caching = !cached.data_size;
struct gallivm_state *gallivm = gallivm_create("sample_function", ctx->context, &cached);
free(image_soa);
- return compile_function(ctx, gallivm, function, cache_key);
+ return compile_function(ctx, gallivm, function, needs_caching, cache_key);
}
static void *
struct lp_cached_code cached = { 0 };
lp_disk_cache_find_shader(llvmpipe_screen(ctx->pipe.screen), &cached, cache_key);
+ bool needs_caching = !cached.data_size;
struct gallivm_state *gallivm = gallivm_create("sample_function", ctx->context, &cached);
free(sampler_soa);
- return compile_function(ctx, gallivm, function, cache_key);
+ return compile_function(ctx, gallivm, function, needs_caching, cache_key);
}
static void *
struct lp_cached_code cached = { 0 };
lp_disk_cache_find_shader(llvmpipe_screen(ctx->pipe.screen), &cached, cache_key);
+ bool needs_caching = !cached.data_size;
struct gallivm_state *gallivm = gallivm_create("sample_function", ctx->context, &cached);
free(sampler_soa);
- return compile_function(ctx, gallivm, function, cache_key);
+ return compile_function(ctx, gallivm, function, needs_caching, cache_key);
}
static void