From 40bb7ce0d98b2cbf91427937484c1a3bf662be17 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 8 Oct 2015 14:40:10 +0200 Subject: [PATCH] Assign a random pipeline UUID so that applications provide SPIR-V --- renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp index b77170194..49faee91c 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp @@ -61,7 +61,13 @@ VkResult WrappedVulkan::vkGetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) { - return ObjDisp(physicalDevice)->GetPhysicalDeviceProperties(Unwrap(physicalDevice), pProperties); + VkResult ret = ObjDisp(physicalDevice)->GetPhysicalDeviceProperties(Unwrap(physicalDevice), pProperties); + + // assign a random UUID, so that we get SPIR-V instead of cached pipeline data. + srand((unsigned int)pProperties); + for(int i=0; i < VK_UUID_LENGTH; i++) pProperties->pipelineCacheUUID[i] = (rand()>>6)&0xff; + + return ret; } VkResult WrappedVulkan::vkGetPhysicalDeviceQueueCount(