summaryrefslogtreecommitdiffstats
path: root/video/out/hwdec/hwdec_vulkan.c
Commit message (Collapse)AuthorAgeFilesLines
* hwdec_vulkan: use VK_NULL_HANDLE when counting the number of imagesDudemanguy2023-11-181-2/+2
| | | | | Otherwise you can get "error: comparison between pointer and integer" while compiling in some cases.
* Revert "hwdec_vulkan: account for vulkan frames now using presentation size"Philip Langdale2023-10-261-2/+12
| | | | | | | | | | | ffmpeg is again setting the frame dimensions to the coded size, so we need to reintroduce our work-around to get the logical frame dimensions from the frames_ctx rather than the frame itself. ffmpeg commit: * https://github.com/FFmpeg/FFmpeg/commit/9ee4f47c94083b4fe38d4e217a7d65055d3ad53f This reverts commit c40bd888729212f698156b57e49391d3b51f8f07.
* hwdec_vulkan: respect probing flag when logging during initPhilip Langdale2023-06-031-3/+4
| | | | | | All hwdecs should respect the probing flag and demote their lgoging to verbose level, so that initialisation failures during probing do not spam the user. I forgot to do this for the Vulkan hwdec.
* hwdec_vulkan: account for vulkan frames now using presentation sizePhilip Langdale2023-05-291-12/+2
| | | | | | | | | | | | | | | | | ffmpeg was previously allocating images for frames as the code size, rather than the presentation one (1088 vs 1080 in the most common example). Using the coded size when wrapping images for libplacebo resulted in incorrect scaling from 1088 -> 1080, but even using the presentation size wasn't perfect, as discussed in the original commit. However, ffmpeg has now been updated to use the presentation size for the frame images, after discussions that concluded this must be done because there is no way for a frame consumer to fix the dimensions without copying the frame. With that ffmpeg change, we can just use the normal layout information like all the other hwdecs.
* hwdec_vulkan: add Vulkan HW InteropPhilip Langdale2023-05-281-0/+332
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