radv: Get physical device from radv_device instead of the instance.
[mesa.git] / src / amd / vulkan / radv_pipeline_cache.c
index 4fd09beb6334a4950c4a41527ed2cc4faded9708..2cb1dfb6eb03971de98913903b51b85f928f4f91 100644 (file)
@@ -308,7 +308,6 @@ radv_pipeline_cache_load(struct radv_pipeline_cache *cache,
                         const void *data, size_t size)
 {
        struct radv_device *device = cache->device;
-       struct radv_physical_device *pdevice = &device->instance->physicalDevice;
        struct cache_header header;
 
        if (size < sizeof(header))
@@ -320,9 +319,9 @@ radv_pipeline_cache_load(struct radv_pipeline_cache *cache,
                return;
        if (header.vendor_id != 0x1002)
                return;
-       if (header.device_id != device->instance->physicalDevice.rad_info.pci_id)
+       if (header.device_id != device->physical_device->rad_info.pci_id)
                return;
-       if (memcmp(header.uuid, pdevice->uuid, VK_UUID_SIZE) != 0)
+       if (memcmp(header.uuid, device->physical_device->uuid, VK_UUID_SIZE) != 0)
                return;
 
        char *end = (void *) data + size;
@@ -404,7 +403,6 @@ VkResult radv_GetPipelineCacheData(
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        RADV_FROM_HANDLE(radv_pipeline_cache, cache, _cache);
-       struct radv_physical_device *pdevice = &device->instance->physicalDevice;
        struct cache_header *header;
        VkResult result = VK_SUCCESS;
        const size_t size = sizeof(*header) + cache->total_size;
@@ -421,8 +419,8 @@ VkResult radv_GetPipelineCacheData(
        header->header_size = sizeof(*header);
        header->header_version = VK_PIPELINE_CACHE_HEADER_VERSION_ONE;
        header->vendor_id = 0x1002;
-       header->device_id = device->instance->physicalDevice.rad_info.pci_id;
-       memcpy(header->uuid, pdevice->uuid, VK_UUID_SIZE);
+       header->device_id = device->physical_device->rad_info.pci_id;
+       memcpy(header->uuid, device->physical_device->uuid, VK_UUID_SIZE);
        p += header->header_size;
 
        struct cache_entry *entry;