]> git.cworth.org Git - fips/blobdiff - metrics.c
Fix CPU load reported on initial frame.
[fips] / metrics.c
index e37618665d508cf67bd9614bae65665f229bccd0..36ef90bf1c86b661204745b83aced491e675ed84 100644 (file)
--- a/metrics.c
+++ b/metrics.c
@@ -144,6 +144,9 @@ metrics_create (metrics_info_t *info)
        /* Get the first frame timestamp started immediately. */
        glQueryCounter (metrics->swap_end_timestamp_id, GL_TIMESTAMP);
 
+       /* As well as the initial CPU time. */
+       clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &metrics->cpu_time_ts);
+
        return metrics;
 }
 
@@ -409,6 +412,7 @@ accumulate_program_metrics (metrics_t *metrics, metrics_op_t op,
        {                                                               \
                fprintf (stderr, "Unexpected end-of-buffer while "      \
                         "parsing results\n");                          \
+               value = 0.0;                                            \
                break;                                                  \
        }                                                               \
        (var) = *((typeof(var) *) p);                                   \