| 6 | |
| 7 | == Frame profiling == |
| 8 | |
| 9 | === apitrace === |
| 10 | |
| 11 | 1. Install apitrace from https://apitrace.github.io/#download (analyzing scripts require Python 3) |
| 12 | 2. Capture a trace. Currently apitrace can't capture an interval, it starts capturing from the beginning. So it makes sense to repeat the needed frame as fast as possible using a window size as small as possible (a minute capture might use few GBs). |
| 13 | {{{ |
| 14 | path/to/apitrace trace --api gl --output 0ad.trace path/to/pyrogenesis [pyrogenesis arguments...] |
| 15 | }}} |
| 16 | |
| 17 | 3. Analyze the capture. |
| 18 | {{{ |
| 19 | path/to/apitrace replay --headless --pframe-times --pgpu --pcpu --ppd 0ad.trace > 0ad.trace.profiling.txt |
| 20 | }}} |
| 21 | * {{{--pframe-times}}} record frames times, waiting for presentation to finish before starting next frame. |
| 22 | * {{{--pgpu}}} record GPU times for frames and draw calls. |
| 23 | * {{{--pcpu}}} record CPU times for frames and draw calls. |
| 24 | * {{{--ppd}}} record pixels drawn for each draw call. |
| 25 | * {{{--headless}}} don't show windows. |
| 26 | |