From 1d4d355b38aaa41118ad9a246b3cfa9b0aa8582b Mon Sep 17 00:00:00 2001 From: mittorn Date: Mon, 23 Oct 2023 20:14:08 +0300 Subject: [PATCH] ref_gl: vbo: fix binding garbade texture after changelevel, fix wpoly counter --- ref/gl/gl_rsurf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index f47b51ee..1ca42558 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -2964,6 +2964,7 @@ void R_ClearVBOState( qboolean drawlightmap, qboolean drawtextures ) vboarray.tstate = VBO_TEXTURE_NONE; vboarray.lstate = VBO_LIGHTMAP_NONE; vboarray.itexture = 0; + mtst.lm = 0; } @@ -3240,6 +3241,10 @@ qboolean R_AddSurfToVBO( msurface_t *surf, qboolean buildlightmap ) vbos.decaldata->lm[vbotex->lightmaptexturenum] = surf; } } + + // now this path does not draw wapred surfaces, so count it as one poly + r_stats.c_world_polys++; + return true; } return false;