source-engine-2018-hl2_src/devtools/bin/playback_numprims.pl
FluorescentCIAAfricanAmerican 3bf9df6b27 1
2020-04-22 12:56:21 -04:00

28 lines
456 B
Perl

if( scalar( @ARGV ) != 1 )
{
die "Usage: playback_numprims.pl frame.txt\n";
}
open INPUT, shift || die;
$numprims = 0;
$numcalls = 0;
while( <INPUT> )
{
if( /DrawIndexedPrimitive.*numPrimitives:\s*(\d+)\s*$/i )
{
$numprims += $1;
if( $1 > 85 )
{
$numfreeprims += $1;
}
else
{
$numfreeprims += 85;
}
$numcalls++;
}
}
close INPUT;
print "$numprims primitives\n";
print "$numfreeprims freeprimitives\n";
print "$numcalls calls\n";