ref: gl: psvita: fix long hang on shutdown

This commit is contained in:
fgsfds 2023-02-26 00:59:50 +01:00 committed by Alibek Omarov
parent 47a6be86b1
commit 76bff9cd4b
1 changed files with 3 additions and 9 deletions

View File

@ -335,7 +335,8 @@ void VGL_ShimShutdown( void )
if ( !vgl_init )
return;
glFinish();
// flush everything that has been rendered this frame to prevent waiting in glDeleteProgram
vglSwapBuffers( GL_FALSE );
glUseProgram( 0 );
for ( i = 0; i < MAX_PROGS; ++i )
@ -379,13 +380,6 @@ void VGL_End( void )
if ( !vgl.prim || !count )
goto _leave; // end without begin
if ( vgl.end > VGL_MAX_VERTS )
{
gEngfuncs.Con_Reportf( S_ERROR "VGL_End(): Ran out of vertex space (%d overhead)\n", vgl.end - VGL_MAX_VERTS );
vgl.end = 0;
goto _leave;
}
// enable alpha test and fog if needed
if ( alpha_test_state )
flags |= 1 << VGL_FLAG_ALPHA_TEST;
@ -425,7 +419,7 @@ void VGL_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
++vgl.end;
if ( vgl.end >= VGL_MAX_VERTS )
{
gEngfuncs.Con_Reportf( S_ERROR "VGL_Vertex3f(): Vertex buffer overflow!\n" );
gEngfuncs.Con_DPrintf( S_ERROR "VGL_Vertex3f(): Vertex buffer overflow!\n" );
vgl.end = vgl.begin = 0;
}
}