X-Git-Url: https://git.cworth.org/git?p=fips;a=blobdiff_plain;f=metrics.c;h=004c3399522ce907533a73f0a75d297f895316a4;hp=6704572533a41b901fa93cf481d731c23f408707;hb=0fee0398ec378498675d0d4fd5c0ec04ef84961a;hpb=1063166ac2d706f8bbd325ecfd0580a0d1b04b21 diff --git a/metrics.c b/metrics.c index 6704572..004c339 100644 --- a/metrics.c +++ b/metrics.c @@ -579,7 +579,10 @@ print_program_metrics (metrics_t *metrics) /* Make a sorted list of the per-stage operations by time * used, and figure out the total so we can print percentages. */ - num_sorted = metrics->num_op_metrics * num_shader_stages; + if (num_shader_stages) + num_sorted = metrics->num_op_metrics * num_shader_stages; + else + num_sorted = metrics->num_op_metrics; sorted = xmalloc (sizeof (*sorted) * num_sorted); @@ -595,6 +598,14 @@ print_program_metrics (metrics_t *metrics) /* Also, find total cycles in all stages of this op. */ op_cycles = 0.0; + if (num_shader_stages == 0) { + per_stage = &sorted[i]; + per_stage->metrics = op; + per_stage->stage = NULL; + per_stage->time_ns = op->time_ns; + per_stage->active = 0.0; + } + for (j = 0; j < num_shader_stages; j++) { /* Active cycles */ group_index = info->stages[j].active_group_index;