mpv/video
James Ross-Gowan a9f9601ca8 vo_gpu: d3d11: add support for presentation feedback
This adds vsync reporting to the D3D11 backend using the presentation
feedback provided by DXGI, which is pretty similar to what's provided by
GLX_OML_sync_control in the GLX backend. In DirectX, PresentCount is the
SBC, PresentRefreshCount and SyncRefreshCount are kind of like the MSC
and SyncQPCTime is the UST.

Unlike GLX, the DXGI API makes it possible for PresentCount and
SyncQPCTime to refer to different physical vsyncs, in which case
PresentRefreshCount and SyncRefreshCount will be different. The code
supports this possibility, even though it's not clear whether it can
happen when using flip-model presentation. The docs say for flip-model
apps, PresentRefreshCount is equal to SyncRefreshCount "when the app
presents on every vsync," but on my hardware, they're always equal, even
when mpv misses a vsync. They can definitely be different in exclusive
fullscreen bitblt mode, though, which mpv doesn't support now, but might
support in future.

Another difference to GLX is that, at least on my hardware,
PresentRefreshCount and SyncRefreshCount always refer to the last
physical vsync on which mpv presented a frame, but glxGetSyncValues can
apparently return a MSC and UST from the most recent physical vsync,
even if mpv didn't present a new frame on it. This might result in
different behaviour between the two backends after dropped frames or
brief pauses.

Also note, the docs for the DXGI presentation feedback APIs are pretty
awful, even by Microsoft standards. In particular the docs for
DXGI_FRAME_STATISTICS are misleading (PresentCount really is the number
of times Present() has been called for that frame, not "the running
total count of times that an image was presented to the monitor since
the computer booted.")

For good documentation, try these:
https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-flip-model
https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dpresentstats
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/d3dkmthk/ns-d3dkmthk-_d3dkmt_present_stats

(Yeah, the docs for the D3D9Ex and even the kernel-mode version of this
structure are better than the DXGI ones. It seems possible that they're
all rewordings of the same internal Microsoft docs, but whoever wrote
the DXGI one didn't really understand it.)
2019-09-22 23:18:40 +10:00
..
decode video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
filter vf_fingerprint: remove extraneous single quote from description 2019-09-21 23:46:41 +03:00
out vo_gpu: d3d11: add support for presentation feedback 2019-09-22 23:18:40 +10:00
csputils.c
csputils.h
d3d.c
d3d.h
fmt-conversion.c vo/gpu: hwdec_vdpau: Support direct mode for 4:4:4 content 2019-07-08 01:11:27 +02:00
fmt-conversion.h
hwdec.c
hwdec.h
image_loader.c image_writer: move convert_image() to player/screenshot.c 2019-09-14 23:02:39 +02:00
image_loader.h
image_writer.c image_writer: add webp-compression option 2019-09-14 23:02:39 +02:00
image_writer.h image_writer: add webp-compression option 2019-09-14 23:02:39 +02:00
img_format.c video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
img_format.h vo/gpu: hwdec_vdpau: Support direct mode for 4:4:4 content 2019-07-08 01:11:27 +02:00
mp_image.c video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
mp_image.h video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
mp_image_pool.c
mp_image_pool.h
sws_utils.c
sws_utils.h video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
vaapi.c
vaapi.h vo_gpu: hwdec_vaapi: Suppress format errors when probing 2019-07-08 01:57:02 +02:00
vdpau.c
vdpau.h
vdpau_functions.inc
vdpau_mixer.c
vdpau_mixer.h