radv/rt: move radv_ray_tracing_pipeline::sha1 to radv_pipeline

To re-use it for graphics/compute pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28829>
This commit is contained in:
Samuel Pitoiset
2024-04-19 13:59:42 +02:00
committed by Marge Bot
parent 862d53f00a
commit 6e24da3ad4
4 changed files with 6 additions and 6 deletions
+1
View File
@@ -37,6 +37,7 @@ enum radv_pipeline_type {
struct radv_pipeline {
struct vk_object_base base;
uint8_t sha1[SHA1_DIGEST_LENGTH];
enum radv_pipeline_type type;
VkPipelineCreateFlags2KHR create_flags;
+3 -3
View File
@@ -85,7 +85,7 @@ radv_hash_rt_shaders(const struct radv_device *device, unsigned char *hash, cons
for (uint32_t i = 0; i < pCreateInfo->pLibraryInfo->libraryCount; ++i) {
VK_FROM_HANDLE(radv_pipeline, lib_pipeline, pCreateInfo->pLibraryInfo->pLibraries[i]);
struct radv_ray_tracing_pipeline *lib = radv_pipeline_to_ray_tracing(lib_pipeline);
_mesa_sha1_update(&ctx, lib->sha1, SHA1_DIGEST_LENGTH);
_mesa_sha1_update(&ctx, lib->base.base.sha1, SHA1_DIGEST_LENGTH);
}
}
@@ -413,7 +413,7 @@ radv_ray_tracing_pipeline_cache_search(struct radv_device *device, struct vk_pip
}
struct vk_pipeline_cache_object *object =
vk_pipeline_cache_lookup_object(cache, pipeline->sha1, SHA1_DIGEST_LENGTH, &radv_pipeline_ops, found);
vk_pipeline_cache_lookup_object(cache, pipeline->base.base.sha1, SHA1_DIGEST_LENGTH, &radv_pipeline_ops, found);
if (!object)
return false;
@@ -473,7 +473,7 @@ radv_ray_tracing_pipeline_cache_insert(struct radv_device *device, struct vk_pip
num_stages * sizeof(struct radv_ray_tracing_stage_cache_data);
struct radv_pipeline_cache_object *pipeline_obj =
radv_pipeline_cache_object_create(&device->vk, num_shaders, pipeline->sha1, data_size);
radv_pipeline_cache_object_create(&device->vk, num_shaders, pipeline->base.base.sha1, data_size);
struct radv_ray_tracing_pipeline_cache_data *data = pipeline_obj->data;
data->has_traversal_shader = !!pipeline->base.base.shaders[MESA_SHADER_INTERSECTION];
+2 -2
View File
@@ -846,8 +846,8 @@ radv_rt_pipeline_compile(struct radv_device *device, const VkRayTracingPipelineC
int64_t pipeline_start = os_time_get_nano();
radv_hash_rt_shaders(device, pipeline->sha1, pipeline->stages, pCreateInfo, pipeline->groups);
pipeline->base.base.pipeline_hash = *(uint64_t *)pipeline->sha1;
radv_hash_rt_shaders(device, pipeline->base.base.sha1, pipeline->stages, pCreateInfo, pipeline->groups);
pipeline->base.base.pipeline_hash = *(uint64_t *)pipeline->base.base.sha1;
/* Skip the shaders cache when any of the below are true:
* - shaders are captured because it's for debugging purposes
-1
View File
@@ -25,7 +25,6 @@ struct radv_ray_tracing_pipeline {
unsigned non_imported_stage_count;
unsigned group_count;
uint8_t sha1[SHA1_DIGEST_LENGTH];
uint32_t stack_size;
/* set if any shaders from this pipeline require robustness2 in the merged traversal shader */