@@ -2032,16 +2032,6 @@ static void GLimp_InitExtensions()
20322032 glEnable ( GL_DEBUG_OUTPUT_SYNCHRONOUS );
20332033 }
20342034
2035- // Shader limits.
2036- // From GL_ARB_vertex_shader.
2037- glGetIntegerv ( GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &glConfig2.maxVertexUniforms );
2038- // From GL_ARB_vertex_program.
2039- glGetIntegerv ( GL_MAX_VERTEX_ATTRIBS_ARB, &glConfig2.maxVertexAttribs );
2040-
2041- int reservedComponents = 36 * 10 ; // approximation how many uniforms we have besides the bone matrices
2042- glConfig2.maxVertexSkinningBones = Math::Clamp ( ( glConfig2.maxVertexUniforms - reservedComponents ) / 16 , 0 , MAX_BONES );
2043- glConfig2.vboVertexSkinningAvailable = r_vboVertexSkinning->integer && ( ( glConfig2.maxVertexSkinningBones >= 12 ) ? true : false );
2044-
20452035 /* On OpenGL Core profile the ARB_fragment_program extension doesn't exist and the related getter functions
20462036 return 0. We can assume OpenGL 3 Core hardware is featureful enough to not care about those limits. */
20472037 if ( !glConfig2.glCoreProfile )
@@ -2364,12 +2354,6 @@ static void GLimp_InitExtensions()
23642354 // made required since OpenGL 3.1
23652355 glConfig2.uniformBufferObjectAvailable = LOAD_EXTENSION_WITH_TEST ( ExtFlag_CORE, ARB_uniform_buffer_object, r_arb_uniform_buffer_object.Get () );
23662356
2367- // Shader limits.
2368- if ( glConfig2.uniformBufferObjectAvailable )
2369- {
2370- glGetIntegerv ( GL_MAX_UNIFORM_BLOCK_SIZE, &glConfig2.maxUniformBlockSize );
2371- }
2372-
23732357 // made required in OpenGL 3.0
23742358 glConfig2.mapBufferRangeAvailable = LOAD_EXTENSION_WITH_TEST ( ExtFlag_CORE, ARB_map_buffer_range, r_arb_map_buffer_range.Get () );
23752359
@@ -2602,6 +2586,24 @@ static void GLimp_InitExtensions()
26022586 }
26032587#endif
26042588
2589+ // Shader limits.
2590+
2591+ // From GL_ARB_vertex_shader.
2592+ glGetIntegerv ( GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &glConfig2.maxVertexUniforms );
2593+
2594+ // From GL_ARB_vertex_program.
2595+ glGetIntegerv ( GL_MAX_VERTEX_ATTRIBS_ARB, &glConfig2.maxVertexAttribs );
2596+
2597+ // From GL_ARB_uniform_buffer_object.
2598+ if ( glConfig2.uniformBufferObjectAvailable )
2599+ {
2600+ glGetIntegerv ( GL_MAX_UNIFORM_BLOCK_SIZE, &glConfig2.maxUniformBlockSize );
2601+ }
2602+
2603+ int reservedComponents = 36 * 10 ; // approximation how many uniforms we have besides the bone matrices
2604+ glConfig2.maxVertexSkinningBones = Math::Clamp ( ( glConfig2.maxVertexUniforms - reservedComponents ) / 16 , 0 , MAX_BONES );
2605+ glConfig2.vboVertexSkinningAvailable = r_vboVertexSkinning->integer && ( ( glConfig2.maxVertexSkinningBones >= 12 ) ? true : false );
2606+
26052607 GL_CheckErrors ();
26062608}
26072609
0 commit comments