mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 17:30:32 +01:00
radv: Rework modification detection of the meta cache.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19047>
This commit is contained in:
parent
8231f7eaa1
commit
f00b54bc9e
3 changed files with 8 additions and 5 deletions
|
|
@ -322,7 +322,8 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
fail:
|
||||
result = radv_CreatePipelineCache(radv_device_to_handle(device), &create_info, NULL, &device->meta_state.cache);
|
||||
if (result == VK_SUCCESS) {
|
||||
ret = radv_pipeline_cache_from_handle(device->meta_state.cache)->kernel_count > 0;
|
||||
device->meta_state.initial_cache_entries = radv_pipeline_cache_from_handle(device->meta_state.cache)->kernel_count;
|
||||
ret = device->meta_state.initial_cache_entries > 0;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
|
@ -340,7 +341,11 @@ radv_store_meta_pipeline(struct radv_device *device)
|
|||
size_t size;
|
||||
void *data = NULL;
|
||||
|
||||
if (!radv_pipeline_cache_from_handle(device->meta_state.cache)->modified)
|
||||
if (device->meta_state.cache == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
/* Skip serialization if no entries were added. */
|
||||
if (radv_pipeline_cache_from_handle(device->meta_state.cache)->kernel_count <= device->meta_state.initial_cache_entries)
|
||||
return;
|
||||
|
||||
if (radv_GetPipelineCacheData(radv_device_to_handle(device),
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ radv_pipeline_cache_init(struct radv_pipeline_cache *cache, struct radv_device *
|
|||
mtx_init(&cache->mutex, mtx_plain);
|
||||
cache->flags = 0;
|
||||
|
||||
cache->modified = false;
|
||||
cache->kernel_count = 0;
|
||||
cache->total_size = 0;
|
||||
cache->table_size = 1024;
|
||||
|
|
@ -571,7 +570,6 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device, struct radv_pipel
|
|||
|
||||
radv_pipeline_cache_add_entry(cache, entry);
|
||||
|
||||
cache->modified = true;
|
||||
radv_pipeline_cache_unlock(cache);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -377,7 +377,6 @@ struct radv_pipeline_cache {
|
|||
uint32_t table_size;
|
||||
uint32_t kernel_count;
|
||||
struct cache_entry **hash_table;
|
||||
bool modified;
|
||||
|
||||
VkAllocationCallbacks alloc;
|
||||
};
|
||||
|
|
@ -442,6 +441,7 @@ struct radv_meta_state {
|
|||
VkAllocationCallbacks alloc;
|
||||
|
||||
VkPipelineCache cache;
|
||||
uint32_t initial_cache_entries;
|
||||
|
||||
/*
|
||||
* For on-demand pipeline creation, makes sure that
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue