Don't check fixed function GL extensions when using shader pipeline

GL_TEXTURE_UNITS_ARB is not part of OpenGL ES 2 API and sets GL error.
It's not part of OpenGL 3.2 core profile either.
This commit is contained in:
Zack Middleton 2018-07-20 23:40:26 -05:00
parent d861a4f427
commit 658165cfbb
2 changed files with 77 additions and 69 deletions

View file

@ -261,6 +261,8 @@ static void InitOpenGL( void )
GLimp_Init( qfalse ); GLimp_Init( qfalse );
GLimp_InitExtraExtensions(); GLimp_InitExtraExtensions();
glConfig.textureEnvAddAvailable = qtrue;
// OpenGL driver constants // OpenGL driver constants
qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &temp ); qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &temp );
glConfig.maxTextureSize = temp; glConfig.maxTextureSize = temp;
@ -270,6 +272,9 @@ static void InitOpenGL( void )
{ {
glConfig.maxTextureSize = 0; glConfig.maxTextureSize = 0;
} }
qglGetIntegerv( GL_MAX_TEXTURE_IMAGE_UNITS, &temp );
glConfig.numTextureUnits = temp;
} }
// set default state // set default state
@ -1044,7 +1049,7 @@ void GfxInfo_f( void )
} }
ri.Printf( PRINT_ALL, "\n" ); ri.Printf( PRINT_ALL, "\n" );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize ); ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits ); ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_IMAGE_UNITS: %d\n", glConfig.numTextureUnits );
ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits ); ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );
ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] ); ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] );
if ( glConfig.displayFrequency ) if ( glConfig.displayFrequency )

View file

@ -802,7 +802,7 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
GLimp_InitExtensions GLimp_InitExtensions
=============== ===============
*/ */
static void GLimp_InitExtensions( void ) static void GLimp_InitExtensions( qboolean fixedFunction )
{ {
if ( !r_allowExtensions->integer ) if ( !r_allowExtensions->integer )
{ {
@ -854,7 +854,9 @@ static void GLimp_InitExtensions( void )
} }
} }
// OpenGL 1 fixed function pipeline
if ( fixedFunction )
{
// GL_EXT_texture_env_add // GL_EXT_texture_env_add
glConfig.textureEnvAddAvailable = qfalse; glConfig.textureEnvAddAvailable = qfalse;
if ( SDL_GL_ExtensionSupported( "GL_EXT_texture_env_add" ) ) if ( SDL_GL_ExtensionSupported( "GL_EXT_texture_env_add" ) )
@ -937,6 +939,7 @@ static void GLimp_InitExtensions( void )
{ {
ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" ); ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
} }
}
textureFilterAnisotropic = qfalse; textureFilterAnisotropic = qfalse;
if ( SDL_GL_ExtensionSupported( "GL_EXT_texture_filter_anisotropic" ) ) if ( SDL_GL_ExtensionSupported( "GL_EXT_texture_filter_anisotropic" ) )
@ -1064,7 +1067,7 @@ success:
} }
// initialize extensions // initialize extensions
GLimp_InitExtensions( ); GLimp_InitExtensions( fixedFunction );
ri.Cvar_Get( "r_availableModes", "", CVAR_ROM ); ri.Cvar_Get( "r_availableModes", "", CVAR_ROM );