From 5c2ab150b3413bd59128b4d80c3581a38680a181 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 5 Sep 2024 01:47:14 +0300 Subject: [PATCH] ref: gl: move forcing gl_vbo to 0 after checking GL extensions out from R_GenerateVBO --- ref/gl/gl_opengl.c | 6 ++++-- ref/gl/gl_rsurf.c | 9 +-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 156b52e3..b6e0589b 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -742,10 +742,8 @@ static void R_RenderInfo_f( void ) gEngfuncs.Con_Printf( "GL4ES_VERSION: %s\n", version ); if( extensions ) gEngfuncs.Con_Reportf( "GL4ES_EXTENSIONS: %s\n", extensions ); - } - gEngfuncs.Con_Printf( "GL_MAX_TEXTURE_SIZE: %i\n", glConfig.max_2d_texture_size ); if( GL_Support( GL_ARB_MULTITEXTURE )) @@ -1150,6 +1148,10 @@ void GL_InitExtensions( void ) gEngfuncs.Cvar_SetValue( "gl_finish", 1 ); #endif + // we do not want to write vbo code that does not use multitexture + if( !GL_Support( GL_ARB_VERTEX_BUFFER_OBJECT_EXT ) || !GL_Support( GL_ARB_MULTITEXTURE ) || glConfig.max_texture_units < 2 ) + gEngfuncs.Cvar_FullSet( "gl_vbo", "0", FCVAR_READ_ONLY ); + R_RenderInfo_f(); tr.framecount = tr.visframecount = 1; diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index f21ce00b..17e5f67d 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -1859,13 +1859,6 @@ void R_GenerateVBO( void ) R_ClearVBO(); - // we do not want to write vbo code that does not use multitexture - if( !GL_Support( GL_ARB_VERTEX_BUFFER_OBJECT_EXT ) || !GL_Support( GL_ARB_MULTITEXTURE ) || glConfig.max_texture_units < 2 ) - { - gEngfuncs.Cvar_FullSet( "gl_vbo", "0", FCVAR_READ_ONLY ); - return; - } - t1 = gEngfuncs.pfnTime(); // save in config if enabled manually @@ -3028,7 +3021,7 @@ void R_DrawVBO( qboolean drawlightmap, qboolean drawtextures ) R_SetupVBOArrayStatic( vbo, drawlightmap, drawtextures ); mtst.skiptexture = !drawtextures; - mtst.tmu_dt = glConfig.max_texture_units > 2 && r_vbo_detail.value == 2? XASH_TEXTURE2:-1; + mtst.tmu_dt = glConfig.max_texture_units > 2 && r_vbo_detail.value == 2 ? XASH_TEXTURE2 : -1; // setup limits if( vbos.minlightmap > vbos.minarraysplit_lm )