Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in wrap/unwrap physical device object #1645

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4915,17 +4915,13 @@ void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkI
created_inst);
}

#if defined(__APPLE__)
VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
struct loader_device *dev, PFN_vkGetInstanceProcAddr callingLayer,
PFN_vkGetDeviceProcAddr *layerNextGDPA) __attribute__((optnone)) {
#else
#if defined(__APPLE__) || defined(__GNUC__)
__attribute__((optimize("O0")))
#endif
VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
struct loader_device *dev, PFN_vkGetInstanceProcAddr callingLayer,
PFN_vkGetDeviceProcAddr *layerNextGDPA) {
#endif
uint32_t num_activated_layers = 0;
struct activated_layer_info *activated_layers = NULL;
VkLayerDeviceLink *layer_device_link_info;
Expand Down Expand Up @@ -5915,10 +5911,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical

// Before calling down, replace the incoming physical device values (which are really loader terminator
// physical devices) with the ICDs physical device values.
struct loader_physical_device_term *cur_term;
struct loader_physical_device_tramp *cur_tramp;
for (uint32_t phys_dev = 0; phys_dev < cur_struct->physicalDeviceCount; phys_dev++) {
cur_term = (struct loader_physical_device_term *)cur_struct->pPhysicalDevices[phys_dev];
phys_dev_array[phys_dev] = cur_term->phys_dev;
cur_tramp = (struct loader_physical_device_tramp *)cur_struct->pPhysicalDevices[phys_dev];
phys_dev_array[phys_dev] = cur_tramp->phys_dev;
}
temp_struct->pPhysicalDevices = phys_dev_array;

Expand Down
Loading