diff options
author | Juston Li <justonli@google.com> | 2023-04-21 09:55:51 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-05-03 21:29:31 +0000 |
commit | f79aba46dad68f5b3b89e43f0a73ca855852cc01 (patch) | |
tree | e748ec7c67212abe58fd7f6aca91c3daf5c8a89e /src/virtio | |
parent | 2e3ce614b9e4c307f233aac5deaf2b623a0f0fab (diff) | |
download | mesa-f79aba46dad68f5b3b89e43f0a73ca855852cc01.tar.gz |
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 <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22634>
Diffstat (limited to 'src/virtio')
-rw-r--r-- | src/virtio/vulkan/vn_device.c | 18 |
1 files changed, 4 insertions, 14 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) |