The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/pacing: Add Tracy plots

+19 -1
+14 -1
src/xrt/auxiliary/util/u_pacing_app.c
··· 250 250 static void 251 251 do_tracing(struct pacing_app *pa, struct u_pa_frame *f) 252 252 { 253 - #ifdef U_TRACE_PERCETTO // Uses Percetto specific things. 254 253 if (!U_TRACE_CATEGORY_IS_ENABLED(timing)) { 255 254 return; 256 255 } 257 256 257 + #ifdef U_TRACE_TRACY // Uses Tracy specific things. 258 + uint64_t cpu_ns = f->when.begin_ns - f->when.wait_woke_ns; 259 + TracyCPlot("App CPU(ms)", time_ns_to_ms_f(cpu_ns)); 258 260 261 + uint64_t draw_ns = f->when.delivered_ns - f->when.begin_ns; 262 + TracyCPlot("App Draw(ms)", time_ns_to_ms_f(draw_ns)); 263 + 264 + uint64_t gpu_ns = f->when.gpu_done_ns - f->when.delivered_ns; 265 + TracyCPlot("App GPU(ms)", time_ns_to_ms_f(gpu_ns)); 266 + 267 + int64_t diff_ns = (int64_t)f->when.gpu_done_ns - (int64_t)f->predicted_gpu_done_time_ns; 268 + TracyCPlot("App vs Expected(ms)", time_ns_to_ms_f(diff_ns)); 269 + #endif 270 + 271 + #ifdef U_TRACE_PERCETTO // Uses Percetto specific things. 259 272 #define TE_BEG(TRACK, TIME, NAME) U_TRACE_EVENT_BEGIN_ON_TRACK_DATA(timing, TRACK, TIME, NAME, PERCETTO_I(f->frame_id)) 260 273 #define TE_END(TRACK, TIME) U_TRACE_EVENT_END_ON_TRACK(timing, TRACK, TIME) 261 274
+5
src/xrt/auxiliary/util/u_pacing_compositor_fake.c
··· 168 168 #undef TE_END 169 169 } 170 170 #endif 171 + 172 + #ifdef U_TRACE_TRACY 173 + uint64_t diff_ns = gpu_end_ns - gpu_start_ns; 174 + TracyCPlot("Compositor GPU(ms)", time_ns_to_ms_f(diff_ns)); 175 + #endif 171 176 } 172 177 173 178 static void