From d283a146bc8e988c646ac758466b28011253396f Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Thu, 17 Jul 2025 18:22:54 +0200 Subject: [PATCH] re-fix the mesa bug dumb puppy reintroduces old mesa bug --- src/layer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/layer.cpp b/src/layer.cpp index d19dabb..9c2694b 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -101,15 +101,13 @@ namespace { if (!success) throw LSFG::vulkan_error(VK_ERROR_INITIALIZATION_FAILED, "Failed to get instance function pointer for vkCreateInstance"); - success &= initInstanceFunc(*pInstance, - "vkCreateDevice", &next_vkCreateDevice); - if (!success) - throw LSFG::vulkan_error(VK_ERROR_INITIALIZATION_FAILED, - "Failed to get instance function pointer for vkCreateDevice"); // NOLINTEND | skip initialization if the layer is disabled - if (!Config::activeConf.enable) - return next_vkCreateInstance(pCreateInfo, pAllocator, pInstance); + if (!Config::activeConf.enable) { + auto res = next_vkCreateInstance(pCreateInfo, pAllocator, pInstance); + initInstanceFunc(*pInstance, "vkCreateDevice", &next_vkCreateDevice); + return res; + } // create instance try { @@ -126,6 +124,8 @@ namespace { success = true; success &= initInstanceFunc(*pInstance, "vkDestroyInstance", &next_vkDestroyInstance); + success &= initInstanceFunc(*pInstance, + "vkCreateDevice", &next_vkCreateDevice); // workaround mesa bug success &= initInstanceFunc(*pInstance, "vkGetPhysicalDeviceQueueFamilyProperties", &next_vkGetPhysicalDeviceQueueFamilyProperties); success &= initInstanceFunc(*pInstance,