Fix for Apple compiler bug
authorRichard S. Wright Jr <richard@lunarg.com>
Mon, 12 Dec 2022 18:21:51 +0000 (13:21 -0500)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Mon, 12 Dec 2022 19:34:24 +0000 (12:34 -0700)
loader/loader.c

index bc80284..e6bf8bd 100644 (file)
@@ -4687,10 +4687,17 @@ void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkI
                                                   created_inst);
 }
 
+#ifdef __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) {
+                                    PFN_vkGetDeviceProcAddr *layerNextGDPA) __attribute__ ((optnone)) {
+#else
+    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;