Skip to content

Commit 8cc5260

Browse files
committed
Fix backEnd.currentVAO
This was previously getting reset in `R_Init()`, so it was always 0 after a map was loaded. This also meant that the call to `glDeleteVertexArrays()` in `RE_Shutdown()` was silently erroring out if a map was loaded (or `vid_restart` used).
1 parent d6a5813 commit 8cc5260

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/engine/renderer/tr_init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
341341
return false;
342342
}
343343

344-
if( glConfig2.glCoreProfile ) {
345-
glGenVertexArrays( 1, &backEnd.currentVAO );
346-
glBindVertexArray( backEnd.currentVAO );
347-
}
348-
349344
glState.tileStep[ 0 ] = TILE_SIZE * ( 1.0f / glConfig.vidWidth );
350345
glState.tileStep[ 1 ] = TILE_SIZE * ( 1.0f / glConfig.vidHeight );
351346

@@ -381,6 +376,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
381376
GLSL_InitGPUShaders();
382377
}
383378

379+
if ( glConfig2.glCoreProfile ) {
380+
glGenVertexArrays( 1, &backEnd.currentVAO );
381+
glBindVertexArray( backEnd.currentVAO );
382+
}
383+
384384
GL_CheckErrors();
385385

386386
// set default state

0 commit comments

Comments
 (0)