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.
This commit is contained in:
@@ -406,23 +406,17 @@ anv_pipeline_cache_merge(struct anv_pipeline_cache *dst,
|
|||||||
struct anv_pipeline_cache *src)
|
struct anv_pipeline_cache *src)
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < src->table_size; i++) {
|
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;
|
continue;
|
||||||
|
|
||||||
struct cache_entry *entry =
|
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)
|
if (anv_pipeline_cache_search(dst, entry->sha1, NULL) != NO_KERNEL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const void *kernel = (void *) entry +
|
anv_pipeline_cache_add_entry(dst, entry, offset);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user