Skip to content

Commit

Permalink
unnecessary glExtendedValidation variable
Browse files Browse the repository at this point in the history
  • Loading branch information
slipher committed Feb 13, 2022
1 parent 3ed752f commit 6f5f2ba
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/engine/sys/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,10 +1350,8 @@ static rserr_t GLimp_SetMode( const int mode, const bool fullscreen, const bool
// Reuse best configuration on vid_restart
// unless glExtendedValidation is modified.
static glConfiguration bestValidatedConfiguration = {};
static int glExtendedValidation = 0;

if ( bestValidatedConfiguration.major != 0
&& glExtendedValidation == r_glExtendedValidation->integer )

This comment has been minimized.

Copy link
@illwieckz

illwieckz Feb 14, 2022

Member

If I remember correctly this was to detect the event of r_glExtendedValidation having been modified after startup and before vid_restart to not use cached results of previous validation when the cvar is modified, as if r_glExtendedValidation was disabled before and become enabled, code may still assume 3.2 is best version available without redoing tests starting from 4.6.

if ( r_glExtendedValidation->integer && bestValidatedConfiguration.major != 0 )
{
const char* bestValidatedProfileName = GLimp_getProfileName( bestValidatedConfiguration.profile );

Expand Down Expand Up @@ -1384,8 +1382,6 @@ static rserr_t GLimp_SetMode( const int mode, const bool fullscreen, const bool
}
}

glExtendedValidation = r_glExtendedValidation->integer;

/* Do not concatenate those two lines or the affectation
will be done only once.
See https://github.com/DaemonEngine/Daemon/issues/566 */
Expand All @@ -1400,7 +1396,6 @@ static rserr_t GLimp_SetMode( const int mode, const bool fullscreen, const bool
bestConfiguration.minor,
bestProfileName );

glExtendedValidation = r_glExtendedValidation->integer;
static glConfiguration requestedConfiguration = {};

// Attempt to apply custom configuration if exists.
Expand Down

0 comments on commit 6f5f2ba

Please sign in to comment.