Skip to content

Commit

Permalink
Add CVar r_vidRestartAlwaysFull
Browse files Browse the repository at this point in the history
disables partial vid_restarts, hopefully works around issues like
#587 (comment)

Note that resizing the window by dragging it does *not* call vid_restart
at all, so if you're having issues that are fixed by a full vid_restart
you should also set `r_windowResizable 0`
  • Loading branch information
DanielGibson committed Jul 25, 2024
1 parent b2ba154 commit 794d40a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions neo/renderer/RenderSystem_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ idCVar r_screenshotJpgQuality("r_screenshotJpgQuality", "75", CVAR_RENDERER | CV
idCVar r_screenshotPngCompression("r_screenshotPngCompression", "3", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "Compression level when using PNG screenshots (0-9). Higher levels generate smaller files, but take noticeably longer");
// DG: allow freely resizing the window
idCVar r_windowResizable("r_windowResizable", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_BOOL, "Allow resizing (and maximizing) the window (needs SDL2; with 2.0.5 or newer it's applied immediately)" );
idCVar r_vidRestartAlwaysFull( "r_vidRestartAlwaysFull", 0, CVAR_RENDERER | CVAR_ARCHIVE | CVAR_BOOL, "Always do a full vid_restart (ignore 'partial' argument), e.g. when changing window size" );

// define qgl functions
#define QGLPROC(name, rettype, args) rettype (APIENTRYP q##name) args;
Expand Down Expand Up @@ -1989,6 +1990,13 @@ void R_VidRestart_f( const idCmdArgs &args ) {
}
}

// DG: allow enforcing full vid restarts (when vid_restart is called from the menu or whatever)
// to let users work around driver bugs or whatever, like
// https://github.com/dhewm/dhewm3/issues/587#issuecomment-2206937752
if ( r_vidRestartAlwaysFull.GetBool() ) {
full = true;
}

// DG: in partial mode, try to just resize the window (and make it fullscreen or windowed)
// instead of doing a full vid_restart. Still falls back to a full vid_restart
// in case this doesn't work (for example because MSAA settings have changed)
Expand Down

0 comments on commit 794d40a

Please sign in to comment.