Skip to content

Commit c69d5e3

Browse files
committed
vdisp/vulkan_sdl3: fix driver settting
driver= option was not applied since forking the code from SDL2 - the hint must be applied before SDL_InitSubSystem(SDL_INIT_VIDEO).
1 parent 00898f9 commit c69d5e3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/video_display/vulkan/vulkan_sdl3.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -788,18 +788,12 @@ void* display_vulkan_init(module* parent, const char* fmt, unsigned int flags) {
788788
}
789789
}
790790

791-
bool ret = SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
792-
if (!ret) {
793-
log_msg(LOG_LEVEL_ERROR, "Unable to initialize SDL3: %s\n", SDL_GetError());
794-
return nullptr;
795-
}
796-
797791
if (!args.driver.empty()) {
798792
SDL_CHECK(SDL_SetHint(SDL_HINT_VIDEO_DRIVER, args.driver.c_str()));
799793
}
800-
ret = SDL_InitSubSystem(SDL_INIT_VIDEO);
794+
bool ret = SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
801795
if (!ret) {
802-
log_msg(LOG_LEVEL_ERROR, "Unable to initialize SDL3 video: %s\n", SDL_GetError());
796+
log_msg(LOG_LEVEL_ERROR, "Unable to initialize SDL3: %s\n", SDL_GetError());
803797
return nullptr;
804798
}
805799
MSG(NOTICE, "Using driver: %s\n", SDL_GetCurrentVideoDriver());

0 commit comments

Comments
 (0)