Skip to content

Commit

Permalink
HACK HACK Apple fixes for latest MoltenVk version
Browse files Browse the repository at this point in the history
MoltenVk requires "VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME" to be enabled
  • Loading branch information
Zorro666 committed Feb 17, 2024
1 parent a263003 commit a475241
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions renderdoc/driver/vulkan/vk_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,9 @@ static const VkExtensionProperties supportedExtensions[] = {
VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME,
VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION,
},
#ifdef VK_KHR_portability_enumeration
{VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION},
#endif
{
VK_KHR_PRESENT_ID_EXTENSION_NAME,
VK_KHR_PRESENT_ID_SPEC_VERSION,
Expand Down
4 changes: 3 additions & 1 deletion renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ RDResult WrappedVulkan::Initialise(VkInitParams &params, uint64_t sectionVersion
instNext = &flagsEXT;
}

params.Extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);

const char **layerscstr = new const char *[params.Layers.size()];
for(size_t i = 0; i < params.Layers.size(); i++)
layerscstr[i] = params.Layers[i].c_str();
Expand All @@ -419,7 +421,7 @@ RDResult WrappedVulkan::Initialise(VkInitParams &params, uint64_t sectionVersion
VkInstanceCreateInfo instinfo = {
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
instNext,
0,
VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR,
&renderdocAppInfo,
(uint32_t)params.Layers.size(),
layerscstr,
Expand Down
2 changes: 1 addition & 1 deletion util/test/demos/vk/vk_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ struct InstanceCreateInfo : public VkInstanceCreateInfo
{
sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
pNext = NULL;
flags = 0;
flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
pApplicationInfo = &appInfo;
enabledLayerCount = uint32_t(layers.size());
ppEnabledLayerNames = layers.data();
Expand Down
2 changes: 1 addition & 1 deletion util/test/demos/vk/vk_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
X11Window::Init();
#elif defined(__APPLE__)
enabledInstExts.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME);

enabledInstExts.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
AppleWindow::Init();
#else
#error UNKNOWN PLATFORM
Expand Down

0 comments on commit a475241

Please sign in to comment.