summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_surface.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2014-11-21 16:12:53 -0800
committerTim Angus <tim@ngus.net>2015-03-17 11:39:01 +0000
commit105e02d9b6c0a07ccb25d6f310115e136c83e3ce (patch)
tree04156e74e84ad1f35a8e461d32e0f26a4854ab92 /src/renderergl2/tr_surface.c
parente07d7fbadb149ec00d88c7a3b814287467320163 (diff)
OpenGL2: Ensure tess VAO is bound before using it.
Diffstat (limited to 'src/renderergl2/tr_surface.c')
-rw-r--r--src/renderergl2/tr_surface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/renderergl2/tr_surface.c b/src/renderergl2/tr_surface.c
index 67b0cce7..e6146eef 100644
--- a/src/renderergl2/tr_surface.c
+++ b/src/renderergl2/tr_surface.c
@@ -92,6 +92,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;
@@ -284,6 +286,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
@@ -627,6 +631,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;
@@ -708,6 +714,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;
@@ -1219,6 +1227,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);
@@ -1326,6 +1336,8 @@ static void RB_SurfaceGrid( srfBspSurface_t *srf ) {
return;
}
+ RB_CheckVao(tess.vao);
+
dlightBits = srf->dlightBits;
tess.dlightBits |= dlightBits;