Skip to content

Commit 190a574

Browse files
committed
Use VK_EXT_headless_surface in wsi-none
1 parent b4d7b2b commit 190a574

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/wsi/none/wsi_window_none.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ namespace dxvk::wsi {
7676
PFN_vkGetInstanceProcAddr pfnVkGetInstanceProcAddr,
7777
VkInstance instance,
7878
VkSurfaceKHR* pSurface) {
79-
// TODO: Could use VK_EXT_headless_surface here?
80-
return VK_ERROR_FEATURE_NOT_PRESENT;
79+
auto pfnVkCreateHeadlessSurfaceEXT = reinterpret_cast<PFN_vkCreateHeadlessSurfaceEXT>(
80+
pfnVkGetInstanceProcAddr(instance, "vkCreateHeadlessSurfaceEXT"));
81+
82+
if (!pfnVkCreateHeadlessSurfaceEXT)
83+
return VK_ERROR_FEATURE_NOT_PRESENT;
84+
85+
VkHeadlessSurfaceCreateInfoEXT info = { VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT };
86+
info.pNext = nullptr;
87+
info.flags = 0;
88+
return pfnVkCreateHeadlessSurfaceEXT(instance, &info, nullptr, pSurface);
8189
}
8290

8391
}

0 commit comments

Comments
 (0)