[PATCH] D128173: [mlir][vulkan-runner] fix VK_ERROR_INCOMPATIBLE_DRIVER error
Shenghang Tsai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 03:00:54 PDT 2022
jackalcooper updated this revision to Diff 438317.
Herald added subscribers: sdasgup3, wenzhicui, wrengr, dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, nicolasvasilache, shauheen, mehdi_amini.
Herald added a project: MLIR.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128173/new/
https://reviews.llvm.org/D128173
Files:
mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
Index: mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
===================================================================
--- mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
+++ mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
@@ -234,12 +234,23 @@
VkInstanceCreateInfo instanceCreateInfo = {};
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
instanceCreateInfo.pNext = nullptr;
- instanceCreateInfo.flags = 0;
instanceCreateInfo.pApplicationInfo = &applicationInfo;
instanceCreateInfo.enabledLayerCount = 0;
instanceCreateInfo.ppEnabledLayerNames = nullptr;
- instanceCreateInfo.enabledExtensionCount = 0;
- instanceCreateInfo.ppEnabledExtensionNames = nullptr;
+
+ std::vector<const char *> extNames;
+#if defined(__APPLE__)
+ // enumerate MoltenVK for Vulkan 1.0
+ instanceCreateInfo.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
+ // add KHR portability instance extensions
+ extNames.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
+ extNames.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
+#else
+ instanceCreateInfo.flags = 0;
+#endif // __APPLE__
+ instanceCreateInfo.enabledExtensionCount =
+ static_cast<uint32_t>(extNames.size());
+ instanceCreateInfo.ppEnabledExtensionNames = extNames.data();
RETURN_ON_VULKAN_ERROR(
vkCreateInstance(&instanceCreateInfo, nullptr, &instance),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128173.438317.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220620/326f4082/attachment-0001.bin>
More information about the llvm-commits
mailing list