summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline_cache.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-06-29 18:02:07 -0700
committerJason Ekstrand <[email protected]>2018-07-02 13:07:06 -0700
commitf5c38f4a30a7b6a0e883901db714af57ea820eb6 (patch)
tree2be95025e0a102f3d8b6fefb842b15e3082b7209 /src/intel/vulkan/anv_pipeline_cache.c
parenteae192bf5f15b6e50ca0ead6b19f847bae1631ab (diff)
anv: Add device-level helpers for searching for and uploading kernels
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pipeline_cache.c')
-rw-r--r--src/intel/vulkan/anv_pipeline_cache.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index 5262753f725..2bc64f5bdd1 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -533,3 +533,37 @@ VkResult anv_MergePipelineCaches(
return VK_SUCCESS;
}
+
+struct anv_shader_bin *
+anv_device_search_for_kernel(struct anv_device *device,
+ struct anv_pipeline_cache *cache,
+ const void *key_data, uint32_t key_size)
+{
+ return cache ? anv_pipeline_cache_search(cache, key_data, key_size) : NULL;
+}
+
+struct anv_shader_bin *
+anv_device_upload_kernel(struct anv_device *device,
+ struct anv_pipeline_cache *cache,
+ const void *key_data, uint32_t key_size,
+ const void *kernel_data, uint32_t kernel_size,
+ const void *constant_data,
+ uint32_t constant_data_size,
+ const struct brw_stage_prog_data *prog_data,
+ uint32_t prog_data_size,
+ const struct anv_pipeline_bind_map *bind_map)
+{
+ if (cache) {
+ return anv_pipeline_cache_upload_kernel(cache, key_data, key_size,
+ kernel_data, kernel_size,
+ constant_data, constant_data_size,
+ prog_data, prog_data_size,
+ bind_map);
+ } else {
+ return anv_shader_bin_create(device, key_data, key_size,
+ kernel_data, kernel_size,
+ constant_data, constant_data_size,
+ prog_data, prog_data_size,
+ prog_data->param, bind_map);
+ }
+}