From d33f2697a3ec128d9385bb0d07c5f6f6161fff83 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 1 Oct 2023 10:34:35 -0400 Subject: [PATCH] - set default backend to Vulkan, if Vulkan fails go GLES not OpenGL --- src/common/platform/posix/cocoa/i_video.mm | 2 +- src/common/platform/posix/sdl/sdlglvideo.cpp | 2 +- src/common/platform/win32/win32glvideo.cpp | 2 +- src/common/rendering/v_video.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/platform/posix/cocoa/i_video.mm b/src/common/platform/posix/cocoa/i_video.mm index 9a2737ccfe3..88c1b9b7ea8 100644 --- a/src/common/platform/posix/cocoa/i_video.mm +++ b/src/common/platform/posix/cocoa/i_video.mm @@ -462,7 +462,7 @@ void SetupOpenGLView(CocoaWindow* const window, const OpenGLProfile profile) if (fb == nullptr) { #ifdef HAVE_GLES2 - if(V_GetBackend() == 2) + if(V_GetBackend() != 0) fb = new OpenGLESRenderer::OpenGLFrameBuffer(0, vid_fullscreen); else #endif diff --git a/src/common/platform/posix/sdl/sdlglvideo.cpp b/src/common/platform/posix/sdl/sdlglvideo.cpp index 326a5c9d994..86a31c0c37d 100644 --- a/src/common/platform/posix/sdl/sdlglvideo.cpp +++ b/src/common/platform/posix/sdl/sdlglvideo.cpp @@ -315,7 +315,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer () if (fb == nullptr) { #ifdef HAVE_GLES2 - if (V_GetBackend() == 2) + if (V_GetBackend() != 0) fb = new OpenGLESRenderer::OpenGLFrameBuffer(0, vid_fullscreen); else #endif diff --git a/src/common/platform/win32/win32glvideo.cpp b/src/common/platform/win32/win32glvideo.cpp index ebeb13cc947..c972940a5a0 100644 --- a/src/common/platform/win32/win32glvideo.cpp +++ b/src/common/platform/win32/win32glvideo.cpp @@ -109,7 +109,7 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer() SystemGLFrameBuffer *fb; #ifdef HAVE_GLES2 - if (V_GetBackend() == 2) + if (V_GetBackend() != 0) fb = new OpenGLESRenderer::OpenGLFrameBuffer(m_hMonitor, vid_fullscreen); else #endif diff --git a/src/common/rendering/v_video.cpp b/src/common/rendering/v_video.cpp index 47caad55e18..7c79e8bea88 100644 --- a/src/common/rendering/v_video.cpp +++ b/src/common/rendering/v_video.cpp @@ -93,7 +93,7 @@ CUSTOM_CVAR(Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) } } -CUSTOM_CVAR(Int, vid_preferbackend, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +CUSTOM_CVAR(Int, vid_preferbackend, 1, 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