@@ -129,10 +129,10 @@ RecursiveDrawScope(const Profiling::ProfilingScope& scope, Profiler::HighLightRe
129129/* *
130130*/
131131int
132- RecursiveDrawGpuMarker (const CoreGraphics::FrameProfilingMarker& marker, Profiler::HighLightRegion& highlightRegion, ImDrawList* drawList, const ImVec2 start, const ImVec2 fullSize, ImVec2 pos, const ImVec2 canvas, const float fullFrameTime, const float startSection, const float endSection, const int level)
132+ RecursiveDrawGpuMarker (const CoreGraphics::FrameProfilingMarker& marker, Profiler::HighLightRegion& highlightRegion, ImDrawList* drawList, const ImVec2 start, const ImVec2 fullSize, ImVec2 pos, const ImVec2 canvas, const float fullFrameTime, const float startSection, const float endSection, const float cpuOffset, const int level)
133133{
134134 // convert to milliseconds
135- float begin = marker.start / 1000000000 .0f ;
135+ float begin = ( marker.start + marker. cpuBegin ) / 1000000000 .0f ;
136136 float duration = marker.duration / 1000000000 .0f ;
137137
138138 const float startTime = startSection * fullFrameTime;
@@ -193,7 +193,7 @@ RecursiveDrawGpuMarker(const CoreGraphics::FrameProfilingMarker& marker, Profile
193193 int deepest = level + 1 ;
194194 for (IndexT i = 0 ; i < marker.children .Size (); i++)
195195 {
196- int childLevel = RecursiveDrawGpuMarker (marker.children [i], highlightRegion, drawList, start, fullSize, pos, canvas, fullFrameTime, startSection, endSection, level + 1 );
196+ int childLevel = RecursiveDrawGpuMarker (marker.children [i], highlightRegion, drawList, start, fullSize, pos, canvas, fullFrameTime, startSection, endSection, cpuOffset, level + 1 );
197197 deepest = Math::max (deepest, childLevel);
198198 }
199199 return deepest;
@@ -375,8 +375,9 @@ Profiler::Run(SaveMode save)
375375 totalMarker.queue = CoreGraphics::GraphicsQueueType;
376376 totalMarker.children = frameMarkersGraphics;
377377 totalMarker.start = first.start ;
378- totalMarker.duration = (last.start + last.duration - first.start );
379- int level = RecursiveDrawGpuMarker (totalMarker, this ->highlightRegion , drawList, start, fullSize, pos, canvasSize, this ->currentFrameTime , this ->timeStart , this ->timeEnd , 0 );
378+ totalMarker.duration = (last.start + last.duration + last.cpuBegin - (first.start + first.cpuBegin ));
379+ totalMarker.cpuBegin = first.cpuBegin ;
380+ int level = RecursiveDrawGpuMarker (totalMarker, this ->highlightRegion , drawList, start, fullSize, pos, canvasSize, this ->currentFrameTime , this ->timeStart , this ->timeEnd , first.cpuBegin , 0 );
380381 levels = Math::max (levels, level);
381382 }
382383 pos.y += Math::max (1 , (levels - 1 )) * 20 .0f ;
@@ -396,8 +397,9 @@ Profiler::Run(SaveMode save)
396397 totalMarker.queue = CoreGraphics::ComputeQueueType;
397398 totalMarker.children = frameMarkersCompute;
398399 totalMarker.start = first.start ;
399- totalMarker.duration = (last.start + last.duration - first.start );
400- int level = RecursiveDrawGpuMarker (totalMarker, this ->highlightRegion , drawList, start, fullSize, pos, canvasSize, this ->currentFrameTime , this ->timeStart , this ->timeEnd , 0 );
400+ totalMarker.duration = (last.start + last.duration + last.cpuBegin - (first.start + first.cpuBegin ));
401+ totalMarker.cpuBegin = first.cpuBegin ;
402+ int level = RecursiveDrawGpuMarker (totalMarker, this ->highlightRegion , drawList, start, fullSize, pos, canvasSize, this ->currentFrameTime , this ->timeStart , this ->timeEnd , first.cpuBegin , 0 );
401403 levels = Math::max (levels, level);
402404 }
403405
0 commit comments