]> git.cworth.org Git - apitrace/blobdiff - common/trace_profiler.hpp
Improve internal format of profile results.
[apitrace] / common / trace_profiler.hpp
index 42fd032008ca668b4fe3767947b092005996f426..8463c61f4ff5d06230b7b3217cf3bb723389276b 100644 (file)
@@ -34,16 +34,7 @@ namespace trace
 {
 
 struct Profile {
-    struct CpuCall {
-        unsigned no;
-
-        int64_t cpuStart;
-        int64_t cpuDuration;
-
-        std::string name;
-    };
-
-    struct DrawCall {
+    struct Call {
         unsigned no;
 
         int64_t gpuStart;
@@ -65,6 +56,12 @@ struct Profile {
 
         int64_t cpuStart;
         int64_t cpuDuration;
+
+        /* Indices to profile->calls array */
+        struct {
+            unsigned begin;
+            unsigned end;
+        } calls;
     };
 
     struct Program {
@@ -73,12 +70,14 @@ struct Profile {
         uint64_t gpuTotal;
         uint64_t cpuTotal;
         uint64_t pixelTotal;
-        std::vector<DrawCall> drawCalls;
+
+        /* Indices to profile->calls array */
+        std::vector<unsigned> calls;
     };
 
+    std::vector<Call> calls;
     std::vector<Frame> frames;
     std::vector<Program> programs;
-    std::vector<CpuCall> cpuCalls;
 };
 
 class Profiler