From f79aba46dad68f5b3b89e43f0a73ca855852cc01 Mon Sep 17 00:00:00 2001 From: Juston Li Date: Fri, 21 Apr 2023 09:55:51 -0700 Subject: [PATCH] venus: use pipelineCacheUUID for shader cache id Use the host driver pipelineCacheUUID as the shader cache id. This is just used as an identifier for fossilize replay since venus utilizes the host side shader cache anyways. Signed-off-by: Juston Li Part-of: --- src/virtio/vulkan/vn_device.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index cebec5363ea..a1b188b0ef2 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -11,6 +11,7 @@ #include "vn_device.h" #include "util/disk_cache.h" +#include "util/hex.h" #include "venus-protocol/vn_protocol_driver_device.h" #include "vn_android.h" @@ -363,20 +364,9 @@ vn_device_update_shader_cache_id(struct vn_device *dev) #if !defined(ANDROID) && defined(ENABLE_SHADER_CACHE) const VkPhysicalDeviceProperties *vulkan_1_0_props = &dev->physical_device->properties.vulkan_1_0; - struct mesa_sha1 sha1_ctx; - uint8_t sha1[SHA1_DIGEST_LENGTH]; - _mesa_sha1_init(&sha1_ctx); - _mesa_sha1_update(&sha1_ctx, vulkan_1_0_props->pipelineCacheUUID, - sizeof(vulkan_1_0_props->pipelineCacheUUID)); - _mesa_sha1_update(&sha1_ctx, &vulkan_1_0_props->vendorID, - sizeof(vulkan_1_0_props->vendorID)); - _mesa_sha1_update(&sha1_ctx, &vulkan_1_0_props->deviceID, - sizeof(vulkan_1_0_props->deviceID)); - _mesa_sha1_final(&sha1_ctx, sha1); - - char uuid[VK_UUID_SIZE]; - _mesa_sha1_format(uuid, sha1); + char uuid[VK_UUID_SIZE * 2 + 1]; + mesa_bytes_to_hex(uuid, vulkan_1_0_props->pipelineCacheUUID, VK_UUID_SIZE); struct disk_cache *cache = disk_cache_create("venus", uuid, 0); if (!cache)