Open s-daveb opened 7 months ago
The following patch seems to fix that ICD exception. But it turns out that MoltenVK does not support Geometry Shaders (at least on my GPU) - so I can't load the tutorials anyway.
diff --git a/Sources/Graphics/Devices/Instance.cpp b/Sources/Graphics/Devices/Instance.cpp
index 323e191db..febff8877 100644
--- a/Sources/Graphics/Devices/Instance.cpp
+++ b/Sources/Graphics/Devices/Instance.cpp
@@ -145,6 +145,12 @@ std::vector<const char *> Instance::GetExtensions() const {
if (enableValidationLayers)
extensions.emplace_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
//extensions.emplace_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
+
+#ifdef __APPLE__
+ // macOS specific extensions
+ extensions.emplace_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
+ extensions.emplace_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
+#endif
return extensions;
}
@@ -168,6 +174,7 @@ void Instance::CreateInstance() {
enableValidationLayers = false;
}
+
auto extensions = GetExtensions();
VkInstanceCreateInfo instanceCreateInfo = {};
@@ -176,6 +183,10 @@ void Instance::CreateInstance() {
instanceCreateInfo.enabledExtensionCount = static_cast<uint32_t>(extensions.size());
instanceCreateInfo.ppEnabledExtensionNames = extensions.data();
+#ifdef __APPLE__
+ instanceCreateInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
+#endif
+
#if USE_DEBUG_MESSENGER
VkDebugUtilsMessengerCreateInfoEXT debugUtilsMessengerCreateInfo = {};
#endif
The tutorials seem to be broken, see also this editor issue. I'm in the process of getting into the engine, the TestPhysics works on my devices (windows and linux) but seems to depend on a large ecosystem of additional classes (scene, camera, ui, ...) I tried to get tutorial1 running and I'm currently stuck at the fact that at some point the camera is queried but returns a nullptr. So I try to figure out how to create a scene... Anyway, I can't directly answer your question but hope the info helps you :)
Please see my reply, I may have a fix
Describe the bug I was able to build everything on my system, with minimal warnings, but when I run the program, I get an exception and vulkan layer errors.
To Reproduce
*Expected behaviour** The tutorial runs
Screenshots N/A
Hardware:
Additional context
I think maybe Vulkan is being initialized without portability extensions? I've done very little Vulkan programming, but when I have, I have to add: