1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00
mpv/player
Niklas Haas dd78cc6fe7 vo_opengl: refactor vo performance subsystem
This replaces `vo-performance` by `vo-passes`, bringing with it a number
of changes and improvements:

1. mpv users can now introspect the vo_opengl passes, which is something
   that has been requested multiple times.

2. performance data is now measured per-pass, which helps both
   development and debugging.

3. since adding more passes is cheap, we can now report information for
   more passes (e.g. the blit pass, and the osd pass). Note: we also
   switch to nanosecond scale, to be able to measure these passes
   better.

4. `--user-shaders` authors can now describe their own passes, helping
   users both identify which user shaders are active at any given time
   as well as helping shader authors identify performance issues.

5. the timing data per pass is now exported as a full list of samples,
   so projects like Argon-/mpv-stats can immediately read out all of the
   samples and render a graph without having to manually poll this
   option constantly.

Due to gl_timer's design being complicated (directly reading performance
data would block, so we delay the actual read-back until the next _start
command), it's vital not to conflate different passes that might be
doing different things from one frame to another. To accomplish this,
the actual timers are stored as part of the gl_shader_cache's sc_entry,
which makes them unique for that exact shader.

Starting and stopping the time measurement is easy to unify with the
gl_sc architecture, because the existing API already relies on a
"generate, render, reset" flow, so we can just put timer_start and
timer_stop in sc_generate and sc_reset, respectively.

The ugliest thing about this code is that due to the need to keep pass
information relatively stable in between frames, we need to distinguish
between "new" and "redrawn" frames, which bloats the code somewhat and
also feels hacky and vo_opengl-specific. (But then again, this entire
thing is vo_opengl-specific)
2017-07-01 00:58:27 +02:00
..
javascript js: add javascript scripting support using MuJS 2017-06-14 12:29:32 +02:00
lua ytdl_hook: don't override start time set by saved state 2017-06-09 11:13:24 +01:00
audio.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
client.c client API: change mpv_create() behavior, run init always on mpv thread 2017-06-30 13:14:39 +02:00
client.h client API: turn mpv_suspend() and mpv_resume() into stubs 2016-11-22 15:54:44 +01:00
command.c vo_opengl: refactor vo performance subsystem 2017-07-01 00:58:27 +02:00
command.h player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
configfiles.c player: document where the magic "encoding" section name is used 2017-06-26 11:46:36 +02:00
core.h scripting: add wrapper to load scripts with user paths 2017-06-30 15:03:10 +01:00
external_files.c external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
external_files.h external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
javascript.c javascript: replace custom MIN macro with MPMIN 2017-06-17 14:28:42 +02:00
lavfi.c lavfi: temporary workaround for FFmpeg av_buffersrc_parameters_set() bug 2017-02-22 10:43:35 +01:00
lavfi.h lavfi: support hwdec filters for --lavfi-complex 2017-02-20 13:42:08 +01:00
loadfile.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
lua.c scripting: expand --script filename for C plugins 2017-06-09 19:42:12 +02:00
main.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
misc.c player: remove --stream-capture option/property 2017-01-21 17:19:01 +01:00
osd.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
playloop.c Universal Windows Plaform (UWP) support 2017-06-29 10:36:16 +02:00
screenshot.c screenshot: cleanup: use normal MSGL_ defines 2017-04-01 20:47:36 +02:00
screenshot.h player: make screenshot commands honor the async flag 2017-04-01 20:47:23 +02:00
scripting.c scripting: add wrapper to load scripts with user paths 2017-06-30 15:03:10 +01:00
sub.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
video.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00