OpenGL2: Ensure tess VAO is bound before using it.

This commit is contained in:
SmileTheory 2014-11-21 16:12:53 -08:00
parent c787cf3aef
commit fd23249357

View file

@ -91,6 +91,8 @@ void RB_AddQuadStampExt( vec3_t origin, vec3_t left, vec3_t up, float color[4],
uint32_t pNormal;
int ndx;
RB_CheckVao(tess.vao);
RB_CHECKOVERFLOW( 4, 6 );
ndx = tess.numVertexes;
@ -283,6 +285,8 @@ static void RB_SurfacePolychain( srfPoly_t *p ) {
int i;
int numv;
RB_CheckVao(tess.vao);
RB_CHECKOVERFLOW( p->numVerts, 3*(p->numVerts - 2) );
// fan triangles into the tess array
@ -626,6 +630,8 @@ static void DoRailCore( const vec3_t start, const vec3_t end, const vec3_t up, f
int vbase;
float t = len / 256.0f;
RB_CheckVao(tess.vao);
RB_CHECKOVERFLOW( 4, 6 );
vbase = tess.numVertexes;
@ -707,6 +713,8 @@ static void DoRailDiscs( int numSegs, const vec3_t start, const vec3_t dir, cons
}
}
RB_CheckVao(tess.vao);
for ( i = 0; i < numSegs; i++ )
{
int j;
@ -1218,6 +1226,8 @@ static void RB_SurfaceMesh(mdvSurface_t *surface) {
backlerp = backEnd.currentEntity->e.backlerp;
}
RB_CheckVao(tess.vao);
RB_CHECKOVERFLOW( surface->numVerts, surface->numIndexes );
LerpMeshVertexes (surface, backlerp);
@ -1325,6 +1335,8 @@ static void RB_SurfaceGrid( srfBspSurface_t *srf ) {
return;
}
RB_CheckVao(tess.vao);
dlightBits = srf->dlightBits;
tess.dlightBits |= dlightBits;