- Profile::CpuCall call;
- call.no = draw.no;
- call.name = draw.name;
- call.cpuStart = draw.cpuStart;
- call.cpuDuration = draw.cpuDuration;
- profile->cpuCalls.push_back(call);
+ profile->calls.push_back(call);
+
+ if (call.pixels >= 0) {
+ if (profile->programs.size() <= call.program) {
+ profile->programs.resize(call.program + 1);
+ }
+
+ Profile::Program& program = profile->programs[call.program];
+ program.cpuTotal += call.cpuDuration;
+ program.gpuTotal += call.gpuDuration;
+ program.pixelTotal += call.pixels;
+ program.vsizeTotal += call.vsizeDuration;
+ program.rssTotal += call.rssDuration;
+ program.calls.push_back(profile->calls.size() - 1);
+ }