]> git.cworth.org Git - fips/commit
Fix to still print metrics when there are no per-stage cycle-count metrics
authorCarl Worth <cworth@cworth.org>
Sat, 2 Nov 2013 21:36:47 +0000 (14:36 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 4 Nov 2013 23:43:20 +0000 (15:43 -0800)
commit0fee0398ec378498675d0d4fd5c0ec04ef84961a
tree73e8e7c188277183a8df152f322b384564b1c9a0
parent1063166ac2d706f8bbd325ecfd0580a0d1b04b21
Fix to still print metrics when there are no per-stage cycle-count metrics

There are at least two cases where fips will have no per-stage cycle counts:

1. The AMD_performance_monitor extension is not available

2. The extension is there, but fips cannot find any per-stage
   cycle counters

In either case, the previous code would print no timing
information. The problem is that fips was using the number of detected
per-stage cycle counters (in num_shader_stages) as the basis for
allocation of the results array. So with this value being 0, nothing
was allocated, nothing was stored, and nothing was printed.

Here, we fix this by instead allocating space for one result per
operation, and ensuring that ll of the measured time is reported for
that operation.
metrics.c