From: havoc Date: Sun, 2 Dec 2007 09:59:49 +0000 (+0000) Subject: r_speeds now shows number of lightmap updates (and pixels) each frame X-Git-Tag: xonotic-v0.1.0preview~2739 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bdcafed0111d7720dc1422ca39d8cbc49c9e0db4;p=xonotic%2Fdarkplaces.git r_speeds now shows number of lightmap updates (and pixels) each frame git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7745 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 454e3e1f..71f198fc 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -709,7 +709,8 @@ void R_TimeReport_Frame(void) sprintf(r_speeds_string + strlen(r_speeds_string), "Location: %s\n", loc->name); sprintf(r_speeds_string + strlen(r_speeds_string), "org:'%+8.2f %+8.2f %+8.2f' dir:'%+2.3f %+2.3f %+2.3f'\n", r_view.origin[0], r_view.origin[1], r_view.origin[2], r_view.forward[0], r_view.forward[1], r_view.forward[2]); sprintf(r_speeds_string + strlen(r_speeds_string), "%7i surfaces%7i triangles %5i entities (%7i surfaces%7i triangles)\n", r_refdef.stats.world_surfaces, r_refdef.stats.world_triangles, r_refdef.stats.entities, r_refdef.stats.entities_surfaces, r_refdef.stats.entities_triangles); - sprintf(r_speeds_string + strlen(r_speeds_string), "%5ileafs%5i portals%6i particles%6i decals\n", r_refdef.stats.world_leafs, r_refdef.stats.world_portals, r_refdef.stats.particles, r_refdef.stats.decals); + sprintf(r_speeds_string + strlen(r_speeds_string), "%5i leafs%5i portals%6i particles%6i decals\n", r_refdef.stats.world_leafs, r_refdef.stats.world_portals, r_refdef.stats.particles, r_refdef.stats.decals); + sprintf(r_speeds_string + strlen(r_speeds_string), "%7i lightmap updates (%7i pixels)\n", r_refdef.stats.lightmapupdates, r_refdef.stats.lightmapupdatepixels); sprintf(r_speeds_string + strlen(r_speeds_string), "%4i lights%4i clears%4i scissored%7i light%7i shadow%7i dynamic\n", r_refdef.stats.lights, r_refdef.stats.lights_clears, r_refdef.stats.lights_scissored, r_refdef.stats.lights_lighttriangles, r_refdef.stats.lights_shadowtriangles, r_refdef.stats.lights_dynamicshadowtriangles); if (r_refdef.stats.bloom) sprintf(r_speeds_string + strlen(r_speeds_string), "rendered%6i meshes%8i triangles bloompixels%8i copied%8i drawn\n", r_refdef.stats.meshes, r_refdef.stats.meshes_elements / 3, r_refdef.stats.bloom_copypixels, r_refdef.stats.bloom_drawpixels); diff --git a/client.h b/client.h index 5ffc87a9..8fe6d94a 100644 --- a/client.h +++ b/client.h @@ -1328,6 +1328,8 @@ typedef struct r_refdef_stats_s int world_portals; int world_surfaces; int world_triangles; + int lightmapupdates; + int lightmapupdatepixels; int particles; int decals; int meshes; diff --git a/gl_rsurf.c b/gl_rsurf.c index 6e642ce0..b333d16f 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -52,6 +52,9 @@ void R_BuildLightMap (const entity_render_t *ent, msurface_t *surface) size = smax*tmax; size3 = size*3; + r_refdef.stats.lightmapupdatepixels += size; + r_refdef.stats.lightmapupdates++; + if (cl.buildlightmapmemorysize < size*sizeof(int[3])) { cl.buildlightmapmemorysize = size*sizeof(int[3]);