From 271e523f3aafe5ce01613ef5d3b117bc3b4546eb Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Mon, 14 Dec 2015 08:52:14 -0700 Subject: loader: Fix physical device cast for enumerate properties trampoline code Enumerate layer and extension properties don't always call down chain so can't just cast physical device to the loader struct. Must search for it in cases where a layer wrapped it. --- loader/loader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'loader') diff --git a/loader/loader.c b/loader/loader.c index 73a3939b..0b0e1306 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -3711,11 +3711,13 @@ VKAPI_ATTR VkResult VKAPI_CALL loader_EnumerateDeviceExtensionProperties( uint32_t* pPropertyCount, VkExtensionProperties* pProperties) { - struct loader_physical_device *phys_dev = (struct loader_physical_device *) physicalDevice; + struct loader_physical_device *phys_dev; uint32_t copy_size; uint32_t count; struct loader_device_extension_list *dev_ext_list=NULL; + //TODO fix this aliases physical devices + phys_dev = loader_get_physical_device(physicalDevice); /* get layer libraries if needed */ if (pLayerName && strlen(pLayerName) != 0) { @@ -3767,8 +3769,9 @@ VKAPI_ATTR VkResult VKAPI_CALL loader_EnumerateDeviceLayerProperties( VkLayerProperties* pProperties) { uint32_t copy_size; - struct loader_physical_device *phys_dev = (struct loader_physical_device *) physicalDevice; - + struct loader_physical_device *phys_dev; + //TODO fix this, aliases physical devices + phys_dev = loader_get_physical_device(physicalDevice); uint32_t count = phys_dev->this_instance->device_layer_list.count; if (pProperties == NULL) { -- cgit v1.2.3