diff options
author | Kristian Høgsberg Kristensen <[email protected]> | 2016-03-04 12:27:31 -0800 |
---|---|---|
committer | Kristian Høgsberg Kristensen <[email protected]> | 2016-03-05 13:50:07 -0800 |
commit | 584f39c65ed24d6c331d8ccf05d93678f3fafe16 (patch) | |
tree | 3375c49caa7e62839ea72c9c1f9f20571da55863 /src/intel/vulkan/anv_pipeline_cache.c | |
parent | 626559ed3717a205c1315040caa4308e77c70eb5 (diff) |
anv: Don't re-upload shaders when merging
Using anv_pipeline_cache_upload_kernel() will re-upload the kernel and
prog_data when we merge caches. Since the kernel and prog_data is
already in the program_stream, use anv_pipeline_cache_add_entry()
instead to only add the entry to the hash table.
Diffstat (limited to 'src/intel/vulkan/anv_pipeline_cache.c')
-rw-r--r-- | src/intel/vulkan/anv_pipeline_cache.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index c85916fd1f8..376cd2a7716 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -406,23 +406,17 @@ anv_pipeline_cache_merge(struct anv_pipeline_cache *dst, struct anv_pipeline_cache *src) { for (uint32_t i = 0; i < src->table_size; i++) { - if (src->hash_table[i] == ~0) + const uint32_t offset = src->hash_table[i]; + if (offset == ~0) continue; struct cache_entry *entry = - src->program_stream.block_pool->map + src->hash_table[i]; + src->program_stream.block_pool->map + offset; if (anv_pipeline_cache_search(dst, entry->sha1, NULL) != NO_KERNEL) continue; - const void *kernel = (void *) entry + - align_u32(sizeof(*entry) + entry->prog_data_size, 64); - const struct brw_stage_prog_data *prog_data = - (const struct brw_stage_prog_data *) entry->prog_data; - - anv_pipeline_cache_upload_kernel(dst, entry->sha1, - kernel, entry->kernel_size, - &prog_data, entry->prog_data_size); + anv_pipeline_cache_add_entry(dst, entry, offset); } } |