Browse Source

gl2shim: Allow drawing huge QUADS sequences by splitting drawcalls on overflow

pull/2/head
mittorn 9 months ago committed by Alibek Omarov
parent
commit
ddf3f2ffdb
  1. 10
      ref/gl/gl2_shim/gl2_shim.c

10
ref/gl/gl2_shim/gl2_shim.c

@ -1065,7 +1065,15 @@ static void APIENTRY GL2_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) @@ -1065,7 +1065,15 @@ static void APIENTRY GL2_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
}
++gl2wrap.end;
if( gl2wrap.end - gl2wrap.begin >= MAX_BEGINEND_VERTS )
if( gl2wrap.prim == GL_QUADS )
{
if( !( ( gl2wrap.end - gl2wrap.begin ) % 4 ) && gl2wrap.end > ( GL2_MAX_VERTS - 4 ) )
{
GL2_FlushPrims();
GL2_Begin( GL_QUADS );
}
}
else if( gl2wrap.end - gl2wrap.begin >= MAX_BEGINEND_VERTS )
{
GLenum prim = gl2wrap.prim;
gEngfuncs.Con_DPrintf( S_ERROR "GL2_Vertex3f: Vertex buffer overflow!\n" );

Loading…
Cancel
Save