+ cpuTimes = cpuTimes_;
+ gpuTimes = gpuTimes_;
+ pixelsDrawn = pixelsDrawn_;
+
+ std::cout << "# frame_begin no gpu_start cpu_start" << std::endl;
+ std::cout << "# frame_end no gpu_end gpu_dura cpu_end cpu_dura" << std::endl;
+ std::cout << "# call no gpu_start gpu_dura cpu_start cpu_dura pixels program name" << std::endl;
+}
+
+void Profiler::addCall(unsigned no,
+ const char *name,
+ unsigned program,
+ uint64_t pixels,
+ uint64_t gpuStart, uint64_t gpuDuration,
+ uint64_t cpuStart, uint64_t cpuDuration)
+{
+ if (baseGpuTime == 0) {
+ baseGpuTime = gpuStart;
+ }
+
+ if (baseCpuTime == 0) {
+ baseCpuTime = cpuStart;
+ }
+
+ if (gpuTimes) {
+ gpuStart -= baseGpuTime;
+ } else {
+ gpuStart = 0;
+ gpuDuration = 0;
+ }
+
+ if (cpuTimes) {
+ cpuStart -= baseCpuTime;
+ } else {
+ cpuStart = 0;
+ cpuDuration = 0;
+ }
+
+ if (!pixelsDrawn) {
+ pixels = 0;
+ }
+
+ std::cout << "call"
+ << " " << no
+ << " " << gpuStart
+ << " " << gpuDuration
+ << " " << cpuStart
+ << " " << cpuDuration
+ << " " << pixels
+ << " " << program
+ << " " << name
+ << std::endl;