]> git.cworth.org Git - fips/commit
Fix to print metrics for operations with no per-stage cycle counts
authorCarl Worth <cworth@cworth.org>
Thu, 31 Oct 2013 22:35:39 +0000 (15:35 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 31 Oct 2013 22:35:39 +0000 (15:35 -0700)
commite158c5bc10001bb9c6bd8c5e6e2ace6ac0f328c3
tree0b1a84b997f6684626283a1ab8e1bbb1183c616c
parentc60ce62ccb73402852eb4537dc435b6334a1538b
Fix to print metrics for operations with no per-stage cycle counts

Operations like glTexImage* get a valid time from the timer query, but
get performance counter numbers of zero, (since the operation is
performed in a blit batch which cannot have performance-monitor
operations in it).

We had code in place to protect any divide-by-zero in this case, but
that case was mistakenly setting the resulting time to 0, so any
operations like this were not having their time reported.

To fix this, we can't compute any per-stage time, so we arbitrarily
use stage 0 as the place to store 100% of the time spent, but we
update this per-stage metric value to point to a NULL per-stage name
to avoid any lie in the report.
metrics.c