MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / AppCreateMetalSurface

Function AppCreateMetalSurface

vulkaninfo/vulkaninfo.h:1008–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008static VkSurfaceKHR AppCreateMetalSurface(AppInstance &inst) {
1009 VkMetalSurfaceCreateInfoEXT createInfo;
1010 createInfo.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT;
1011 createInfo.pNext = nullptr;
1012 createInfo.flags = 0;
1013 createInfo.pLayer = static_cast<CAMetalLayer *>(GetCAMetalLayerFromMetalView(inst.metal_window));
1014
1015 VkSurfaceKHR surface;
1016 VkResult err = vkCreateMetalSurfaceEXT(inst.instance, &createInfo, nullptr, &surface);
1017 if (err) THROW_VK_ERR("vkCreateMetalSurfaceEXT", err);
1018 return surface;
1019}
1020
1021static void AppDestroyMetalWindow(AppInstance &inst) { DestroyMetalView(inst.metal_window); }
1022#endif // VK_USE_PLATFORM_METAL_EXT

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected