summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2016-11-22 00:39:50 +0100
committerBas Nieuwenhuizen <[email protected]>2016-11-22 07:58:35 +0100
commit24427e31ef5949ded323ae193f0e414417972c17 (patch)
treef52117d7f6ce7f8d6881027fc942685f7a2d2f49 /src
parentd94383970f2cad9f474760b18fd277efeda4c612 (diff)
radv: Incorporate GPU family into cache UUID.
Invalidates the cache when someone switches cards. Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_device.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 04c0bdc1941..85959735d29 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -61,9 +61,10 @@ radv_get_function_timestamp(void *ptr, uint32_t* timestamp)
}
static int
-radv_device_get_cache_uuid(void *uuid)
+radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
{
uint32_t mesa_timestamp, llvm_timestamp;
+ uint16_t f = family;
memset(uuid, 0, VK_UUID_SIZE);
if (radv_get_function_timestamp(radv_device_get_cache_uuid, &mesa_timestamp) ||
radv_get_function_timestamp(LLVMInitializeAMDGPUTargetInfo, &llvm_timestamp))
@@ -71,7 +72,8 @@ radv_device_get_cache_uuid(void *uuid)
memcpy(uuid, &mesa_timestamp, 4);
memcpy((char*)uuid + 4, &llvm_timestamp, 4);
- snprintf((char*)uuid + 8, VK_UUID_SIZE - 8, "radv");
+ memcpy((char*)uuid + 8, &f, 2);
+ snprintf((char*)uuid + 10, VK_UUID_SIZE - 10, "radv");
return 0;
}
@@ -120,7 +122,7 @@ radv_physical_device_init(struct radv_physical_device *device,
goto fail;
}
- if (radv_device_get_cache_uuid(device->uuid)) {
+ if (radv_device_get_cache_uuid(device->rad_info.family, device->uuid)) {
radv_finish_wsi(device);
device->ws->destroy(device->ws);
goto fail;