The open source OpenXR runtime
0
fork

Configure Feed

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

u/pacing: Split draw into draw and wait, improve pipelining

authored by

Jakob Bornecrantz and committed by
Jakob Bornecrantz
05950701 47649f56

+14 -4
+14 -4
src/xrt/auxiliary/util/u_pacing_app.c
··· 92 92 { 93 93 //! App time between wait returning and begin being called. 94 94 uint64_t cpu_time_ns; 95 - //! Time between begin and frame rendering completing. 95 + //! Time between begin and frame data being delivered. 96 96 uint64_t draw_time_ns; 97 + //! Time between the frame data being delivered and GPU completing. 98 + uint64_t wait_time_ns; 97 99 //! Extra time between end of draw time and when the compositor wakes up. 98 100 uint64_t margin_ns; 99 101 } app; //!< App statistics. ··· 193 195 } 194 196 195 197 while (pa->app.draw_time_ns > period_ns) { 198 + period_ns += base_period_ns; 199 + } 200 + 201 + while (pa->app.wait_time_ns > period_ns) { 196 202 period_ns += base_period_ns; 197 203 } 198 204 ··· 361 367 #define NS_TO_MS_F(ns) (time_ns_to_s(ns) * 1000.0) 362 368 363 369 uint64_t diff_cpu_ns = f->when.begin_ns - f->when.wait_woke_ns; 364 - uint64_t diff_draw_ns = f->when.gpu_done_ns - f->when.begin_ns; 370 + uint64_t diff_draw_ns = f->when.delivered_ns - f->when.begin_ns; 371 + uint64_t diff_wait_ns = f->when.gpu_done_ns - f->when.delivered_ns; 365 372 366 373 UPA_LOG_D( 367 374 "Delivered frame %.2fms %s." // 368 375 "\n\tperiod: %.2f" // 369 376 "\n\tcpu o: %.2f, n: %.2f" // 370 - "\n\tdraw o: %.2f, n: %.2f", // 377 + "\n\tdraw o: %.2f, n: %.2f" // 378 + "\n\twait o: %.2f, n: %.2f", // 371 379 time_ns_to_ms_f(diff_ns), late ? "late" : "early", // 372 380 time_ns_to_ms_f(f->predicted_display_period_ns), // 373 381 time_ns_to_ms_f(pa->app.cpu_time_ns), time_ns_to_ms_f(diff_cpu_ns), // 374 - time_ns_to_ms_f(pa->app.draw_time_ns), time_ns_to_ms_f(diff_draw_ns)); // 382 + time_ns_to_ms_f(pa->app.draw_time_ns), time_ns_to_ms_f(diff_draw_ns), // 383 + time_ns_to_ms_f(pa->app.wait_time_ns), time_ns_to_ms_f(diff_wait_ns)); // 375 384 376 385 do_iir_filter(&pa->app.cpu_time_ns, IIR_ALPHA_LT, IIR_ALPHA_GT, diff_cpu_ns); 377 386 do_iir_filter(&pa->app.draw_time_ns, IIR_ALPHA_LT, IIR_ALPHA_GT, diff_draw_ns); 387 + do_iir_filter(&pa->app.wait_time_ns, IIR_ALPHA_LT, IIR_ALPHA_GT, diff_wait_ns); 378 388 379 389 // Trace the data. 380 390 #ifdef XRT_FEATURE_TRACING