ref: gl: do not limit texture units by broken report of shaders extension

This commit is contained in:
Alibek Omarov
2026-04-25 04:26:09 +05:00
committed by a1batross
parent a3897f402a
commit d3b01d313b

View File

@@ -962,8 +962,17 @@ static void GL_InitExtensionsBigGL( void )
pglGetIntegerv( GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &glConfig.max_vertex_uniforms );
pglGetIntegerv( GL_MAX_VERTEX_ATTRIBS_ARB, &glConfig.max_vertex_attribs );
// GLSL sanity check
if( glConfig.max_vertex_uniforms <= 0 || glConfig.max_texture_coords < glConfig.max_texture_units || glConfig.max_teximage_units < glConfig.max_texture_units )
{
gEngfuncs.Con_Reportf( S_NOTE "driver supports GL_ARB_shading_language_100 but has bogus limits, ignoring\n" );
GL_SetExtension( GL_SHADER_GLSL100_EXT, false );
glConfig.max_texture_coords = glConfig.max_teximage_units = glConfig.max_texture_units;
glConfig.max_vertex_uniforms = 0;
glConfig.max_vertex_attribs = 0;
}
#if XASH_WIN32 // Win32 only drivers?
if( glConfig.hardware_type == GLHW_RADEON && glConfig.max_vertex_uniforms > 512 )
else if( glConfig.hardware_type == GLHW_RADEON && glConfig.max_vertex_uniforms > 512 )
glConfig.max_vertex_uniforms /= 4; // radeon returns not correct info
#endif
}