mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
radv/meta: disable disk cache for meta shaders
Meta shaders are already stored in a separate cache file, inserting them into the disk cache is unnecessary. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23909>
This commit is contained in:
parent
2efa5ad0f6
commit
8740fb0026
2 changed files with 10 additions and 5 deletions
|
|
@ -334,12 +334,17 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
void *data = NULL;
|
||||
bool ret = false;
|
||||
int fd = -1;
|
||||
VkResult result = VK_SUCCESS;
|
||||
struct vk_pipeline_cache *cache = NULL;
|
||||
|
||||
VkPipelineCacheCreateInfo create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO,
|
||||
};
|
||||
|
||||
struct vk_pipeline_cache_create_info info = {
|
||||
.pCreateInfo = &create_info,
|
||||
.skip_disk_cache = true,
|
||||
};
|
||||
|
||||
if (!radv_builtin_cache_path(path))
|
||||
goto fail;
|
||||
|
||||
|
|
@ -358,8 +363,10 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
create_info.pInitialData = data;
|
||||
|
||||
fail:
|
||||
result = vk_common_CreatePipelineCache(radv_device_to_handle(device), &create_info, NULL, &device->meta_state.cache);
|
||||
if (result == VK_SUCCESS) {
|
||||
cache = vk_pipeline_cache_create(&device->vk, &info, NULL);
|
||||
|
||||
if (cache) {
|
||||
device->meta_state.cache = vk_pipeline_cache_to_handle(cache);
|
||||
device->meta_state.initial_cache_entries = num_cache_entries(device->meta_state.cache);
|
||||
ret = device->meta_state.initial_cache_entries > 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,8 +212,6 @@ radv_shader_create(struct radv_device *device, struct vk_pipeline_cache *cache,
|
|||
uint8_t hash[SHA1_DIGEST_LENGTH];
|
||||
_mesa_sha1_compute(binary, binary->total_size, hash);
|
||||
|
||||
/* TODO: Skip disk-cache for meta-shaders because they are stored in a different cache file */
|
||||
|
||||
struct vk_pipeline_cache_object *shader_obj;
|
||||
shader_obj = vk_pipeline_cache_create_and_insert_object(cache, hash, SHA1_DIGEST_LENGTH, binary, binary->total_size,
|
||||
&radv_shader_ops);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue