mpv/video/out/gpu
Philip Langdale 61e685594d hwdec_vulkan: add Vulkan HW Interop
Vulkan Video Decoding has finally become a reality, as it's now
showing up in shipping drivers, and the ffmpeg support has been
merged.

With that in mind, this change introduces HW interop support for
ffmpeg Vulkan frames. The implementation is functionally complete - it
can display frames produced by hardware decoding, and it can work with
ffmpeg vulkan filters. There are still various caveats due to gaps and
bugs in drivers, so YMMV, as always.

Primary testing has been done on Intel, AMD, and nvidia hardware on
Linux with basic Windows testing on nvidia.

Notable caveats:
* Due to driver bugs, video decoding on nvidia does not work right now,
  unless you use the Vulkan Beta driver. It can be worked around, but
  requires ffmpeg changes that are not considered acceptable to merge.
* Even if those work-arounds are applied, Vulkan filters will not work
  on video that was decoded by Vulkan, due to additional bugs in the
  nvidia drivers. The filters do work correctly on content decoded some
  other way, and then uploaded to Vulkan (eg: Decode with nvdec, upload
  with --vf=format=vulkan)
* Vulkan filters can only be used with drivers that support
  VK_EXT_descriptor_buffer which doesn't include Intel ANV as yet.
  There is an MR outstanding for this.
* When dealing with 1080p content, there may be some visual distortion
  in the bottom lines of frames due to chroma scaling incorporating the
  extra hidden lines at the bottom of the frame (1080p content is
  actually stored as 1088 lines), depending on the hardware/driver
  combination and the scaling algorithm. This cannot be easily
  addressed as the mechanical fix for it violates the Vulkan spec, and
  probably requires a spec change to resolve properly.

All of these caveats will be fixed in either drivers or ffmpeg, and so
will not require mpv changes (unless something unexpected happens)

If you want to run on nvidia with the non-beta drivers, you can this
ffmpeg tree with the work-around patches:

* https://github.com/philipl/FFmpeg/tree/vulkan-nvidia-workarounds
2023-05-28 15:46:05 -07:00
..
context.c options: transition options from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
context.h various: fix typos 2023-03-28 19:29:44 +00:00
d3d11_helpers.c d3d11: retry device creation without debug, if SDK is not available 2023-04-02 21:43:53 +03:00
d3d11_helpers.h
error_diffusion.c vo_gpu: opengl: some fixes to make compute shaders work with GLES 2021-12-12 20:23:31 -08:00
error_diffusion.h
hwdec.c hwdec_vulkan: add Vulkan HW Interop 2023-05-28 15:46:05 -07:00
hwdec.h vo: hwdec: Pass the ra_ctx to hwdecs instead of just the ra 2023-05-28 15:46:05 -07:00
lcms.c vo_gpu_next: allow to use ICC profile luminance value 2023-05-13 17:08:37 +02:00
lcms.h vo_gpu_next: allow to use ICC profile luminance value 2023-05-13 17:08:37 +02:00
libmpv_gpu.c vo: hwdec: Pass the ra_ctx to hwdecs instead of just the ra 2023-05-28 15:46:05 -07:00
libmpv_gpu.h vo: hwdec: Pass the ra_ctx to hwdecs instead of just the ra 2023-05-28 15:46:05 -07:00
osd.c various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate 2023-01-12 22:02:07 +01:00
osd.h
ra.c ra: assert when using params with dimensions 2023-03-02 02:08:39 +00:00
ra.h various: fix various typos in the code base 2023-03-28 19:29:44 +00:00
shader_cache.c player: use XDG_CACHE_HOME by default 2023-05-09 20:37:17 +00:00
shader_cache.h player: use XDG_CACHE_HOME by default 2023-05-09 20:37:17 +00:00
spirv.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
spirv.h
spirv_shaderc.c
user_shaders.c options: transition commands from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
user_shaders.h
utils.c test: integrate unittests with meson 2023-03-02 15:45:27 +00:00
utils.h test: integrate unittests with meson 2023-03-02 15:45:27 +00:00
video.c vo: hwdec: Pass the ra_ctx to hwdecs instead of just the ra 2023-05-28 15:46:05 -07:00
video.h vo: hwdec: Pass the ra_ctx to hwdecs instead of just the ra 2023-05-28 15:46:05 -07:00
video_shaders.c csputils: add MP_CSP_TRC_ST428 as defined in ST 428-1 2023-03-02 09:37:06 -05:00
video_shaders.h vo_gpu: lift ra_ctx_* opts to a global struct 2021-11-03 14:09:27 +01:00