radv: Fix truncation issue hexifying the cache uuid for the disk cache.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 25 Oct 2017 01:43:00 +0000 (03:43 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 25 Oct 2017 07:50:05 +0000 (09:50 +0200)
Going from binary to hex has a 2x blowup.

Fixes: 14216252923 'radv: create on-disk shader cache'
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c

index ebc74fbadef7a091cc96d4c9043c9b2f808477fb..19ff8fec64797124b7173ef7e611f71134015ead 100644 (file)
@@ -170,8 +170,8 @@ radv_physical_device_init(struct radv_physical_device *device,
        /* The gpu id is already embeded in the uuid so we just pass "radv"
         * when creating the cache.
         */
-       char buf[VK_UUID_SIZE + 1];
-       disk_cache_format_hex_id(buf, device->cache_uuid, VK_UUID_SIZE);
+       char buf[VK_UUID_SIZE * 2 + 1];
+       disk_cache_format_hex_id(buf, device->cache_uuid, VK_UUID_SIZE * 2);
        device->disk_cache = disk_cache_create(device->name, buf, shader_env_flags);
 
        fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");