[dxvk] Remove SDL dummy window

SDL >= 2.0.9 permits passing a nullptr window to
SDL_Vulkan_GetInstanceExtensions, so there's no
point in going though the work of creating a
window just to call this function.
This commit is contained in:
Hunter Kvalevog 2023-01-07 07:45:35 -06:00 committed by Joshie
parent 196fefec4c
commit 3491895960
1 changed files with 2 additions and 14 deletions

View File

@ -13,30 +13,18 @@ namespace dxvk {
DxvkNameSet DxvkPlatformExts::getInstanceExtensions() {
SDL_Window* window = SDL_CreateWindow(
"Dummy Window",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
1, 1,
SDL_WINDOW_HIDDEN | SDL_WINDOW_VULKAN);
if (window == nullptr)
throw DxvkError(str::format("SDL2 WSI: Failed to create dummy window. ", SDL_GetError()));
uint32_t extensionCount = 0;
if (!SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, nullptr))
if (!SDL_Vulkan_GetInstanceExtensions(nullptr, &extensionCount, nullptr))
throw DxvkError(str::format("SDL2 WSI: Failed to get instance extension count. ", SDL_GetError()));
auto extensionNames = std::vector<const char *>(extensionCount);
if (!SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, extensionNames.data()))
if (!SDL_Vulkan_GetInstanceExtensions(nullptr, &extensionCount, extensionNames.data()))
throw DxvkError(str::format("SDL2 WSI: Failed to get instance extensions. ", SDL_GetError()));
DxvkNameSet names;
for (const char* name : extensionNames)
names.add(name);
SDL_DestroyWindow(window);
return names;
}