Skip to content

Commit 18b7f37

Browse files
cursoragenttimfox
andcommitted
Drop stale OpenGL renderer cvars and misleading fallback hints
Vulkan-only clients no longer register r_allowSoftwareGL or r_glDriver (USE_OPENGL_API). SDL GLimp only touches those cvars when OpenGL is compiled in. Replace obsolete "+set cl_renderer opengl" help text with Vulkan/SDL guidance and update the demo features cfg comment. Co-authored-by: Tim Fox <timfox@outlook.com>
1 parent a0863ac commit 18b7f37

5 files changed

Lines changed: 23 additions & 14 deletions

File tree

examples/demo_game/mod/demo_features.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ set r_fontConsoleAlign 1
1414

1515
// Optional SDF (pre-generated BMFont + distance atlas in pk3): set r_sdfEnable 1; set r_sdfFont "fonts/demo_console_sdf"; tune r_sdfSmoothing
1616

17-
// --- Renderer backend (user often sets on command line) ---
18-
// +set cl_renderer vulkan or opengl
17+
// --- Renderer backend: Vulkan only (+set cl_renderer vulkan is the default) ---
1918

2019
// --- PBR / materials (Vulkan path) ---
2120
set r_pbr 1

src/client/cl_main.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,11 @@ cvar_t *vid_xpos; // X coordinate of window position
869869
cvar_t *vid_ypos; // Y coordinate of window position
870870
cvar_t *r_noborder;
871871

872-
cvar_t *r_allowSoftwareGL; // don't abort out if the pixelformat claims software
873872
cvar_t *r_swapInterval;
873+
#ifdef USE_OPENGL_API
874+
cvar_t *r_allowSoftwareGL; // don't abort out if the pixelformat claims software
874875
cvar_t *r_glDriver;
876+
#endif
875877
cvar_t *r_displayRefresh;
876878
cvar_t *r_fullscreen;
877879
cvar_t *r_mode;
@@ -3986,13 +3988,15 @@ static void CL_ToggleImgui_f( void )
39863988

39873989
static void CL_InitGLimp_Cvars( void )
39883990
{
3989-
// shared with GLimp
3990-
r_allowSoftwareGL = Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
3991-
Cvar_SetDescription( r_allowSoftwareGL, "Toggle the use of the default software OpenGL driver supplied by the Operating System." );
3991+
// shared with GLimp / VKimp
39923992
r_swapInterval = Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE_ND );
39933993
Cvar_SetDescription( r_swapInterval, "V-blanks to wait before swapping buffers.\n 0: No V-Sync\n 1: Synced to the monitor's refresh rate." );
3994+
#ifdef USE_OPENGL_API
3995+
r_allowSoftwareGL = Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
3996+
Cvar_SetDescription( r_allowSoftwareGL, "Toggle the use of the default software OpenGL driver supplied by the Operating System." );
39943997
r_glDriver = Cvar_Get( "r_glDriver", OPENGL_DRIVER_NAME, CVAR_ARCHIVE_ND | CVAR_LATCH );
39953998
Cvar_SetDescription( r_glDriver, "Specifies the OpenGL driver to use, will revert back to default if driver name set is invalid." );
3999+
#endif
39964000

39974001
r_displayRefresh = Cvar_Get( "r_displayRefresh", "0", CVAR_LATCH );
39984002
Cvar_CheckRange( r_displayRefresh, "0", "500", CV_INTEGER );

src/client/client.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,11 @@ extern cvar_t *vid_xpos;
428428
extern cvar_t *vid_ypos;
429429
extern cvar_t *r_noborder;
430430

431-
extern cvar_t *r_allowSoftwareGL;
432431
extern cvar_t *r_swapInterval;
432+
#ifdef USE_OPENGL_API
433+
extern cvar_t *r_allowSoftwareGL;
433434
extern cvar_t *r_glDriver;
435+
#endif
434436

435437
extern cvar_t *r_displayRefresh;
436438
extern cvar_t *r_fullscreen;
@@ -624,7 +626,7 @@ void GLimp_Minimize( void );
624626
void GLimp_LogComment( const char *comment );
625627
void GLW_RestoreGamma( void );
626628

627-
// OpenGL (needed for static OpenGL build, or Vulkan build with dlopen so OpenGL renderer can load)
629+
// Window / swapchain (SDL GLimp for OpenGL; VKimp for Vulkan)
628630
#if defined(USE_OPENGL_API) || defined(USE_VULKAN_API)
629631
void GLimp_Init( glconfig_t *config );
630632
void GLimp_Shutdown( qboolean unloadDLL );

src/platform/sdl/sdl_glimp.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,10 @@ static int GLW_SetMode( int mode, const char *modeFS, qboolean fullscreen, qbool
412412
else
413413
perChannelColorBits = 4;
414414

415-
#ifdef USE_VULKAN_API
415+
#if defined(USE_OPENGL_API)
416+
# ifdef USE_VULKAN_API
416417
if ( !vulkan )
417-
#endif
418+
# endif
418419
{
419420

420421
#ifdef __sgi /* Fix for SGIs grabbing too many bits of color */
@@ -450,6 +451,7 @@ static int GLW_SetMode( int mode, const char *modeFS, qboolean fullscreen, qbool
450451
if ( !r_allowSoftwareGL->integer )
451452
SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
452453
}
454+
#endif /* USE_OPENGL_API */
453455

454456
if ( ( SDL_window = SDL_CreateWindow( cl_title, x, y, config->vidWidth, config->vidHeight, flags ) ) == NULL )
455457
{
@@ -559,7 +561,7 @@ static int GLW_SetMode( int mode, const char *modeFS, qboolean fullscreen, qbool
559561
Com_Printf( "[VK] Couldn't get a visual: %s\n", ( sdl_err && sdl_err[0] ) ? sdl_err : "(no SDL error string)" );
560562
Com_Printf( "[VK] SDL video driver: %s\n", SDL_GetCurrentVideoDriver() ? SDL_GetCurrentVideoDriver() : "(none)" );
561563
#if defined(__arm__) || defined(__aarch64__)
562-
Com_Printf( S_COLOR_YELLOW "[VK] On ARM, Vulkan may be unavailable. Try: ./idtech3.aarch64 +set cl_renderer opengl\n" );
564+
Com_Printf( S_COLOR_YELLOW "[VK] On ARM, Vulkan may be unavailable. Ensure SDL was built with Vulkan support (see docs/ARM_RASPBERRY_PI.md).\n" );
563565
#endif
564566
/* SDL built without Vulkan: no point retrying modes/drivers */
565567
if ( vulkan && sdl_err && strstr( sdl_err, "Vulkan support" ) != NULL )
@@ -692,7 +694,9 @@ void GLimp_Init( glconfig_t *config )
692694
in_nograb = Cvar_Get( "in_nograb", "0", 0 );
693695
Cvar_SetDescription( in_nograb, "Do not capture mouse in game, may be useful during online streaming." );
694696

697+
#ifdef USE_OPENGL_API
695698
r_allowSoftwareGL = Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
699+
#endif
696700

697701
r_swapInterval = Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE | CVAR_LATCH );
698702
r_stereoEnabled = Cvar_Get( "r_stereoEnabled", "0", CVAR_ARCHIVE | CVAR_LATCH );
@@ -976,7 +980,7 @@ void VKimp_Init( glconfig_t *config )
976980
#if defined(__arm__) || defined(__aarch64__)
977981
Com_Printf( S_COLOR_YELLOW "Vulkan failed on ARM. SDL needs Vulkan support.\n" );
978982
Com_Printf( " Build SDL with Vulkan: ./scripts/build_sdl_vulkan_rpi.sh\n" );
979-
Com_Printf( " Or use OpenGL: +set cl_renderer opengl\n" );
983+
Com_Printf( " Vulkan is required; rebuild SDL with Vulkan enabled.\n" );
980984
#endif
981985
Com_Error( ERR_FATAL, "VKimp_Init() - could not load Vulkan subsystem: %s", SDL_GetError() );
982986
return;
@@ -986,7 +990,7 @@ void VKimp_Init( glconfig_t *config )
986990
#if defined(__arm__) || defined(__aarch64__)
987991
Com_Printf( S_COLOR_YELLOW "Vulkan failed on ARM. SDL may lack Vulkan support.\n" );
988992
Com_Printf( " Build SDL with Vulkan: ./scripts/build_sdl_vulkan_rpi.sh\n" );
989-
Com_Printf( " Or use OpenGL: +set cl_renderer opengl\n" );
993+
Com_Printf( " Vulkan is required; rebuild SDL with Vulkan enabled.\n" );
990994
#endif
991995
Com_Error( ERR_FATAL, "VKimp_Init() - could not load Vulkan subsystem: %s", SDL_GetError() );
992996
return;

src/platform/unix/linux_signals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void signal_handler( int sig )
8484
fprintf( stderr, "\n" );
8585
fprintf( stderr, " Try these workarounds:\n" );
8686
fprintf( stderr, " 1. Clear shader cache: rm -rf ~/.nv/GLCache/\n" );
87-
fprintf( stderr, " 2. Use OpenGL renderer: +set cl_renderer opengl\n" );
87+
fprintf( stderr, " 2. Ensure Vulkan/SDL are built correctly (see docs/DEVELOPMENT_SETUP.md)\n" );
8888
fprintf( stderr, " 3. Disable post-process: +set r_bloom 0 +set r_ssao 0\n" );
8989
fprintf( stderr, " 4. Update GPU driver to the latest version\n" );
9090
fprintf( stderr, " 5. Set r_volumetricFog 0 to disable volumetric fog\n" );

0 commit comments

Comments
 (0)