remove unused statistic variables

This commit is contained in:
Garux 2020-01-13 00:39:55 +03:00
parent a626907ba9
commit 5dc0244ef9
6 changed files with 0 additions and 90 deletions

View File

@ -29,15 +29,6 @@
#include "qfiles.h" #include "qfiles.h"
extern int numthreads;
// counters are only bumped when running single threaded,
// because they are an awefull coherence problem
int c_active_windings;
int c_peak_windings;
int c_winding_allocs;
int c_winding_points;
#define BOGUS_RANGE WORLD_SIZE #define BOGUS_RANGE WORLD_SIZE
void pw( winding_t *w ){ void pw( winding_t *w ){
@ -56,15 +47,6 @@ winding_t *AllocWinding( int points ){
if ( points >= MAX_POINTS_ON_WINDING ) { if ( points >= MAX_POINTS_ON_WINDING ) {
Error( "AllocWinding failed: MAX_POINTS_ON_WINDING exceeded" ); Error( "AllocWinding failed: MAX_POINTS_ON_WINDING exceeded" );
} }
if ( numthreads == 1 ) {
c_winding_allocs++;
c_winding_points += points;
c_active_windings++;
if ( c_active_windings > c_peak_windings ) {
c_peak_windings = c_active_windings;
}
}
return safe_calloc( offsetof( winding_t, p[points] ) ); return safe_calloc( offsetof( winding_t, p[points] ) );
} }
@ -77,16 +59,6 @@ winding_accu_t *AllocWindingAccu( int points ){
if ( points >= MAX_POINTS_ON_WINDING ) { if ( points >= MAX_POINTS_ON_WINDING ) {
Error( "AllocWindingAccu failed: MAX_POINTS_ON_WINDING exceeded" ); Error( "AllocWindingAccu failed: MAX_POINTS_ON_WINDING exceeded" );
} }
if ( numthreads == 1 ) {
// At the time of this writing, these statistics were not used in any way.
c_winding_allocs++;
c_winding_points += points;
c_active_windings++;
if ( c_active_windings > c_peak_windings ) {
c_peak_windings = c_active_windings;
}
}
return safe_calloc( offsetof( winding_accu_t, p[points] ) ); return safe_calloc( offsetof( winding_accu_t, p[points] ) );
} }
@ -105,9 +77,6 @@ void FreeWinding( winding_t *w ){
} }
*(unsigned *)w = 0xdeaddead; *(unsigned *)w = 0xdeaddead;
if ( numthreads == 1 ) {
c_active_windings--;
}
free( w ); free( w );
} }
@ -126,9 +95,6 @@ void FreeWindingAccu( winding_accu_t *w ){
} }
*( (unsigned *) w ) = 0xdeaddead; *( (unsigned *) w ) = 0xdeaddead;
if ( numthreads == 1 ) {
c_active_windings--;
}
free( w ); free( w );
} }
@ -137,8 +103,6 @@ void FreeWindingAccu( winding_accu_t *w ){
RemoveColinearPoints RemoveColinearPoints
============ ============
*/ */
int c_removed;
void RemoveColinearPoints( winding_t *w ){ void RemoveColinearPoints( winding_t *w ){
int i, j, k; int i, j, k;
vec3_t v1, v2; vec3_t v1, v2;
@ -164,9 +128,6 @@ void RemoveColinearPoints( winding_t *w ){
return; return;
} }
if ( numthreads == 1 ) {
c_removed += w->numpoints - nump;
}
w->numpoints = nump; w->numpoints = nump;
memcpy( w->p, p, nump * sizeof( p[0] ) ); memcpy( w->p, p, nump * sizeof( p[0] ) );
} }

View File

@ -90,9 +90,6 @@ int CountBrushList( brush_t *brushes ){
*/ */
brush_t *AllocBrush( int numSides ){ brush_t *AllocBrush( int numSides ){
if ( numthreads == 1 ) {
numActiveBrushes++;
}
return safe_calloc( offsetof( brush_t, sides[numSides] ) ); return safe_calloc( offsetof( brush_t, sides[numSides] ) );
} }
@ -125,9 +122,6 @@ void FreeBrush( brush_t *b ){
/* free it */ /* free it */
free( b ); free( b );
if ( numthreads == 1 ) {
numActiveBrushes--;
}
} }

View File

@ -36,15 +36,9 @@ int allocatedSurfsOnShader;
int allocated[ LIGHTMAP_WIDTH ]; int allocated[ LIGHTMAP_WIDTH ];
int numLightmaps = 1;
int c_exactLightmap = 0;
int c_planarPatch = 0;
int c_nonplanarLightmap = 0;
void PrepareNewLightmap( void ) { void PrepareNewLightmap( void ) {
memset( allocated, 0, sizeof( allocated ) ); memset( allocated, 0, sizeof( allocated ) );
numLightmaps++;
} }
/* /*

View File

@ -42,24 +42,12 @@
extern qboolean FixWinding( winding_t *w ); extern qboolean FixWinding( winding_t *w );
int c_active_portals;
int c_peak_portals;
int c_boundary;
int c_boundary_sides;
/* /*
=========== ===========
AllocPortal AllocPortal
=========== ===========
*/ */
portal_t *AllocPortal( void ){ portal_t *AllocPortal( void ){
if ( numthreads == 1 ) {
c_active_portals++;
}
if ( c_active_portals > c_peak_portals ) {
c_peak_portals = c_active_portals;
}
return safe_calloc( sizeof( portal_t ) ); return safe_calloc( sizeof( portal_t ) );
} }
@ -67,9 +55,6 @@ void FreePortal( portal_t *p ){
if ( p->winding ) { if ( p->winding ) {
FreeWinding( p->winding ); FreeWinding( p->winding );
} }
if ( numthreads == 1 ) {
c_active_portals--;
}
free( p ); free( p );
} }

View File

@ -2131,7 +2131,6 @@ Q_EXTERN fog_t mapFogs[ MAX_MAP_FOGS ];
Q_EXTERN entity_t *mapEnt; Q_EXTERN entity_t *mapEnt;
Q_EXTERN brush_t *buildBrush; Q_EXTERN brush_t *buildBrush;
Q_EXTERN int numActiveBrushes;
Q_EXTERN brushType_t g_brushType; Q_EXTERN brushType_t g_brushType;
Q_EXTERN int numStrippedLights Q_ASSIGN( 0 ); Q_EXTERN int numStrippedLights Q_ASSIGN( 0 );
@ -2212,9 +2211,6 @@ Q_EXTERN leaf_t *faceleafs;
Q_EXTERN int numfaces; Q_EXTERN int numfaces;
Q_EXTERN int c_portaltest, c_portalpass, c_portalcheck;
Q_EXTERN int c_chains;
Q_EXTERN byte *vismap, *vismap_p, *vismap_end; Q_EXTERN byte *vismap, *vismap_p, *vismap_end;
Q_EXTERN int testlevel; Q_EXTERN int testlevel;
@ -2384,9 +2380,6 @@ Q_EXTERN int totalTraces;
Q_EXTERN FILE *dumpFile; Q_EXTERN FILE *dumpFile;
Q_EXTERN int c_visible, c_occluded;
Q_EXTERN int c_subsampled; /* ydnar */
Q_EXTERN int defaultLightSubdivide Q_ASSIGN( 999 ); Q_EXTERN int defaultLightSubdivide Q_ASSIGN( 999 );
Q_EXTERN vec3_t ambientColor; Q_EXTERN vec3_t ambientColor;
@ -2399,11 +2392,6 @@ Q_EXTERN vec3_t *surfaceOrigin;
Q_EXTERN vec3_t sunDirection; Q_EXTERN vec3_t sunDirection;
Q_EXTERN vec3_t sunLight; Q_EXTERN vec3_t sunLight;
/* tracing */
Q_EXTERN int c_totalTrace;
Q_EXTERN int c_cullTrace, c_testTrace;
Q_EXTERN int c_testFacets;
/* ydnar: light optimization */ /* ydnar: light optimization */
Q_EXTERN float subdivideThreshold Q_ASSIGN( DEFAULT_SUBDIVIDE_THRESHOLD ); Q_EXTERN float subdivideThreshold Q_ASSIGN( DEFAULT_SUBDIVIDE_THRESHOLD );

View File

@ -71,11 +71,6 @@ int CountBits( byte *bits, int numbits ){
return c; return c;
} }
int c_fullskip;
int c_chop, c_nochop;
int active;
void CheckStack( leaf_t *leaf, threaddata_t *thread ){ void CheckStack( leaf_t *leaf, threaddata_t *thread ){
pstack_t *p, *p2; pstack_t *p, *p2;
@ -508,8 +503,6 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
VectorSubtract( vec3_origin, p->plane.normal, backplane.normal ); VectorSubtract( vec3_origin, p->plane.normal, backplane.normal );
backplane.dist = -p->plane.dist; backplane.dist = -p->plane.dist;
// c_portalcheck++;
stack.portal = p; stack.portal = p;
stack.next = NULL; stack.next = NULL;
stack.freewindings[0] = 1; stack.freewindings[0] = 1;
@ -899,8 +892,6 @@ void RecursivePassagePortalFlow( vportal_t *portal, threaddata_t *thread, pstack
VectorSubtract( vec3_origin, p->plane.normal, backplane.normal ); VectorSubtract( vec3_origin, p->plane.normal, backplane.normal );
backplane.dist = -p->plane.dist; backplane.dist = -p->plane.dist;
// c_portalcheck++;
stack.portal = p; stack.portal = p;
stack.next = NULL; stack.next = NULL;
stack.freewindings[0] = 1; stack.freewindings[0] = 1;
@ -1525,7 +1516,6 @@ void PassageMemory( void ){
=============================================================================== ===============================================================================
*/ */
int c_flood, c_vis;
/* /*
@ -1668,7 +1658,6 @@ void BasePortalVis( int portalnum ){
p->nummightsee = CountBits( p->portalflood, numportals * 2 ); p->nummightsee = CountBits( p->portalflood, numportals * 2 );
// Sys_Printf ("portal %i: %i mightsee\n", portalnum, p->nummightsee); // Sys_Printf ("portal %i: %i mightsee\n", portalnum, p->nummightsee);
c_flood += p->nummightsee;
} }
@ -1754,5 +1743,4 @@ void BetterPortalVis( int portalnum ){
// build leaf vis information // build leaf vis information
p->nummightsee = CountBits( p->portalvis, numportals * 2 ); p->nummightsee = CountBits( p->portalvis, numportals * 2 );
c_vis += p->nummightsee;
} }