/* ===================== R_PerformanceCounters ===================== */ void R_PerformanceCounters( void ) { #ifndef _XBOX if ( !r_speeds->integer ) { // clear the counters even if we aren't printing memset( &tr.pc, 0, sizeof( tr.pc ) ); memset( &backEnd.pc, 0, sizeof( backEnd.pc ) ); return; } if (r_speeds->integer == 1) { const float texSize = R_SumOfUsedImages( qfalse )/(8*1048576.0f)*(r_texturebits->integer?r_texturebits->integer:glConfig.colorBits); VID_Printf (PRINT_ALL, "%i/%i shdrs/srfs %i leafs %i vrts %i/%i tris %.2fMB tex %.2f dc\n", backEnd.pc.c_shaders, backEnd.pc.c_surfaces, tr.pc.c_leafs, backEnd.pc.c_vertexes, backEnd.pc.c_indexes/3, backEnd.pc.c_totalIndexes/3, texSize, backEnd.pc.c_overDraw / (float)(glConfig.vidWidth * glConfig.vidHeight) ); } else if (r_speeds->integer == 2) { VID_Printf (PRINT_ALL, "(patch) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_patch_in, tr.pc.c_sphere_cull_patch_clip, tr.pc.c_sphere_cull_patch_out, tr.pc.c_box_cull_patch_in, tr.pc.c_box_cull_patch_clip, tr.pc.c_box_cull_patch_out ); VID_Printf (PRINT_ALL, "(md3) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_md3_in, tr.pc.c_sphere_cull_md3_clip, tr.pc.c_sphere_cull_md3_out, tr.pc.c_box_cull_md3_in, tr.pc.c_box_cull_md3_clip, tr.pc.c_box_cull_md3_out ); } else if (r_speeds->integer == 3) { VID_Printf (PRINT_ALL, "viewcluster: %i\n", tr.viewCluster ); } else if (r_speeds->integer == 4) { if ( backEnd.pc.c_dlightVertexes ) { VID_Printf (PRINT_ALL, "dlight srf:%i culled:%i verts:%i tris:%i\n", tr.pc.c_dlightSurfaces, tr.pc.c_dlightSurfacesCulled, backEnd.pc.c_dlightVertexes, backEnd.pc.c_dlightIndexes / 3 ); } } else if (r_speeds->integer == 5 ) { VID_Printf( PRINT_ALL, "zFar: %.0f\n", tr.viewParms.zFar ); } else if (r_speeds->integer == 6 ) { VID_Printf( PRINT_ALL, "flare adds:%i tests:%i renders:%i\n", backEnd.pc.c_flareAdds, backEnd.pc.c_flareTests, backEnd.pc.c_flareRenders ); } else if (r_speeds->integer == 7) { const float texSize = R_SumOfUsedImages(qtrue) / (1048576.0f); const float backBuff= glConfig.vidWidth * glConfig.vidHeight * glConfig.colorBits / (8.0f * 1024*1024); const float depthBuff= glConfig.vidWidth * glConfig.vidHeight * glConfig.depthBits / (8.0f * 1024*1024); const float stencilBuff= glConfig.vidWidth * glConfig.vidHeight * glConfig.stencilBits / (8.0f * 1024*1024); VID_Printf (PRINT_ALL, "Tex MB %.2f + buffers %.2f MB = Total %.2fMB\n", texSize, backBuff*2+depthBuff+stencilBuff, texSize+backBuff*2+depthBuff+stencilBuff); } #endif memset( &tr.pc, 0, sizeof( tr.pc ) ); memset( &backEnd.pc, 0, sizeof( backEnd.pc ) ); }
/* ===================== R_PerformanceCounters ===================== */ void R_PerformanceCounters(void) { if (!r_speeds->integer) { // clear the counters even if we aren't printing memset(&tr.pc, 0, sizeof(tr.pc)); memset(&backEnd.pc, 0, sizeof(backEnd.pc)); return; } if (r_speeds->integer == 1) { ri.Printf(PRINT_ALL, "%i/%i/%i shaders/batches/surfs %i leafs %i verts %i/%i tris %.2f mtex %.2f dc\n", backEnd.pc.c_shaders, backEnd.pc.c_surfBatches, backEnd.pc.c_surfaces, tr.pc.c_leafs, backEnd.pc.c_vertexes, backEnd.pc.c_indexes / 3, backEnd.pc.c_totalIndexes / 3, R_SumOfUsedImages() / (1000000.0f), backEnd.pc.c_overDraw / (float)(glConfig.vidWidth * glConfig.vidHeight)); } else if (r_speeds->integer == 2) { ri.Printf(PRINT_ALL, "(patch) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_patch_in, tr.pc.c_sphere_cull_patch_clip, tr.pc.c_sphere_cull_patch_out, tr.pc.c_box_cull_patch_in, tr.pc.c_box_cull_patch_clip, tr.pc.c_box_cull_patch_out); ri.Printf(PRINT_ALL, "(md3) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_md3_in, tr.pc.c_sphere_cull_md3_clip, tr.pc.c_sphere_cull_md3_out, tr.pc.c_box_cull_md3_in, tr.pc.c_box_cull_md3_clip, tr.pc.c_box_cull_md3_out); } else if (r_speeds->integer == 3) { ri.Printf(PRINT_ALL, "viewcluster: %i\n", tr.viewCluster); } else if (r_speeds->integer == 4) { if (backEnd.pc.c_dlightVertexes) { ri.Printf(PRINT_ALL, "dlight srf:%i culled:%i verts:%i tris:%i\n", tr.pc.c_dlightSurfaces, tr.pc.c_dlightSurfacesCulled, backEnd.pc.c_dlightVertexes, backEnd.pc.c_dlightIndexes / 3); } } //----(SA) this is unnecessary since it will always show 2048. I moved this to where it is accurate for the world // else if (r_speeds->integer == 5 ) // { // ri.Printf( PRINT_ALL, "zFar: %.0f\n", tr.viewParms.zFar ); // } else if (r_speeds->integer == 6) { ri.Printf(PRINT_ALL, "flare adds:%i tests:%i renders:%i\n", backEnd.pc.c_flareAdds, backEnd.pc.c_flareTests, backEnd.pc.c_flareRenders); } else if (r_speeds->integer == 7) { ri.Printf(PRINT_ALL, "VBO draws: static %i dynamic %i\nMultidraws: %i merged %i\n", backEnd.pc.c_staticVboDraws, backEnd.pc.c_dynamicVboDraws, backEnd.pc.c_multidraws, backEnd.pc.c_multidrawsMerged); ri.Printf(PRINT_ALL, "GLSL binds: %i draws: gen %i light %i fog %i dlight %i\n", backEnd.pc.c_glslShaderBinds, backEnd.pc.c_genericDraws, backEnd.pc.c_lightallDraws, backEnd.pc.c_fogDraws, backEnd.pc.c_dlightDraws); } memset(&tr.pc, 0, sizeof(tr.pc)); memset(&backEnd.pc, 0, sizeof(backEnd.pc)); }
/* ===================== R_PerformanceCounters ===================== */ void R_PerformanceCounters( void ) { if ( !r_speeds->integer ) { // clear the counters even if we aren't printing memset( &tr.pc, 0, sizeof( tr.pc ) ); memset( &backEnd.pc, 0, sizeof( backEnd.pc ) ); return; } if ( r_speeds->integer ) { //% == 1) ri.Printf( PRINT_ALL, "%i/%i shaders/surfs %i leafs %i verts %i/%i tris %.2f mtex %.2f dc\n", backEnd.pc.c_shaders, backEnd.pc.c_surfaces, tr.pc.c_leafs, backEnd.pc.c_vertexes, backEnd.pc.c_indexes / 3, backEnd.pc.c_totalIndexes / 3, R_SumOfUsedImages() / ( 1000000.0f ), backEnd.pc.c_overDraw / ( float )( glConfig.vidWidth * glConfig.vidHeight ) ); } if ( r_speeds->integer == 2 ) { ri.Printf( PRINT_ALL, "(patch) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_patch_in, tr.pc.c_sphere_cull_patch_clip, tr.pc.c_sphere_cull_patch_out, tr.pc.c_box_cull_patch_in, tr.pc.c_box_cull_patch_clip, tr.pc.c_box_cull_patch_out ); ri.Printf( PRINT_ALL, "(md3) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_md3_in, tr.pc.c_sphere_cull_md3_clip, tr.pc.c_sphere_cull_md3_out, tr.pc.c_box_cull_md3_in, tr.pc.c_box_cull_md3_clip, tr.pc.c_box_cull_md3_out ); ri.Printf( PRINT_ALL, "(gen) %i sin %i sout %i pin %i pout\n", tr.pc.c_sphere_cull_in, tr.pc.c_sphere_cull_out, tr.pc.c_plane_cull_in, tr.pc.c_plane_cull_out ); } else if ( r_speeds->integer == 3 ) { ri.Printf( PRINT_ALL, "viewcluster: %i\n", tr.viewCluster ); } else if ( r_speeds->integer == 4 ) { ri.Printf( PRINT_ALL, "dlight srf:%i culled:%i verts:%i tris:%i\n", tr.pc.c_dlightSurfaces, tr.pc.c_dlightSurfacesCulled, backEnd.pc.c_dlightVertexes, backEnd.pc.c_dlightIndexes / 3 ); } else if ( r_speeds->integer == 6 ) { ri.Printf( PRINT_ALL, "flare adds:%i tests:%i renders:%i\n", backEnd.pc.c_flareAdds, backEnd.pc.c_flareTests, backEnd.pc.c_flareRenders ); } else if ( r_speeds->integer == 7 ) { ri.Printf( PRINT_ALL, "decal projectors: %d test surfs: %d clip surfs: %d decal surfs: %d created: %d\n", tr.pc.c_decalProjectors, tr.pc.c_decalTestSurfaces, tr.pc.c_decalClipSurfaces, tr.pc.c_decalSurfaces, tr.pc.c_decalSurfacesCreated ); } memset( &tr.pc, 0, sizeof( tr.pc ) ); memset( &backEnd.pc, 0, sizeof( backEnd.pc ) ); }
/* * R_PerformanceCounters */ void R_PerformanceCounters(void) { if(!r_speeds->integer){ /* clear the counters even if we aren't printing */ Q_Memset(&tr.pc, 0, sizeof(tr.pc)); Q_Memset(&backEnd.pc, 0, sizeof(backEnd.pc)); return; } if(r_speeds->integer == 1){ ri.Printf (PRINT_ALL, "%i/%i shaders/surfs %i leafs %i verts %i/%i tris %.2f mtex %.2f dc\n", backEnd.pc.c_shaders, backEnd.pc.c_surfaces, tr.pc.c_leafs, backEnd.pc.c_vertexes, backEnd.pc.c_indexes/3, backEnd.pc.c_totalIndexes/3, R_SumOfUsedImages()/(1000000.0f), backEnd.pc.c_overDraw / (float)(glConfig.vidWidth * glConfig.vidHeight)); }else if(r_speeds->integer == 2){ ri.Printf (PRINT_ALL, "(patch) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_patch_in, tr.pc.c_sphere_cull_patch_clip, tr.pc.c_sphere_cull_patch_out, tr.pc.c_box_cull_patch_in, tr.pc.c_box_cull_patch_clip, tr.pc.c_box_cull_patch_out); ri.Printf (PRINT_ALL, "(md3) %i sin %i sclip %i sout %i bin %i bclip %i bout\n", tr.pc.c_sphere_cull_md3_in, tr.pc.c_sphere_cull_md3_clip, tr.pc.c_sphere_cull_md3_out, tr.pc.c_box_cull_md3_in, tr.pc.c_box_cull_md3_clip, tr.pc.c_box_cull_md3_out); }else if(r_speeds->integer == 3){ ri.Printf (PRINT_ALL, "viewcluster: %i\n", tr.viewCluster); }else if(r_speeds->integer == 4){ if(backEnd.pc.c_dlightVertexes){ ri.Printf (PRINT_ALL, "dlight srf:%i culled:%i verts:%i tris:%i\n", tr.pc.c_dlightSurfaces, tr.pc.c_dlightSurfacesCulled, backEnd.pc.c_dlightVertexes, backEnd.pc.c_dlightIndexes / 3); } }else if(r_speeds->integer == 5){ ri.Printf(PRINT_ALL, "zFar: %.0f\n", tr.viewParms.zFar); }else if(r_speeds->integer == 6){ ri.Printf(PRINT_ALL, "flare adds:%i tests:%i renders:%i\n", backEnd.pc.c_flareAdds, backEnd.pc.c_flareTests, backEnd.pc.c_flareRenders); } Q_Memset(&tr.pc, 0, sizeof(tr.pc)); Q_Memset(&backEnd.pc, 0, sizeof(backEnd.pc)); }