diff --git a/src/rendering/v_video.cpp b/src/rendering/v_video.cpp index f587d3d7f7..9beb8e36be 100644 --- a/src/rendering/v_video.cpp +++ b/src/rendering/v_video.cpp @@ -108,12 +108,16 @@ CUSTOM_CVAR(Int, vid_rendermode, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOIN // No further checks needed. All this changes now is which scene drawer the render backend calls. } -CUSTOM_CVAR(Int, vid_enablevulkan, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +CUSTOM_CVAR(Int, vid_preferbackend, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { // [SP] This may seem pointless - but I don't want to implement live switching just // yet - I'm pretty sure it's going to require a lot of reinits and destructions to // do it right without memory leaks + // 0 - OpenGL + // 1 - Vulkan + // 2 - SoftPoly v2 + Printf("Changing the video backend requires a restart for " GAMENAME ".\n"); } diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index 4b3016834d..af6ab11887 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -51,7 +51,7 @@ #include "i_system.h" #include "swrenderer/r_swrenderer.h" -EXTERN_CVAR(Int, vid_enablevulkan) +EXTERN_CVAR(Int, vid_preferbackend) extern HWND Window; @@ -129,11 +129,12 @@ void I_InitGraphics () // are the active app. Huh? } -#if 1 // always use poly backend on this branch, for now. - Video = new Win32PolyVideo(); -#else + if (vid_preferbackend == 2) + { + Video = new Win32PolyVideo(); + } #ifdef HAVE_VULKAN - else if (vid_enablevulkan == 1) + else if (vid_preferbackend == 1) { // first try Vulkan, if that fails OpenGL try @@ -151,8 +152,11 @@ void I_InitGraphics () { Video = new Win32GLVideo(); } -#endif + if (Video == NULL) + Video = new Win32PolyVideo(); + + // we somehow STILL don't have a display!! if (Video == NULL) I_FatalError ("Failed to initialize display"); diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 13859176dc..36e042b1f3 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -119,7 +119,8 @@ EXTERN_CVAR (Bool, queryiwad); EXTERN_CVAR (Bool, disableautoload) EXTERN_CVAR (Bool, autoloadlights) EXTERN_CVAR (Bool, autoloadbrightmaps) -EXTERN_CVAR (Int, vid_enablevulkan) +//EXTERN_CVAR (Int, vid_enablevulkan) // hack - we're just disabling it for now, this code does nothing +uint32_t vid_enablevulkan = 0; extern HWND Window, ConWindow, GameTitleWindow; extern HANDLE StdOut;