mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-26 19:50:37 +02:00
radv: Use a VkPipelineCache handle for meta shaders.
Prep work for using the common vk caches. 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
911455a0d6
commit
8231f7eaa1
21 changed files with 73 additions and 65 deletions
|
|
@ -350,7 +350,7 @@ create_build_pipeline_spv(struct radv_device *device, const uint32_t *spv, uint3
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&pipeline_info, &device->meta_state.alloc, pipeline);
|
||||
|
||||
cleanup:
|
||||
|
|
@ -421,7 +421,7 @@ radv_device_init_accel_struct_build_state(struct radv_device *device)
|
|||
|
||||
device->meta_state.accel_struct_build.radix_sort =
|
||||
radv_create_radix_sort_u64(radv_device_to_handle(device), &device->meta_state.alloc,
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache));
|
||||
device->meta_state.cache);
|
||||
|
||||
struct radix_sort_vk_sort_devaddr_info *radix_sort_info =
|
||||
&device->meta_state.accel_struct_build.radix_sort_info;
|
||||
|
|
|
|||
|
|
@ -962,7 +962,7 @@ radv_device_init_dgc_prepare_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&pipeline_info, &device->meta_state.alloc, &device->meta_state.dgc_prepare.pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -295,13 +295,19 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
struct stat st;
|
||||
void *data = NULL;
|
||||
bool ret = false;
|
||||
int fd = -1;
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
VkPipelineCacheCreateInfo create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO,
|
||||
};
|
||||
|
||||
if (!radv_builtin_cache_path(path))
|
||||
return false;
|
||||
goto fail;
|
||||
|
||||
int fd = open(path, O_RDONLY);
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return false;
|
||||
goto fail;
|
||||
if (fstat(fd, &st))
|
||||
goto fail;
|
||||
data = malloc(st.st_size);
|
||||
|
|
@ -310,10 +316,18 @@ radv_load_meta_pipeline(struct radv_device *device)
|
|||
if (read(fd, data, st.st_size) == -1)
|
||||
goto fail;
|
||||
|
||||
ret = radv_pipeline_cache_load(&device->meta_state.cache, data, st.st_size);
|
||||
create_info.initialDataSize = st.st_size;
|
||||
create_info.pInitialData = data;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
free(data);
|
||||
close(fd);
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -326,11 +340,11 @@ radv_store_meta_pipeline(struct radv_device *device)
|
|||
size_t size;
|
||||
void *data = NULL;
|
||||
|
||||
if (!device->meta_state.cache.modified)
|
||||
if (!radv_pipeline_cache_from_handle(device->meta_state.cache)->modified)
|
||||
return;
|
||||
|
||||
if (radv_GetPipelineCacheData(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), &size,
|
||||
device->meta_state.cache, &size,
|
||||
NULL))
|
||||
return;
|
||||
|
||||
|
|
@ -347,7 +361,7 @@ radv_store_meta_pipeline(struct radv_device *device)
|
|||
goto fail;
|
||||
|
||||
if (radv_GetPipelineCacheData(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), &size,
|
||||
device->meta_state.cache, &size,
|
||||
data))
|
||||
goto fail;
|
||||
if (write(fd, data, size) == -1)
|
||||
|
|
@ -375,8 +389,6 @@ radv_device_init_meta(struct radv_device *device)
|
|||
.pfnFree = meta_free,
|
||||
};
|
||||
|
||||
device->meta_state.cache.alloc = device->meta_state.alloc;
|
||||
radv_pipeline_cache_init(&device->meta_state.cache, device);
|
||||
bool loaded_cache = radv_load_meta_pipeline(device);
|
||||
bool on_demand = !loaded_cache;
|
||||
|
||||
|
|
@ -490,7 +502,7 @@ fail_clear:
|
|||
radv_device_finish_meta_clear_state(device);
|
||||
|
||||
mtx_destroy(&device->meta_state.mtx);
|
||||
radv_pipeline_cache_finish(&device->meta_state.cache);
|
||||
radv_DestroyPipelineCache(radv_device_to_handle(device), device->meta_state.cache, NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -517,7 +529,7 @@ radv_device_finish_meta(struct radv_device *device)
|
|||
radv_device_finish_meta_fmask_copy_state(device);
|
||||
|
||||
radv_store_meta_pipeline(device);
|
||||
radv_pipeline_cache_finish(&device->meta_state.cache);
|
||||
radv_DestroyPipelineCache(radv_device_to_handle(device), device->meta_state.cache, NULL);
|
||||
mtx_destroy(&device->meta_state.mtx);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -816,7 +816,7 @@ build_pipeline(struct radv_device *device, VkImageAspectFlagBits aspect,
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc, pipeline);
|
||||
ralloc_free(vs);
|
||||
ralloc_free(fs);
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ blit2d_init_color_pipeline(struct radv_device *device, enum blit2d_src_type src_
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc,
|
||||
&device->meta_state.blit2d[log2_samples].pipelines[src_type][fs_key]);
|
||||
|
||||
|
|
@ -905,7 +905,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device, enum blit2d_src_type
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc,
|
||||
&device->meta_state.blit2d[log2_samples].depth_only_pipeline[src_type]);
|
||||
|
||||
|
|
@ -1059,7 +1059,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device, enum blit2d_src_ty
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc,
|
||||
&device->meta_state.blit2d[log2_samples].stencil_only_pipeline[src_type]);
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ radv_device_init_meta_buffer_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&fill_vk_pipeline_info, NULL, &device->meta_state.buffer.fill_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -139,7 +139,7 @@ radv_device_init_meta_buffer_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
©_vk_pipeline_info, NULL, &device->meta_state.buffer.copy_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ radv_device_init_meta_itob_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.itob.pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -176,7 +176,7 @@ radv_device_init_meta_itob_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info_3d, NULL, &device->meta_state.itob.pipeline_3d);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -333,7 +333,7 @@ radv_device_init_meta_btoi_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.btoi.pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -354,7 +354,7 @@ radv_device_init_meta_btoi_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info_3d, NULL, &device->meta_state.btoi.pipeline_3d);
|
||||
|
||||
ralloc_free(cs_3d);
|
||||
|
|
@ -508,7 +508,7 @@ radv_device_init_meta_btoi_r32g32b32_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.btoi_r32g32b32.pipeline);
|
||||
|
||||
fail:
|
||||
|
|
@ -624,7 +624,7 @@ create_itoi_pipeline(struct radv_device *device, int samples, VkPipeline *pipeli
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
|
|
@ -702,7 +702,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info_3d, NULL, &device->meta_state.itoi.pipeline_3d);
|
||||
ralloc_free(cs_3d);
|
||||
|
||||
|
|
@ -863,7 +863,7 @@ radv_device_init_meta_itoi_r32g32b32_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.itoi_r32g32b32.pipeline);
|
||||
|
||||
fail:
|
||||
|
|
@ -943,7 +943,7 @@ create_cleari_pipeline(struct radv_device *device, int samples, VkPipeline *pipe
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
|
|
@ -1016,7 +1016,7 @@ radv_device_init_meta_cleari_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info_3d, NULL, &device->meta_state.cleari.pipeline_3d);
|
||||
ralloc_free(cs_3d);
|
||||
|
||||
|
|
@ -1134,7 +1134,7 @@ radv_device_init_meta_cleari_r32g32b32_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.cleari_r32g32b32.pipeline);
|
||||
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ create_pipeline(struct radv_device *device, uint32_t samples,
|
|||
VkResult result;
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
device_h, device->meta_state.cache,
|
||||
&(VkGraphicsPipelineCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = dyn_state,
|
||||
|
|
@ -953,7 +953,7 @@ init_meta_clear_htile_mask_state(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&pipeline_info, NULL, &state->clear_htile_mask_pipeline);
|
||||
|
||||
fail:
|
||||
|
|
@ -1033,7 +1033,7 @@ create_dcc_comp_to_single_pipeline(struct radv_device *device, bool is_msaa, VkP
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&pipeline_info, NULL, pipeline);
|
||||
|
||||
ralloc_free(cs);
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ radv_device_init_meta_copy_vrs_htile_state(struct radv_device *device,
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&pipeline_info, NULL, &state->copy_vrs_htile_pipeline);
|
||||
fail:
|
||||
ralloc_free(cs);
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ radv_device_init_meta_dcc_retile_state(struct radv_device *device, struct radeon
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, &device->meta_state.dcc_retile.pipeline[surf->u.gfx9.swizzle_mode]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ create_expand_depth_stencil_compute(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL,
|
||||
&device->meta_state.expand_depth_stencil_compute_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
|
|
@ -291,7 +291,7 @@ create_pipeline(struct radv_device *device, uint32_t samples, VkPipelineLayout l
|
|||
};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache), &pipeline_create_info,
|
||||
device_h, device->meta_state.cache, &pipeline_create_info,
|
||||
&extra, &device->meta_state.alloc, pipeline);
|
||||
|
||||
cleanup:
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ create_decode_pipeline(struct radv_device *device, VkPipeline *pipeline)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ create_dcc_compress_compute(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL,
|
||||
&device->meta_state.fast_clear_flush.dcc_decompress_compute_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
|
|
@ -230,7 +230,7 @@ create_pipeline(struct radv_device *device, VkShaderModule vs_module_h, VkPipeli
|
|||
};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
device_h, device->meta_state.cache,
|
||||
&(VkGraphicsPipelineCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = &rendering_create_info,
|
||||
|
|
@ -280,7 +280,7 @@ create_pipeline(struct radv_device *device, VkShaderModule vs_module_h, VkPipeli
|
|||
goto cleanup;
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
device_h, device->meta_state.cache,
|
||||
&(VkGraphicsPipelineCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = &rendering_create_info,
|
||||
|
|
@ -330,7 +330,7 @@ create_pipeline(struct radv_device *device, VkShaderModule vs_module_h, VkPipeli
|
|||
goto cleanup;
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
device_h, device->meta_state.cache,
|
||||
&(VkGraphicsPipelineCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = &rendering_create_info,
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ create_fmask_copy_pipeline(struct radv_device *device, int samples, VkPipeline *
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ create_fmask_expand_pipeline(struct radv_device *device, int samples, VkPipeline
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&state->cache), 1,
|
||||
state->cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
|
||||
ralloc_free(cs);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ create_pipeline(struct radv_device *device, VkShaderModule vs_module_h, VkFormat
|
|||
};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
device_h, radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
device_h, device->meta_state.cache,
|
||||
&(VkGraphicsPipelineCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = &rendering_create_info,
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ create_resolve_pipeline(struct radv_device *device, int samples, bool is_integer
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -361,7 +361,7 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, int samples, i
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
device->meta_state.cache, 1,
|
||||
&vk_pipeline_info, NULL, pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ create_resolve_pipeline(struct radv_device *device, int samples_log2, VkFormat f
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc, pipeline);
|
||||
ralloc_free(vs);
|
||||
ralloc_free(fs);
|
||||
|
|
@ -508,7 +508,7 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device, int samples_lo
|
|||
const struct radv_graphics_pipeline_create_info radv_pipeline_info = {.use_rectlist = true};
|
||||
|
||||
result = radv_graphics_pipeline_create(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
radv_device_to_handle(device), device->meta_state.cache,
|
||||
&vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc, pipeline);
|
||||
|
||||
ralloc_free(vs);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ radv_is_cache_disabled(struct radv_device *device)
|
|||
(device->physical_device->use_llvm ? 0 : aco_get_codegen_flags());
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
radv_pipeline_cache_init(struct radv_pipeline_cache *cache, struct radv_device *device)
|
||||
{
|
||||
vk_object_base_init(&device->vk, &cache->base, VK_OBJECT_TYPE_PIPELINE_CACHE);
|
||||
|
|
@ -98,7 +98,7 @@ radv_pipeline_cache_init(struct radv_pipeline_cache *cache, struct radv_device *
|
|||
memset(cache->hash_table, 0, byte_size);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
radv_pipeline_cache_finish(struct radv_pipeline_cache *cache)
|
||||
{
|
||||
for (unsigned i = 0; i < cache->table_size; ++i)
|
||||
|
|
@ -541,7 +541,7 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device, struct radv_pipel
|
|||
*
|
||||
* Make sure to exclude meta shaders because they are stored in a different cache file.
|
||||
*/
|
||||
if (device->physical_device->vk.disk_cache && cache != &device->meta_state.cache) {
|
||||
if (device->physical_device->vk.disk_cache && cache != radv_pipeline_cache_from_handle(device->meta_state.cache)) {
|
||||
uint8_t disk_sha1[SHA1_DIGEST_LENGTH];
|
||||
disk_cache_compute_key(device->physical_device->vk.disk_cache, sha1, SHA1_DIGEST_LENGTH, disk_sha1);
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device, struct radv_pipel
|
|||
return;
|
||||
}
|
||||
|
||||
bool
|
||||
static bool
|
||||
radv_pipeline_cache_load(struct radv_pipeline_cache *cache, const void *data, size_t size)
|
||||
{
|
||||
struct radv_device *device = cache->device;
|
||||
|
|
|
|||
|
|
@ -386,10 +386,6 @@ struct radv_shader_binary;
|
|||
struct radv_shader;
|
||||
struct radv_pipeline_shader_stack_size;
|
||||
|
||||
void radv_pipeline_cache_init(struct radv_pipeline_cache *cache, struct radv_device *device);
|
||||
void radv_pipeline_cache_finish(struct radv_pipeline_cache *cache);
|
||||
bool radv_pipeline_cache_load(struct radv_pipeline_cache *cache, const void *data, size_t size);
|
||||
|
||||
bool radv_create_shaders_from_pipeline_cache(
|
||||
struct radv_device *device, struct radv_pipeline_cache *cache, const unsigned char *sha1,
|
||||
struct radv_pipeline *pipeline, struct radv_pipeline_shader_stack_size **stack_sizes,
|
||||
|
|
@ -445,7 +441,7 @@ radv_meta_dst_layout_to_layout(enum radv_meta_dst_layout layout)
|
|||
struct radv_meta_state {
|
||||
VkAllocationCallbacks alloc;
|
||||
|
||||
struct radv_pipeline_cache cache;
|
||||
VkPipelineCache cache;
|
||||
|
||||
/*
|
||||
* For on-demand pipeline creation, makes sure that
|
||||
|
|
|
|||
|
|
@ -818,7 +818,7 @@ radv_device_init_meta_query_state_internal(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&occlusion_vk_pipeline_info, NULL, &device->meta_state.query.occlusion_query_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -839,7 +839,7 @@ radv_device_init_meta_query_state_internal(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&pipeline_statistics_vk_pipeline_info, NULL,
|
||||
&device->meta_state.query.pipeline_statistics_query_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
|
|
@ -861,7 +861,7 @@ radv_device_init_meta_query_state_internal(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&tfb_pipeline_info, NULL, &device->meta_state.query.tfb_query_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -882,7 +882,7 @@ radv_device_init_meta_query_state_internal(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
×tamp_pipeline_info, NULL, &device->meta_state.query.timestamp_query_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
|
@ -903,7 +903,7 @@ radv_device_init_meta_query_state_internal(struct radv_device *device)
|
|||
};
|
||||
|
||||
result = radv_CreateComputePipelines(
|
||||
radv_device_to_handle(device), radv_pipeline_cache_to_handle(&device->meta_state.cache), 1,
|
||||
radv_device_to_handle(device), device->meta_state.cache, 1,
|
||||
&pg_pipeline_info, NULL, &device->meta_state.query.pg_query_pipeline);
|
||||
|
||||
fail:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue