Skip to content

Commit 9397b40

Browse files
committed
Disable optimization for loader_create_device_chain
Vulkan CTS crashes when running test case dEQP-VK.api.object_management.single.device_group. The root cause is a compiler issue when optimization (-O2) is enabled. The problem occurs on embedded Linux (aarch64) using gcc aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.08) 9.3.0
1 parent bcf860b commit 9397b40

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

loader/loader.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4915,17 +4915,13 @@ void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkI
49154915
created_inst);
49164916
}
49174917

4918-
#if defined(__APPLE__)
4919-
VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCreateInfo *pCreateInfo,
4920-
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
4921-
struct loader_device *dev, PFN_vkGetInstanceProcAddr callingLayer,
4922-
PFN_vkGetDeviceProcAddr *layerNextGDPA) __attribute__((optnone)) {
4923-
#else
4918+
#if defined(__APPLE__) || defined(__GNUC__)
4919+
__attribute__((optimize("O0")))
4920+
#endif
49244921
VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCreateInfo *pCreateInfo,
49254922
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
49264923
struct loader_device *dev, PFN_vkGetInstanceProcAddr callingLayer,
49274924
PFN_vkGetDeviceProcAddr *layerNextGDPA) {
4928-
#endif
49294925
uint32_t num_activated_layers = 0;
49304926
struct activated_layer_info *activated_layers = NULL;
49314927
VkLayerDeviceLink *layer_device_link_info;

0 commit comments

Comments
 (0)