mpv
mpv copied to clipboard
WIP: MoltenVK/Vulkan backend for macOS
this is in a very early state. i still need to majorly clean this code up and kill all the code duplications. my goal is to have one code base to use in all the macOS backends (might be a bit tricky with libmpv/cocoa-cb). nothing really has been tested so far. it renders the video and the basic windowing stuff works.
TODO:
- [ ] cleanup code
- [x] unify the backends
- [ ] properly detect moltenvk(?)
- [ ] proper naming
- [x] performance tests
- [x] feature tests
- [x] use a CAMetalLayer directly instead of the view
- [ ] Documentation
- [ ] Bundle creation changes
- [ ] 10bit check
though feel free to report any kind of problems you encounter.
simple and dirty way to install the dependencies:
- downloaded vulkan sdk from https://vulkan.lunarg.com/sdk/home#mac
- installed it with the provided install script
python install_vulkan.py - created a vulkan.pc pkg config file with:
#!/bin/bash
export DEPS_ROOT_LOCATON=$(grealpath .)
export VULKAN_SDK_VERSION="1.2.131.2"
export VULKAN_SDK_BASENAME="vulkansdk-macos-$VULKAN_SDK_VERSION"
export VULKAN_SDK="$DEPS_ROOT_LOCATON/$VULKAN_SDK_BASENAME/macOS"
export VULKAN_SDK_PKG_CONFIG_PATH="$VULKAN_SDK/lib/pkgconfig"
export PATH="/usr/local/opt/python/libexec/bin:$VULKAN_SDK/bin:$PATH"
cat > "$VULKAN_SDK_PKG_CONFIG_PATH/vulkan.pc" << EOL
libdir=$VULKAN_SDK/lib
includedir=$VULKAN_SDK/include
Name: vulkan
Description: Vulkan
Version: $VULKAN_SDK_VERSION
Libs: -L\${libdir} -lMoltenVK
Libs.private: -lm
Cflags: -I\${includedir}
EOL
- symlinked the vulkan.pc file /usr/local/lib/pkgconfig
ln -s vulkansdk-macos-1.2.131.2/macOS/lib/pkgconfig/vulkan.pc /usr/local/lib/pkgconfig/vulkan.pc - install libplacebo
fixes #5571
i am not recommending anything. even said it's a dirty way. i didn't look into building/linking properly yet.
a little update. i finished unifying the two backends to get rid of a majority of all the code duplications. the cocoa-cb generalisation is completely done and properly cleaned up, and could possibly be merged independently. though there are no real benefits besides me not having to backport possible fixes from master. the molten backend still has to be cleaned up properly.
some findings:
- with interpolation i can reliable reproduce rendering freezes, this can be mitigated by
--vulkan-disable-events - initialisation takes quite a lot of time, sometimes more than a second, this can be mitigated by
--gpu-shader-cache-dir - setting an icc profile on startup doesn't work properly and needs to be set after the first draw (still needs a proper fix)
- vsync jitter is still a bit erratical and needs more testing
- live reisze is not as smooth as on cocoa-cb, rendering surface is not fixed in size and updates constantly
- drawing in background doesn't work and blocks, like with every layer, needs a mechanism to actively skip
- drawing size update still needs testing
for myself building libplacebo so i don't forget it:
meson configure --clearcache $DIR
meson --reconfigure $DIR -Dvulkan-registry=/Users/Akemi/Repositories/vulkansdk-macos-1.2.141.2/macOS/share/vulkan/registry/vk.xml
some more findings:
- VK_PRESENT_MODE_IMMEDIATE_KHR sets displaysyncenabled which significantly degrades performance. seems like it can't properly sync the the display and drops frames because of that
- using VK_PRESENT_MODE_FIFO_KHR instead and doing a manual sync to the display works a lot better and it seems that performance is at least similar to opengl (if not better, still need to test)
- how moltenvk initialises the metal layer https://github.com/KhronosGroup/MoltenVK/blob/f967fb6aebcce02d02ad9bc249f45cb5cf4a11f6/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm#L269-L275
- from a quick test, compute shaders seem to work as intended
- layer scaling is set to kCAFilterNearest by default and should be set to at least be kCAFilterLinear (moltenvk can only set those too)
- using the precise timer test (i did once), could be used here
stats with the follwoing: VK_PRESENT_MODE_IMMEDIATE_KHR: https://0x0.st/ixIc.png VK_PRESENT_MODE_FIFO_KHR: https://0x0.st/ixIA.png
includes for the molten stuff needs to be manually installed?
ln -s /Users/Akemi/Repositories/vulkansdk-macos-1.2.141.2/MoltenVK/include/MoltenVK /usr/local/include/MoltenVK
ln -s /Users/Akemi/Repositories/vulkansdk-macos-1.2.141.2/MoltenVK/include/vulkan-portability /usr/local/include/vulkan-portability
https://github.com/haasn/libplacebo/blob/5e517936c15583e3148f46d76135d63537617f9f/src/vulkan/swapchain.c#L164-L172 check why it picks an 8bit format even so 10/16bit formats are available.
some more info:
- VK_PRESENT_MODE_IMMEDIATE_KHR causes major tearing and can't be used, VK_PRESENT_MODE_FIFO_KHR needs to be used but this causes bad vsync
some more info from recent testing with moltenvk 1.2.148.0 i updated to:
- performance with VK_PRESENT_MODE_FIFO_KHR got a lot better, still needs proper testing
- ~~after updating libplacebo the bad performance was back, caused by commit https://github.com/haasn/libplacebo/commit/055cdc0a99ae4b081caf53405aa8b04b19aab08d~~ can't reproduce this anymore, maybe a hiccup
did some performance tests today. i couldn't find any sample or settings that would indicate any kind of performance difference, neither better nor worse, that weren't bottlenecked by decoding speed.
only thing i noticed is that vsyncing on moltenvk is a tad more unstable so far.
Hi, I have managed to build this changeset and would like to help in testing/development. I used the latest versions of the Vulkan SDK (1.2.162.0) libplacebo (git master). I'm on a MacBook Pro 16" with Intel UHD 630+Radeon 5500M running Catalina 10.15.7 and Xcode 12.3. My configuration:
$ build/mpv -v
[cplayer] Command line options: '-v'
[cplayer] mpv 0.29.0-2298-g2d4354733e Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on Fri Dec 25 16:06:14 PST 2020
[cplayer] FFmpeg library versions:
[cplayer] libavutil 56.51.100
[cplayer] libavcodec 58.91.100
[cplayer] libavformat 58.45.100
[cplayer] libswscale 5.7.100
[cplayer] libavfilter 7.85.100
[cplayer] libswresample 3.7.100
[cplayer] FFmpeg version: 4.3.1
[cplayer]
[cplayer] Configuration: ./waf configure --prefix=/Users/software
[cplayer] List of enabled features: 51deb asm bsd-fstatfs build-date cocoa coreaudio cplayer cplugins debug-build ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg lcms2 libass libavdevice libbluray libdl libm libplacebo lua macos-10-11-features macos-10-12-2-features macos-10-14-features macos-cocoa-cb macos-media-player macos-touchbar optimize osx-thread-name posix posix-or-mingw pthreads rubberband shaderc shaderc-shared spirv-cross spirv-cross-shared stdatomic swift uchardet vapoursynth videotoolbox-gl videotoolbox-hwaccel vulkan zimg zlib
[cplayer] Reading config file /Users/anindya/.config/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'hwdec' = 'auto' (flags = 4)
[cplayer] Setting option 'sub-font' = 'serif' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] mpv 0.29.0-2298-g2d4354733e Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on Fri Dec 25 16:06:14 PST 2020
[cplayer] FFmpeg library versions:
[cplayer] libavutil 56.51.100
[cplayer] libavcodec 58.91.100
[cplayer] libavformat 58.45.100
[cplayer] libswscale 5.7.100
[cplayer] libavfilter 7.85.100
[cplayer] libswresample 3.7.100
[cplayer] FFmpeg version: 4.3.1
[cplayer]
[cplayer] Usage: mpv [options] [url|path/]filename
[cplayer]
[cplayer] Basic options:
[cplayer] --start=<time> seek to given (percent, seconds, or hh:mm:ss) position
[cplayer] --no-audio do not play sound
[cplayer] --no-video do not play video
[cplayer] --fs fullscreen playback
[cplayer] --sub-file=<file> specify subtitle file to use
[cplayer] --playlist=<file> specify playlist file
[cplayer]
[cplayer] --list-options list all mpv options
[cplayer] --h=<string> print options which contain the given string in their name
[cplayer]
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
Thank you very much for the great work!
i still get some bad vsyncs and need to investigate the source of it. otherwise it's pretty stable and i used it regularly. --vo=gpu --gpu-api=vulkan --gpu-context=macosvk --vulkan-disable-events i use this for testing. some of the options are redundant, though the last one is mandatory to work properly in my tests.
otherwise just see if it works for you and report what doesn't.
I had a chance to use your changes for quite a few files and it seems to work well. I have not noticed any anomalies yet. My sources are not very high quality: Up to HD resolution and h264. However it seems to always turn on the discrete GPU on my laptop. Can I make it use the integrated GPU somehow? The iGPU is more than powerful enough normally.
there is an undocumented option for it --vulkan-device. with --vulkan-device=help you can get a list of all devices.
mpv --vulkan-device=help
Available vulkan devices:
'AMD Radeon RX Vega 56' (GPU 0, ID 1002:687f)
then you can chose the device by its name
mpv --vulkan-device="AMD Radeon RX Vega 56"
Perfect. It worked, thank you!
When using --gpu-api=vulkan the video is scaled to half the window resolution on HIDPI display settings, and the OSC inputs are mapped to the top left quadrant of the window. (The OSC is rendered across the whole window, but, for instance, scrubbing requires clicking and dragging across the vertical-center of the window). When on non-scaled resolutions, everything works as expected.
In the log, the first detected window size (1920x1080) is correct
[ 0.921][v][vo/gpu] Window size: 1920x1080 (Borders: l=0 t=0 r=0 b=0)
However for some reason, the swapchain created by libplacebo is half resolution
[ 0.922][d][vo/gpu/vulkan/libplacebo] Requested image size: 1920x1080 (min 960x540 < cur 960x540 < max 960x540)
[ 0.922][v][vo/gpu/vulkan/libplacebo] (Re)creating swapchain of size 960x540
[ 0.923][v][vo/gpu] Resize: 960x540
[ 0.923][v][vo/gpu] Window size: 960x540 (Borders: l=0 t=0 r=0 b=0)
(The actual window size here is still 1920x1080 after [0.923]). mpv.log
Edit: Bug specific to version 1.2.154.0 of the SDK. Updating to 1.2.162.1 fixed the issue.
./mpv --vulkan-device=help
Available vulkan devices:
'AMD Radeon RX 5700 XT' (GPU 0, ID 1002:731f)
./mpv -v --vo=gpu --gpu-api=vulkan
[cplayer] Command line options: '-v' '--vo=gpu' '--gpu-api=vulkan'
[cplayer] mpv 0.29.0-2323-gdae9ea3fa7 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on Wed Feb 17 20:11:38 EET 2021
[cplayer] FFmpeg library versions:
[cplayer] libavutil 56.51.100
[cplayer] libavcodec 58.91.100
[cplayer] libavformat 58.45.100
[cplayer] libswscale 5.7.100
[cplayer] libavfilter 7.85.100
[cplayer] libswresample 3.7.100
[cplayer] FFmpeg version: 4.3.1
[cplayer]
[cplayer] Configuration: ./waf configure --enable-vulkan --enable-libplacebo
[cplayer] List of enabled features: 51deb asm bsd-fstatfs build-date cocoa coreaudio cplayer cplugins debug-build ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg lcms2 libass libavdevice libbluray libdl libm libplacebo lua macos-10-11-features macos-10-12-2-features macos-10-14-features macos-cocoa-cb macos-media-player macos-touchbar optimize osx-thread-name posix posix-or-mingw pthreads rubberband shaderc shaderc-shared stdatomic swift uchardet vapoursynth videotoolbox-gl videotoolbox-hwaccel vulkan zimg zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'vo' = 'gpu' (flags = 8)
[cplayer] Setting option 'gpu-api' = 'vulkan' (flags = 8)
[cplayer] Error parsing option gpu-api (option parameter could not be parsed)
[cplayer] Setting commandline option --gpu-api=vulkan failed.
[cplayer] Exiting... (Fatal error)
Any idea why --gpu-api=vulkan fails?
Huh, weird. Can you bump up the verbosity?
./mpv --no-config --msg-level=all=trace --vo=gpu --gpu-api=vulkan
[cplayer] Command line options: '--no-config' '--msg-level=all=trace' '--vo=gpu' '--gpu-api=vulkan'
[cplayer] mpv 0.29.0-2323-gdae9ea3fa7 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on Wed Feb 17 20:11:38 EET 2021
[cplayer] FFmpeg library versions:
[cplayer] libavutil 56.51.100
[cplayer] libavcodec 58.91.100
[cplayer] libavformat 58.45.100
[cplayer] libswscale 5.7.100
[cplayer] libavfilter 7.85.100
[cplayer] libswresample 3.7.100
[cplayer] FFmpeg version: 4.3.1
[cplayer]
[cplayer] Configuration: ./waf configure --enable-vulkan --enable-libplacebo
[cplayer] List of enabled features: 51deb asm bsd-fstatfs build-date cocoa coreaudio cplayer cplugins debug-build ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg lcms2 libass libavdevice libbluray libdl libm libplacebo lua macos-10-11-features macos-10-12-2-features macos-10-14-features macos-cocoa-cb macos-media-player macos-touchbar optimize osx-thread-name posix posix-or-mingw pthreads rubberband shaderc shaderc-shared stdatomic swift uchardet vapoursynth videotoolbox-gl videotoolbox-hwaccel vulkan zimg zlib
[global] config path: '' -> '-'
[global] user path: '~~home/' -> ''
[global] user path: '~~old_home/' -> ''
[cplayer] Setting option 'config' = 'no' (flags = 8)
[cplayer] Setting option 'msg-level' = 'all=trace' (flags = 8)
[cplayer] Setting option 'vo' = 'gpu' (flags = 8)
[cplayer] Setting option 'gpu-api' = 'vulkan' (flags = 8)
Error parsing option gpu-api (option parameter could not be parsed)
Setting commandline option --gpu-api=vulkan failed.
Exiting... (Fatal error)
Vulkan SDK is 1.2.162.1
libplacebo test:
ninja -C$DIR test
ninja: Entering directory `./build'
[0/1] Running all tests.
1/10 context.c OK 0.02s
2/10 colorspace.c OK 0.03s
3/10 filters.c OK 0.02s
4/10 string.c OK 0.03s
5/10 dummy.c OK 0.04s
6/10 utils.c OK 0.03s
7/10 dav1d.c OK 0.03s
8/10 libav.c OK 0.03s
9/10 dither.c OK 0.11s
10/10 vulkan.c FAIL 6.42s exit status 1
>>> MALLOC_PERTURB_=188 /Users/orion/Documents/Repos/libplacebo/build/src/test.vulkan.c
――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Listing only the last 100 lines from a long log.
error: vk->QueueSubmit(cmd->queue, 1, &sinfo, cmd->fence): VK_ERROR_DEVICE_LOST
error: vk->QueueSubmit(cmd->queue, 1, &sinfo, cmd->fence): VK_ERROR_DEVICE_LOST
error: vk->QueueSubmit(cmd->queue, 1, &sinfo, cmd->fence): VK_ERROR_DEVICE_LOST
...
Got libplacebo test and mpv to work with Vulkan SDK 1.2.162.0 Will try again with latest SDK, probably an error on my part.
i dunno i would say you build the wrong branch. your commit hash is dae9ea3fa7, which is the last commit before the actual vulkan changes in this branch. the mpv version string should be something like [cplayer] mpv 0.33.0-67-g5ab5e34a89 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects.
some more remarks for me and building and bundling
install_name_tool -id /usr/local/lib/libMoltenVK.dylib /usr/local/lib/libMoltenVK.dylib
install_name_tool -id /usr/local/lib/libshaderc_shared.1.dylib /usr/local/lib/libshaderc_shared.1.dylib
if libplacebo is still build with old stuff. probably not needed when former was done beforehand.
install_name_tool -change @rpath/libMoltenVK.dylib /usr/local/lib/libMoltenVK.dylib /usr/local/lib/libplacebo.89.dylib
install_name_tool -change /tmp/macos-sdk-build/shaderc/src/build/libshaderc/libshaderc_shared.1.dylib /usr/local/lib/libshaderc_shared.1.dylib /usr/local/lib/libplacebo.89.dylib
if mpv also has the same. might need proper fix.
install_name_tool -change @rpath/libMoltenVK.dylib /usr/local/lib/libMoltenVK.dylib /Volumes/AkemiData/Desktop/mpv-akemi/build/mpv
install_name_tool -change /tmp/macos-sdk-build/shaderc/src/build/libshaderc/libshaderc_shared.1.dylib /usr/local/lib/libshaderc_shared.1.dylib /Volumes/AkemiData/Desktop/mpv-akemi/build/mpv
Hardware decoding with VideoToolBox fails when using Vulkan backend.
mpv \
--vo=gpu \
--gpu-api=vulkan \
--hwdec=videotoolbox \
-v \
/Users/koko/Desktop/video.mkv
...
[vd] Codec list:
[vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] Opening decoder h264
[vd] Looking at hwdec h264-videotoolbox...
[vo/gpu] Loading hwdec driver 'videotoolbox'
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] No hardware decoding available for this codec.
[vd] Using software decoding.
The OpenGL backend works fine with hardware decoding
mpv \
--vo=gpu \
--gpu-api=opengl \
--hwdec=videotoolbox \
-v \
/Users/koko/Desktop/video.mkv
...
[vd] Opening decoder h264
[vd] Looking at hwdec h264-videotoolbox...
[vo/gpu] Loading hwdec driver 'videotoolbox'
[vd] Trying hardware decoding via h264-videotoolbox.
[vd] Pixel formats supported by decoder: videotoolbox_vld yuv420p
[vd] Codec profile: High (0x64)
none *-copy modes of hwdec are not supposed to work, since we only do opengl direct mapping. this will not be part of this PR because this PR is only about video output and not decoding. it might be added in the the future, but i don't care and won't do it.
another heads up.
i basically got proper syncing to work on mpv sides. though i still had a problem with moltenvk 1.2.148.0, where over time display sync got gradually worse over time. for testing i deactivated the syncing i was doing and only relied in the vsync blocking. i could reproduce the same problem. at some point at time rendering apparently takes longer than one vsync time.
i updated to the latest moltenvk 1.2.176.1. there vsync blocking doesn't work properly any more, it seems. on my 60hz display it draws at 120hz (2x) and on m TV with 50hz it draws at 200hz (4x) exactly. so we do need to manually sync again. sadly the problem with gradually worsening vsync/draw times persists and can still be reproduced, on macOS 10.14.x. i will try a newer OS version and see if i can still reproduce the same problem.
i don't feel comfortable merging this before this problem can't be solved properly.
I just wanted to flag that MoltenVK SDK 1.2.182 was released several days ago. I don't know if it fixes your vsync blocking issue though.
Just managed to make this PR build. However I got std::__1::system_error: mutex lock failed: Invalid argument when running
$ lldb build/mpv
(lldb) target create "build/mpv"
Current executable set to '/Users/carter/mpv/build/mpv' (arm64).
(lldb) run -v /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4 --vo=gpu-next --gpu-api=vulkan
Process 47226 launched: '/Users/carter/mpv/build/mpv' (arm64)
2022-02-28 10:44:23.853757+0800 mpv[47226:154973] [default] error finding potential wrapper bundle for node <FSNode 0x600000207720> { isDir = ?, path = '/Users/carter/mpv/build' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode}
2022-02-28 10:44:23.855475+0800 mpv[47226:154973] [default] error finding potential wrapper bundle for node <FSNode 0x600000207720> { isDir = ?, path = '/Users/carter/mpv/build' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode}
2022-02-28 10:44:23.855496+0800 mpv[47226:154973] [default] error finding potential wrapper bundle for node <FSNode 0x600000207720> { isDir = ?, path = '/Users/carter/mpv/build' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode}
[cplayer] Command line options: '-v' '/Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4' '--vo=gpu-next' '--gpu-api=vulkan'
[cplayer] mpv 9cef6f1-dirty Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
[cplayer] built on Mon Feb 28 10:13:39 CST 2022
[cplayer] FFmpeg library versions:
[cplayer] libavutil 57.17.100
[cplayer] libavcodec 59.18.100
[cplayer] libavformat 59.16.100
[cplayer] libswscale 6.4.100
[cplayer] libavfilter 8.24.100
[cplayer] libswresample 4.3.100
[cplayer] FFmpeg version: 5.0
[cplayer]
[cplayer] Configuration: ./waf configure --enable-javascript --enable-libmpv-shared --enable-lua --enable-libarchive --enable-uchardet --enable-libbluray --enable-dvdnav --disable-macos-media-player --disable-debug-build --lua=luajit --enable-vulkan --enable-libplacebo
[cplayer] List of enabled features: asm bsd-fstatfs build-date cocoa coreaudio cplayer cplugins dvdnav ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript lcms2 libarchive libass libavdevice libbluray libdl libm libmpv-shared libplacebo libplacebo-next lua luajit macos-10-11-2-features macos-10-11-features macos-10-12-2-features macos-10-12-features macos-10-14-6-features macos-10-14-features macos-10-15-4-features macos-cocoa-cb macos-touchbar optimize osx-thread-name plain-gl posix posix-or-mingw pthreads rubberband shaderc shaderc-shared spirv-cross spirv-cross-shared stdatomic swift uchardet vapoursynth vector videotoolbox-gl videotoolbox-hwaccel vulkan zimg zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'vo' = 'gpu-next' (flags = 8)
[cplayer] Setting option 'gpu-api' = 'vulkan' (flags = 8)
2022-02-28 10:44:23.923392+0800 mpv[47226:154973] [default] error finding potential wrapper bundle for node <FSNode 0x600000207720> { isDir = ?, path = '/Users/carter/mpv/build' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode}
[osx/cocoacb] Created CGL pixel format with attributes: kCGLPFAOpenGLProfile, kCGLOGLPVersion_3_2_Core, kCGLPFAAccelerated, kCGLPFADoubleBuffer, kCGLPFAColorSize, 64, kCGLPFAColorFloat, kCGLPFABackingStore, kCGLPFAAllowOfflineRenderers, kCGLPFASupportsAutomaticGraphicsSwitching, 0
[libmpv_render] GL_VERSION='4.1 Metal - 76.3'
[libmpv_render] Detected desktop OpenGL 4.1.
[libmpv_render] GL_VENDOR='Apple'
[libmpv_render] GL_RENDERER='Apple M1 Pro'
[libmpv_render] GL_SHADING_LANGUAGE_VERSION='4.10'
[libmpv_render] Loaded extension GL_APPLE_rgb_422.
[libmpv_render] GL_*_swap_control extension missing.
[libmpv_render] Testing FBO format rgba16f
[libmpv_render] Using FBO format rgba16f.
[libmpv_render] Disabling HDR peak computation (one or more of the following is not supported: compute shaders=0, SSBO=0).
[libmpv_render] No advanced processing required. Enabling dumb mode.
[libmpv_render] Loading hwdec driver 'videotoolbox'
[cplayer] Waiting for scripts...
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
[osd/libass] Shaper: FriBidi 1.0.11 (SIMPLE) HarfBuzz-ng 3.4.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider coretext
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[ifo_dvdnav] Opening /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4
[bdmv/bluray] Opening /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4
[file] Opening /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
[osd/libass] Shaper: FriBidi 1.0.11 (SIMPLE) HarfBuzz-ng 3.4.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider coretext
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[demux] Trying demuxers for level=normal.
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[file] stream level seek from 131072 to 522223646
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4
[find_files] Loading external files in /Users/carter/Downloads/
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 1
[cplayer] (+) Video --vid=1 (*) (hevc 3840x2160 60.000fps)
[cplayer] (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu-next] Probing for best GPU context.
[vo/gpu-next/vulkan] Initializing GPU context 'macosvk'
[vo/gpu-next/vulkan/libplacebo] Initialized libplacebo v4.192.0-40-gf911efb (API v199)
[vo/gpu-next/vulkan/libplacebo] Creating vulkan instance with extensions:
[vo/gpu-next/vulkan/libplacebo] VK_KHR_get_physical_device_properties2
[vo/gpu-next/vulkan/libplacebo] VK_KHR_surface
[vo/gpu-next/vulkan/libplacebo] VK_EXT_swapchain_colorspace
[vo/gpu-next/vulkan/libplacebo] VK_KHR_external_memory_capabilities
[vo/gpu-next/vulkan/libplacebo] VK_KHR_external_semaphore_capabilities
[vo/gpu-next/vulkan/libplacebo] VK_KHR_surface
[vo/gpu-next/vulkan/libplacebo] VK_MVK_macos_surface
2022-02-28 10:44:26.256746+0800 mpv[47226:154973] [] [0x10504ea20] CVCGDisplayLink::setCurrentDisplay: 1
2022-02-28 10:44:26.256824+0800 mpv[47226:154973] [] [0x10504ea00] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x1] [CVCGDisplayLink: 0x10504ea20]
2022-02-28 10:44:26.256967+0800 mpv[47226:154973] [] [0x10504ea20] CVCGDisplayLink::setCurrentDisplay: 1
2022-02-28 10:44:26.256974+0800 mpv[47226:154973] [] [0x10504ea00] CVDisplayLinkStart
2022-02-28 10:44:26.256976+0800 mpv[47226:154973] [] [0x10504ea20] CVDisplayLink::start
[vo/gpu-next/mac] Falling back to nominal display refresh rate: 120.0
2022-02-28 10:44:26.257008+0800 mpv[47226:155205] [] [0x600002909b20] CVXTime::reset
[vo/gpu-next/mac] Couldn't create a high precision timer: 4
[vo/gpu-next/mac] Can't find an ambient light sensor
[vo/gpu-next/vulkan/libplacebo] Probing for vulkan devices:
[vo/gpu-next/vulkan/libplacebo] GPU 0: Apple M1 Pro (integrated)
[vo/gpu-next/vulkan/libplacebo] uuid: 00:00:10:6B:0C:02:03:EF:00:00:00:01:00:00:08:63
libc++abi: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
Process 47226 stopped
* thread #15, name = 'mpv/vo', stop reason = signal SIGABRT
frame #0: 0x00000001840899b8 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x1840899b8 <+8>: b.lo 0x1840899d8 ; <+40>
0x1840899bc <+12>: pacibsp
0x1840899c0 <+16>: stp x29, x30, [sp, #-0x10]!
0x1840899c4 <+20>: mov x29, sp
Target 0: (mpv) stopped.
(lldb) bt
* thread #15, name = 'mpv/vo', stop reason = signal SIGABRT
* frame #0: 0x00000001840899b8 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x00000001840bceb0 libsystem_pthread.dylib`pthread_kill + 288
frame #2: 0x0000000183ffa314 libsystem_c.dylib`abort + 164
frame #3: 0x0000000184079b50 libc++abi.dylib`abort_message + 132
frame #4: 0x000000018406af4c libc++abi.dylib`demangling_terminate_handler() + 308
frame #5: 0x0000000183f62150 libobjc.A.dylib`_objc_terminate() + 160
frame #6: 0x0000000184078ee4 libc++abi.dylib`std::__terminate(void (*)()) + 20
frame #7: 0x000000018407bc5c libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
frame #8: 0x000000018407bc08 libc++abi.dylib`__cxa_throw + 140
frame #9: 0x00000001840186bc libc++.1.dylib`std::__1::__throw_system_error(int, char const*) + 100
frame #10: 0x000000018400dcbc libc++.1.dylib`std::__1::mutex::lock() + 40
frame #11: 0x000000010df9ede0 libMoltenVK.dylib`MVKPhysicalDevice::getSurfaceSupport(unsigned int, MVKSurface*, unsigned int*) + 64
frame #12: 0x000000010df5b204 libMoltenVK.dylib`vkGetPhysicalDeviceSurfaceSupportKHR + 260
frame #13: 0x0000000100f133e4 libplacebo.199.dylib`pl_vulkan_choose_device + 872
frame #14: 0x0000000100f1384c libplacebo.199.dylib`pl_vulkan_create + 700
frame #15: 0x00000001000e041c mpv`ra_vk_ctx_init + 336
frame #16: 0x00000001000e1234 mpv`macos_vk_init + 260
frame #17: 0x00000001000bb638 mpv`ra_ctx_create + 328
frame #18: 0x00000001000d1228 mpv`gpu_ctx_create + 120
frame #19: 0x00000001000da924 mpv`preinit + 96
frame #20: 0x00000001000d9350 mpv`vo_thread + 112
frame #21: 0x00000001840bd240 libsystem_pthread.dylib`_pthread_start + 148
(lldb)
I also notice the warning [vo/gpu-next/mac] Couldn't create a high precision timer: 4 4 is KERN_INVALID_ARGUMENT
https://github.com/mpv-player/mpv/pull/7482/files#diff-99259b8c05144de771baa353e276ba6b1905e97a4bdc652e0d3529810af0aafeR71
$ otool -L build/mpv
build/mpv:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1856.105.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2113.20.111)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/opt/homebrew/opt/libdvdnav/lib/libdvdnav.4.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
/opt/homebrew/opt/libdvdread/lib/libdvdread.8.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/homebrew/opt/ffmpeg-iina/lib/libavutil.57.dylib (compatibility version 57.0.0, current version 57.17.100)
/opt/homebrew/opt/ffmpeg-iina/lib/libavcodec.59.dylib (compatibility version 59.0.0, current version 59.18.100)
/opt/homebrew/opt/ffmpeg-iina/lib/libavformat.59.dylib (compatibility version 59.0.0, current version 59.16.100)
/opt/homebrew/opt/ffmpeg-iina/lib/libswscale.6.dylib (compatibility version 6.0.0, current version 6.4.100)
/opt/homebrew/opt/ffmpeg-iina/lib/libavfilter.8.dylib (compatibility version 8.0.0, current version 8.24.100)
/opt/homebrew/opt/ffmpeg-iina/lib/libswresample.4.dylib (compatibility version 4.0.0, current version 4.3.100)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/mujs/lib/libmujs.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/little-cms2/lib/liblcms2.2.dylib (compatibility version 3.0.0, current version 3.13.0)
/opt/homebrew/opt/libarchive/lib/libarchive.13.dylib (compatibility version 20.0.0, current version 20.0.0)
/opt/homebrew/opt/libass/lib/libass.9.dylib (compatibility version 11.0.0, current version 11.3.0)
/opt/homebrew/opt/ffmpeg-iina/lib/libavdevice.59.dylib (compatibility version 59.0.0, current version 59.4.100)
/opt/homebrew/opt/libbluray/lib/libbluray.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/libplacebo-iina/lib/libplacebo.199.dylib (compatibility version 199.0.0, current version 199.0.0)
/opt/homebrew/opt/luajit-openresty/lib/libluajit-5.1.2.dylib (compatibility version 2.1.0, current version 2.1.0)
/opt/homebrew/opt/rubberband/lib/librubberband.2.dylib (compatibility version 2.0.0, current version 2.0.0)
@rpath/libshaderc_shared.1.dylib (compatibility version 1.0.0, current version 0.0.0)
@rpath/libspirv-cross-c-shared.0.dylib (compatibility version 0.0.0, current version 0.48.0)
/opt/homebrew/opt/uchardet/lib/libuchardet.0.dylib (compatibility version 0.0.0, current version 0.0.7)
/opt/homebrew/opt/vapoursynth/lib/libvapoursynth-script.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/homebrew/opt/vapoursynth/lib/libvapoursynth.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libvulkan.1.dylib (compatibility version 1.0.0, current version 1.3.204)
/opt/homebrew/opt/zimg/lib/libzimg.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1856.105.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1557.3.2)
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
/usr/lib/swift/libswiftAppKit.dylib (compatibility version 1.0.0, current version 109.0.0)
/usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 1300.0.46)
/usr/lib/swift/libswiftCoreData.dylib (compatibility version 1.0.0, current version 19.0.0, weak)
/usr/lib/swift/libswiftCoreFoundation.dylib (compatibility version 1.0.0, current version 14.0.0, weak)
/usr/lib/swift/libswiftCoreGraphics.dylib (compatibility version 1.0.0, current version 2.0.0)
/usr/lib/swift/libswiftCoreImage.dylib (compatibility version 1.0.0, current version 2.0.0, weak)
/usr/lib/swift/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0, weak)
/usr/lib/swift/libswiftDispatch.dylib (compatibility version 1.0.0, current version 11.0.0)
/usr/lib/swift/libswiftFoundation.dylib (compatibility version 1.0.0, current version 70.101.0)
/usr/lib/swift/libswiftIOKit.dylib (compatibility version 1.0.0, current version 1.0.0, weak)
/usr/lib/swift/libswiftMetal.dylib (compatibility version 1.0.0, current version 258.17.0, weak)
/usr/lib/swift/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 3.0.0)
/usr/lib/swift/libswiftQuartzCore.dylib (compatibility version 1.0.0, current version 3.0.0, weak)
/usr/lib/swift/libswiftXPC.dylib (compatibility version 1.0.0, current version 1.1.0, weak)
It does seem to be a molten-vk bug in the stacktrace. However plplay/libplacebo plays my video without issues
$ build/demos/plplay -v /Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4
Opening file: '/Users/carter/Downloads/hdr10+test_lake_2021_02_01.mp4'
Format: mov,mp4,m4a,3gp,3g2,mj2
Duration: 59.840 s
Found video track (stream 0)
Resolution: 3840 x 2160
FPS: 60.000000
Bitrate: 70248 kbps
Format: yuv420p10le
Initialized libplacebo v4.192.0-40-gf911efb (API v199)
Attempting to initialize API: SDL2 (vulkan)
Available instance version: 1.3.204
Available layers:
VK_LAYER_LUNARG_api_dump (v1.3.204)
VK_LAYER_KHRONOS_profiles (v1.3.204)
VK_LAYER_KHRONOS_validation (v1.3.204)
VK_LAYER_LUNARG_device_simulation (v1.3.204)
VK_LAYER_KHRONOS_synchronization2 (v1.3.204)
Enabling debug meta layer: VK_LAYER_KHRONOS_validation
Available instance extensions:
VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_metal_surface
VK_EXT_swapchain_colorspace
VK_MVK_macos_surface
VK_EXT_validation_features (via VK_LAYER_KHRONOS_validation)
Enabling debug report extension: VK_EXT_debug_utils
Creating vulkan instance with extensions:
VK_KHR_get_physical_device_properties2
VK_KHR_surface
VK_EXT_swapchain_colorspace
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_surface
VK_MVK_macos_surface
VK_EXT_debug_utils
and layers:
VK_LAYER_KHRONOS_validation
Probing for vulkan devices:
GPU 0: Apple M1 Pro (integrated)
uuid: 00:00:10:6B:0C:02:03:EF:00:00:00:01:00:00:08:63
Vulkan device properties:
Device Name: Apple M1 Pro
Device ID: 106b:c0203ef
Device UUID: 00:00:10:6B:0C:02:03:EF:00:00:00:01:00:00:08:63
Driver version: 10107
API version: 1.1.204
Queue families supported by device:
0: flags 0x7 num 1
1: flags 0x7 num 1
2: flags 0x7 num 1
3: flags 0x7 num 1
Using graphics queue 0
Available device extensions:
VK_KHR_16bit_storage
VK_KHR_8bit_storage
VK_KHR_bind_memory2
VK_KHR_create_renderpass2
VK_KHR_dedicated_allocation
VK_KHR_depth_stencil_resolve
VK_KHR_descriptor_update_template
VK_KHR_device_group
VK_KHR_driver_properties
VK_KHR_external_fence
VK_KHR_external_memory
VK_KHR_external_semaphore
VK_KHR_get_memory_requirements2
VK_KHR_imageless_framebuffer
VK_KHR_image_format_list
VK_KHR_maintenance1
VK_KHR_maintenance2
VK_KHR_maintenance3
VK_KHR_multiview
VK_KHR_portability_subset
VK_KHR_push_descriptor
VK_KHR_relaxed_block_layout
VK_KHR_sampler_mirror_clamp_to_edge
VK_KHR_sampler_ycbcr_conversion
VK_KHR_shader_draw_parameters
VK_KHR_shader_float16_int8
VK_KHR_shader_subgroup_extended_types
VK_KHR_storage_buffer_storage_class
VK_KHR_swapchain
VK_KHR_swapchain_mutable_format
VK_KHR_timeline_semaphore
VK_KHR_uniform_buffer_standard_layout
VK_KHR_variable_pointers
VK_EXT_debug_marker
VK_EXT_descriptor_indexing
VK_EXT_fragment_shader_interlock
VK_EXT_hdr_metadata
VK_EXT_host_query_reset
VK_EXT_image_robustness
VK_EXT_inline_uniform_block
VK_EXT_memory_budget
VK_EXT_post_depth_coverage
VK_EXT_private_data
VK_EXT_robustness2
VK_EXT_scalar_block_layout
VK_EXT_shader_stencil_export
VK_EXT_shader_viewport_index_layer
VK_EXT_subgroup_size_control
VK_EXT_texel_buffer_alignment
VK_EXT_texture_compression_astc_hdr
VK_EXT_vertex_attribute_divisor
VK_AMD_gpu_shader_half_float
VK_AMD_negative_viewport_height
VK_AMD_shader_image_load_store_lod
VK_AMD_shader_trinary_minmax
VK_IMG_format_pvrtc
VK_INTEL_shader_integer_functions2
VK_GOOGLE_display_timing
VK_NV_glsl_shader
Creating vulkan device with extensions:
VK_KHR_swapchain
VK_KHR_swapchain
VK_KHR_push_descriptor
VK_EXT_hdr_metadata
VK_EXT_host_query_reset
VK_KHR_image_format_list
VK_KHR_timeline_semaphore
VK_KHR_portability_subset
vk Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
using VkInstance: anon (0x13f822000)
vk Inserted device layer VK_LAYER_KHRONOS_validation (/usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib)
using VkInstance: anon (0x13f822000)
vk Using MTLEvent for Vulkan semaphores.
using VkDevice: anon (0x13f070018)
vk Created VkDevice to run on GPU Apple M1 Pro with the following 7 Vulkan extensions enabled:
VK_KHR_image_format_list v1
VK_KHR_portability_subset v1
VK_KHR_push_descriptor v2
VK_KHR_swapchain v70
VK_KHR_timeline_semaphore v2
VK_EXT_hdr_metadata v2
VK_EXT_host_query_reset v1
using VkDevice: anon (0x13f070018)
Memory heaps supported by device:
0: flags 0x1 size 16G
Memory types supported by device:
0: flags 0x1 heap 0
1: flags 0xf heap 0
2: flags 0xb heap 0
3: flags 0x11 heap 0
Memory summary: 0 used 0 res 0 alloc, efficiency 100.00%, utilization 100.00%
shaderc SPIR-V version 1.6 rev 1
Initialized SPIR-V compiler 'shaderc'
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not exportable
Handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT (0x10) is not importable
Minimum texel alignment: 48
GPU information:
GLSL version: 450 (vulkan)
max_shmem_size: 32768
max_group_threads: 1024
max_group_size[0]: 1024
max_group_size[1]: 1024
max_group_size[2]: 1024
subgroup_size: 32
min_gather_offset: -8
max_gather_offset: 7
Limits:
thread_safe: 1
callbacks: 1
max_buf_size: 18446744073709551615
max_ubo_size: 4294967295
max_ssbo_size: 4294967295
max_vbo_size: 18446744073709551615
max_mapped_size: 18446744073709551615
max_buffer_texels: 67108864
align_host_ptr: 0
max_tex_1d_dim: 16384
max_tex_2d_dim: 16384
max_tex_3d_dim: 2048
blittable_1d_3d: 1
buf_transfer: 1
align_tex_xfer_pitch: 1
align_tex_xfer_offset: 16
max_variable_comps: 0
max_constants: 18446744073709551615
max_pushc_size: 4096
align_vertex_stride: 4
max_dispatch[0]: 1073741824
max_dispatch[1]: 1073741824
max_dispatch[2]: 1073741824
fragment_queues: 1
compute_queues: 1
GPU texture formats:
NAME TYPE SIZE COMP CAPS EMU DEPTH HOST_BITS GLSL_TYPE GLSL_FMT FOURCC
r8 UNORM 1 R SsLRbBVutHWG n {8 0 0 0 } {8 0 0 0 } float r8 R8
r8s SNORM 1 R SsLRbBVutHWG n {8 0 0 0 } {8 0 0 0 } float r8_snorm
rg8 UNORM 2 RG SsLRbBVutHWG n {8 8 0 0 } {8 8 0 0 } vec2 rg8 GR88
rg8s SNORM 2 RG SsLRbBVutHWG n {8 8 0 0 } {8 8 0 0 } vec2 rg8_snorm
rgba8 UNORM 4 RGBA SsLRbBVutHWG n {8 8 8 8 } {8 8 8 8 } vec4 rgba8 AB24
rgba8s SNORM 4 RGBA SsLRbBVutHWG n {8 8 8 8 } {8 8 8 8 } vec4 rgba8_snorm
bgra8 UNORM 4 BGRA SsLRbBVutHWG n {8 8 8 8 } {8 8 8 8 } vec4 rgba8 AR24
rgb10a2 UNORM 4 RGBA SsLRbBVutHWG n {10 10 10 2 } {10 10 10 2 } vec4 rgb10_a2 AB30
r16 UNORM 2 R SsLRbBVutHWG n {16 0 0 0 } {16 0 0 0 } float r16 R16
r16hf FLOAT 2 R SsLRbBVutHWG n {16 0 0 0 } {16 0 0 0 } float r16f
r16s SNORM 2 R SsLRbBVutHWG n {16 0 0 0 } {16 0 0 0 } float r16_snorm
rg16 UNORM 4 RG SsLRbBVutHWG n {16 16 0 0 } {16 16 0 0 } vec2 rg16 GR32
rg16hf FLOAT 4 RG SsLRbBVutHWG n {16 16 0 0 } {16 16 0 0 } vec2 rg16f
rg16s SNORM 4 RG SsLRbBVutHWG n {16 16 0 0 } {16 16 0 0 } vec2 rg16_snorm
rgba16 UNORM 8 RGBA SsLRbBVutHWG n {16 16 16 16} {16 16 16 16} vec4 rgba16
rgba16hf FLOAT 8 RGBA SsLRbBVutHWG n {16 16 16 16} {16 16 16 16} vec4 rgba16f AB4H
rgba16s SNORM 8 RGBA SsLRbBVutHWG n {16 16 16 16} {16 16 16 16} vec4 rgba16_snorm
r32f FLOAT 4 R SsLRbBVutHWG n {32 0 0 0 } {32 0 0 0 } float r32f
rg32f FLOAT 8 RG SsLRbBVutHWG n {32 32 0 0 } {32 32 0 0 } vec2 rg32f
rgba32f FLOAT 16 RGBA SsLRbBVutHWG n {32 32 32 32} {32 32 32 32} vec4 rgba32f
r8i SINT 1 R Ss-R-BVutHWG n {8 0 0 0 } {8 0 0 0 } int r8i
r8u UINT 1 R Ss-R-BVutHWG n {8 0 0 0 } {8 0 0 0 } uint r8ui
rg8i SINT 2 RG Ss-R-BVutHWG n {8 8 0 0 } {8 8 0 0 } ivec2 rg8i
rg8u UINT 2 RG Ss-R-BVutHWG n {8 8 0 0 } {8 8 0 0 } uvec2 rg8ui
rgba8i SINT 4 RGBA Ss-R-BVutHWG n {8 8 8 8 } {8 8 8 8 } ivec4 rgba8i
rgba8u UINT 4 RGBA Ss-R-BVutHWG n {8 8 8 8 } {8 8 8 8 } uvec4 rgba8ui
r16i SINT 2 R Ss-R-BVutHWG n {16 0 0 0 } {16 0 0 0 } int r16i
r16u UINT 2 R Ss-R-BVutHWG n {16 0 0 0 } {16 0 0 0 } uint r16ui
rg16i SINT 4 RG Ss-R-BVutHWG n {16 16 0 0 } {16 16 0 0 } ivec2 rg16i
rg16u UINT 4 RG Ss-R-BVutHWG n {16 16 0 0 } {16 16 0 0 } uvec2 rg16ui
rgba16i SINT 8 RGBA Ss-R-BVutHWG n {16 16 16 16} {16 16 16 16} ivec4 rgba16i
rgba16u UINT 8 RGBA Ss-R-BVutHWG n {16 16 16 16} {16 16 16 16} uvec4 rgba16ui
r32i SINT 4 R Ss-R-BVutHWG n {32 0 0 0 } {32 0 0 0 } int r32i
r32u UINT 4 R Ss-R-BVutHWG n {32 0 0 0 } {32 0 0 0 } uint r32ui
rg32i SINT 8 RG Ss-R-BVutHWG n {32 32 0 0 } {32 32 0 0 } ivec2 rg32i
rg32u UINT 8 RG Ss-R-BVutHWG n {32 32 0 0 } {32 32 0 0 } uvec2 rg32ui
rgba32i SINT 16 RGBA Ss-R-BVutHWG n {32 32 32 32} {32 32 32 32} ivec4 rgba32i
rgba32u UINT 16 RGBA Ss-R-BVutHWG n {32 32 32 32} {32 32 32 32} uvec4 rgba32ui
rgb10a2u UINT 4 RGBA Ss-R-B-utHWG n {10 10 10 2 } {10 10 10 2 } uvec4 rgb10_a2ui
a1bgr5 UNORM 2 ABGR S-LRbB-u-H-G n {1 5 5 5 } {1 5 5 5 } vec4 RA15
abgr4 UNORM 2 ABGR S-LRbB-u-H-G n {4 4 4 4 } {4 4 4 4 } vec4 RA12
bgr5a1 UNORM 2 BGRA S-LRbB-u-H-G n {5 5 5 1 } {5 5 5 1 } vec4 AR15
bgr565 UNORM 2 BGR S-LRbB-u-H-G n {5 6 5 0 } {5 6 5 0 } vec3 RG16
bgr10a2 UNORM 4 BGRA S-LRbB-u-H-G n {10 10 10 2 } {10 10 10 2 } vec4 AR30
rgb8i SINT 3 RGB ------V--H-- n {8 8 8 0 } {8 8 8 0 } ivec3
rgb8s SNORM 3 RGB ------V--H-- n {8 8 8 0 } {8 8 8 0 } vec3
rgb8u UINT 3 RGB ------V--H-- n {8 8 8 0 } {8 8 8 0 } uvec3
rgb10a2s SNORM 4 RGBA ------V--H-- n {10 10 10 2 } {10 10 10 2 } vec4
rgb16hf FLOAT 6 RGB ------V--H-- n {16 16 16 0 } {16 16 16 0 } vec3
rgb16i SINT 6 RGB ------V--H-- n {16 16 16 0 } {16 16 16 0 } ivec3
rgb16s SNORM 6 RGB ------V--H-- n {16 16 16 0 } {16 16 16 0 } vec3
rgb16u UINT 6 RGB ------V--H-- n {16 16 16 0 } {16 16 16 0 } uvec3
rgb32f FLOAT 12 RGB ------V--H-- n {32 32 32 0 } {32 32 32 0 } vec3
rgb32i SINT 12 RGB ------V--H-- n {32 32 32 0 } {32 32 32 0 } ivec3
rgb32u UINT 12 RGB ------V--H-- n {32 32 32 0 } {32 32 32 0 } uvec3
a1rgb5 UNORM 2 ARGB ---------H-- n {1 5 5 5 } {1 5 5 5 } BA15
gr4 UNORM 1 GR ---------H-- n {4 4 0 0 } {4 4 0 0 }
argb4 UNORM 2 ARGB ---------H-- n {4 4 4 4 } {4 4 4 4 } BA12
rgb565 UNORM 2 RGB ---------H-- n {5 6 5 0 } {5 6 5 0 } BG16
bgr8 UNORM 3 BGR ---------H-- n {8 8 8 0 } {8 8 8 0 } RG24
bgr8i SINT 3 BGR ---------H-- n {8 8 8 0 } {8 8 8 0 }
bgr8u UINT 3 BGR ---------H-- n {8 8 8 0 } {8 8 8 0 }
bgra8i SINT 4 BGRA ---------H-- n {8 8 8 8 } {8 8 8 8 }
bgra8u UINT 4 BGRA ---------H-- n {8 8 8 8 } {8 8 8 8 }
rgb10a2i SINT 4 RGBA ---------H-- n {10 10 10 2 } {10 10 10 2 }
bgr10a2i SINT 4 BGRA ---------H-- n {10 10 10 2 } {10 10 10 2 }
bgr10a2s SNORM 4 BGRA ---------H-- n {10 10 10 2 } {10 10 10 2 }
bgr10a2u UINT 4 BGRA ---------H-- n {10 10 10 2 } {10 10 10 2 }
rgb8 UNORM 3 RGB SsLRbBV--HWG y {8 8 8 0 } {8 8 8 0 } vec3 rgba8 BG24
rgb16 UNORM 6 RGB SsLRbBV--HWG y {16 16 16 0 } {16 16 16 0 } vec3 rgba16
r16f FLOAT 4 R SsLRbB---HWG y {16 0 0 0 } {32 0 0 0 } r16f
rg16f FLOAT 8 RG SsLRbB---HWG y {16 16 0 0 } {32 32 0 0 } rg16f
rgba16f FLOAT 16 RGBA SsLRbB---HWG y {16 16 16 16} {32 32 32 32} rgba16f
rgb16f FLOAT 12 RGB ---------H-- y {16 16 16 0 } {32 32 32 0 }
Available surface configurations:
0: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
1: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
2: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
3: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
4: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
5: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
6: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
7: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
8: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
9: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
10: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
11: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
12: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
13: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
14: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT
15: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_BT709_NONLINEAR_EXT
16: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_BT709_NONLINEAR_EXT
17: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_BT709_NONLINEAR_EXT
18: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
19: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
20: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
21: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
22: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
23: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
24: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
25: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_PASS_THROUGH_EXT
26: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_PASS_THROUGH_EXT
27: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_PASS_THROUGH_EXT
28: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_PASS_THROUGH_EXT
29: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_PASS_THROUGH_EXT
30: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
31: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
32: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
33: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
34: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
35: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
36: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
37: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
38: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
39: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
40: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
41: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
42: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
43: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
44: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
45: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_BT2020_LINEAR_EXT
46: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_BT2020_LINEAR_EXT
47: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_BT2020_LINEAR_EXT
48: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_BT2020_LINEAR_EXT
49: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_BT2020_LINEAR_EXT
50: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_HDR10_HLG_EXT
51: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_HDR10_HLG_EXT
52: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_HDR10_HLG_EXT
53: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_HDR10_HLG_EXT
54: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_HDR10_HLG_EXT
55: VK_FORMAT_B8G8R8A8_UNORM VK_COLOR_SPACE_HDR10_ST2084_EXT
56: VK_FORMAT_B8G8R8A8_SRGB VK_COLOR_SPACE_HDR10_ST2084_EXT
57: VK_FORMAT_R16G16B16A16_SFLOAT VK_COLOR_SPACE_HDR10_ST2084_EXT
58: VK_FORMAT_A2B10G10R10_UNORM_PACK32 VK_COLOR_SPACE_HDR10_ST2084_EXT
59: VK_FORMAT_A2R10G10B10_UNORM_PACK32 VK_COLOR_SPACE_HDR10_ST2084_EXT
Picked surface configuration 28: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT
Picked surface configuration 58: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT
Requested alpha compositing mode: VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
Requested surface transform: VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
Requested image count: 4 (min 2 max 3)
Requested image size: 3840x2160 (min 1x1 < cur 1728x1051 < max 16384x16384)
(Re)creating swapchain of size 3840x2160
vk Created 3 swapchain images with initial size (3840, 2160).
using VkSwapchainKHR: anon (0x13f060e00)
Allocating 131072 memory of type 0x1 (id 0) in heap 0
Allocating 524352 memory of type 0xf (id 1) in heap 0
Codec: hevc (HEVC (High Efficiency Video Coding))
Using software decoding
Allocating 66863232 memory of type 0xf (id 1) in heap 0
Allocating 33456384 memory of type 0xf (id 1) in heap 0
Allocating 133726464 memory of type 0xf (id 1) in heap 0
Allocating 133825536 memory of type 0xf (id 1) in heap 0
Allocating 267452928 memory of type 0xf (id 1) in heap 0
(Re)creating 3840x2160x0 texture with format r16
Allocating 16588800 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 3840x2160x0 texture with format r16
Allocating 16588800 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format r16
Allocating 4147200 memory of type 0x1 (id 0) in heap 0
(Re)creating 3840x2160x0 texture with format rgba16hf
Allocating 66355200 memory of type 0x1 (id 0) in heap 0
(Re)creating 1920x1080x0 texture with format rg16
Allocating 8294400 memory of type 0x1 (id 0) in heap 0
vertex shader source:
[ 1] #version 450
[ 2] #extension GL_KHR_shader_subgroup_basic : enable
[ 3] #extension GL_KHR_shader_subgroup_vote : enable
[ 4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[ 5] #extension GL_KHR_shader_subgroup_ballot : enable
[ 6] #extension GL_KHR_shader_subgroup_shuffle : enable
[ 7] #extension GL_ARB_texture_gather : enable
[ 8] layout(std430, push_constant) uniform PushC {
[ 9] layout(offset=0) float _const_2_0;
[ 10] layout(offset=4) float _const_2_1;
[ 11] };
[ 12] layout(binding=0) uniform sampler2D _src_tex_0_0;
[ 13] layout(binding=1) uniform sampler2D _src_tex_0_1;
[ 14] layout(location=0) in vec2 _tex_coord_1_0_v;
[ 15] layout(location=0) out vec2 _tex_coord_1_0;
[ 16] layout(location=1) in vec2 _tex_coord_1_1_v;
[ 17] layout(location=1) out vec2 _tex_coord_1_1;
[ 18] layout(location=2) in vec2 _position_4_0_v;
[ 19] void main() {
[ 20] _tex_coord_1_0 = _tex_coord_1_0_v;
[ 21] _tex_coord_1_1 = _tex_coord_1_1_v;
[ 22] vec2 va_pos = _position_4_0_v;
[ 23] gl_Position = vec4(va_pos, 0.0, 1.0);
[ 24] }
shaderc compile status 'success' (0 errors, 0 warnings)
Spent 161.987 ms translating SPIR-V (slow!)
fragment shader source:
[ 1] #version 450
[ 2] #extension GL_KHR_shader_subgroup_basic : enable
[ 3] #extension GL_KHR_shader_subgroup_vote : enable
[ 4] #extension GL_KHR_shader_subgroup_arithmetic : enable
[ 5] #extension GL_KHR_shader_subgroup_ballot : enable
[ 6] #extension GL_KHR_shader_subgroup_shuffle : enable
[ 7] #extension GL_ARB_texture_gather : enable
[ 8] layout(std430, push_constant) uniform PushC {
[ 9] layout(offset=0) float _const_2_0;
[ 10] layout(offset=4) float _const_2_1;
[ 11] };
[ 12] layout(binding=0) uniform sampler2D _src_tex_0_0;
[ 13] layout(binding=1) uniform sampler2D _src_tex_0_1;
[ 14] layout(location=0) in vec2 _tex_coord_1_0;
[ 15] layout(location=1) in vec2 _tex_coord_1_1;
[ 16] layout(location=0) out vec4 out_color;
[ 17]
[ 18] vec4 _sub_3_0() {
[ 19] // pl_shader_sample_direct
[ 20] vec4 color = vec4(_const_2_1) * texture(_src_tex_0_1, _tex_coord_1_1);
[ 21] return color;
[ 22] }
[ 23]
[ 24] vec4 _main_5_0() {
[ 25] vec4 tmp;
[ 26] // pl_shader_sample_direct
[ 27] vec4 color = vec4(_const_2_0) * texture(_src_tex_0_0, _tex_coord_1_0);
[ 28] tmp = _sub_3_0();
[ 29] color[1] = tmp[0];
[ 30] return color;
[ 31] }
[ 32]
[ 33] void main() {
[ 34] out_color = _main_5_0();
[ 35] }
shaderc compile status 'success' (0 errors, 0 warnings)
Spent 1.217 ms translating SPIR-V
Spent 0.063 ms compiling shader
Spent 0.750 ms creating pipeline
Pass statistics: size 4343, SPIR-V: vert 848 frag 988 comp 0
Allocating 262144 memory of type 0xf (id 1) in heap 0
LUT cache invalidated, regenerating..
Allocating 2048 memory of type 0x1 (id 0) in heap 0
Allocating 262144 memory of type 0xf (id 1) in heap 0
(Re)creating 1920x2160x0 texture with format rg16hf
Allocating 16588800 memory of type 0x1 (id 0) in heap 0
...
libplacebo build flags
2022-02-28 02:07:57 +0000
meson
--prefix=/opt/homebrew/Cellar/libplacebo-iina/HEAD-f911efb
--libdir=/opt/homebrew/Cellar/libplacebo-iina/HEAD-f911efb/lib
--buildtype=release
--wrap-mode=nofallback
..
-Dvulkan-registry=/usr/local/share/vulkan/registry/vk.xml
The Meson build system
Version: 0.61.2
Source dir: /private/tmp/libplacebo-iina-20220228-41111-1j7rglu
Build dir: /private/tmp/libplacebo-iina-20220228-41111-1j7rglu/build
Build type: native build
Project name: libplacebo
Project version: 4.199.0
C compiler for the host machine: /usr/bin/clang (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.30)")
C linker for the host machine: /usr/bin/clang ld64 711
C++ compiler for the host machine: /usr/bin/clang++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.30)")
C++ linker for the host machine: /usr/bin/clang++ ld64 711
Host machine cpu family: aarch64
Host machine cpu: arm64
Compiler for C supports arguments -Wincompatible-pointer-types: YES
Compiler for C supports link arguments -Wl,--exclude-libs=ALL: NO
Program python3 found: YES (/opt/homebrew/Cellar/meson/0.61.2/libexec/bin/python3.10)
WARNING: Python files installed by Meson might not be found by python interpreter.
This warning can be avoided by setting "python.platlibdir" option.
WARNING: Python files installed by Meson might not be found by python interpreter.
This warning can be avoided by setting "python.purelibdir" option.
Library m found: YES
Run-time dependency threads found: YES
Header <pthread.h> has symbol "pthread_condattr_setclock" with dependency threads: NO
Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
Run-time dependency vulkan found: YES 1.3.204.0
Found CMake: /opt/homebrew/bin/cmake (3.22.2)
Run-time dependency epoxy found: NO (tried pkgconfig, framework and cmake)
Run-time dependency shaderc found: YES 2022.1.1
Run-time dependency spirv-cross-c-shared found: YES 0.48.0
Library version found: NO
Check usable header "d3d11_4.h" : NO
Run-time dependency libunwind found: NO (tried pkgconfig, framework and cmake)
Has header "execinfo.h" : YES
Library execinfo found: NO
Message: Skipping `glslang` because `shaderc` is available
Run-time dependency lcms2 found: YES 2.13
Configuring config.h using configuration
Configuring config_internal.h using configuration
Run-time dependency glfw3 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency sdl2 found: YES 2.0.20
Run-time dependency sdl2_image found: YES 2.0.5
Dependency threads found: YES unknown (cached)
Run-time dependency libavcodec found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libavformat found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libavutil found: NO (tried pkgconfig, framework and cmake)
Has header "nuklear.h" : YES
Configuring config_demos.h using configuration
Build targets in project: 8
libplacebo 4.199.0
User defined options
buildtype : release
libdir : /opt/homebrew/Cellar/libplacebo-iina/HEAD-f911efb/lib
prefix : /opt/homebrew/Cellar/libplacebo-iina/HEAD-f911efb
wrap_mode : nofallback
vulkan-registry: /usr/local/share/vulkan/registry/vk.xml
Found ninja-1.10.2 at /opt/homebrew/bin/ninja
mpv build flags
$ ./waf configure --enable-javascript --enable-libmpv-shared --enable-lua --enable-libarchive --enable-uchardet --enable-libbluray --enable-dvdnav --disable-macos-media-player --disable-debug-build --lua=luajit --enable-vulkan --enable-libplacebo --enable-sdl2
Setting top to : /Users/carter/mpv
Setting out to : /Users/carter/mpv/build
Checking for waf version in 1.8.4-2.1.0 : ok
Checking for program 'cc' : /usr/bin/cc
Checking for program 'pkg-config' : /opt/homebrew/bin/pkg-config
Checking for program 'ar' : /usr/bin/ar
Checking for program 'rst2html' : /opt/homebrew/bin/rst2html
Checking for program 'rst2man' : /opt/homebrew/bin/rst2man
Checking for program 'rst2pdf' : not found
Checking for program 'windres' : not found
Checking for program 'perl' : /usr/bin/perl
Checking for 'clang' (C compiler) : /usr/bin/cc
Detected target OS: : os-darwin
Checking for macOS SDK : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk (version found: 12.1)
Checking for swift (Swift compiler) : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Checking for dynamic Swift Library : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx
Checking for static Swift Library : not found
Checking for compiler flags -std=c11 : yes
Checking for compiler flags -Werror -Werror=implicit-function-declaration : yes
Checking for compiler flags -Werror -Wno-error=deprecated-declarations : yes
Checking for compiler flags -Werror -Wno-error=unused-function : yes
Checking for compiler flags -Werror -Wempty-body : yes
Checking for compiler flags -Werror -Wdisabled-optimization : yes
Checking for compiler flags -Werror -Wstrict-prototypes : yes
Checking for compiler flags -Werror -Wno-format-zero-length : yes
Checking for compiler flags -Werror -Werror=format-security : yes
Checking for compiler flags -Werror -Wno-redundant-decls : yes
Checking for compiler flags -Werror -Wvla : yes
Checking for compiler flags -Werror -Wno-format-truncation : no
Checking for compiler flags -Werror -Wimplicit-fallthrough : yes
Checking for compiler flags -Werror -fno-math-errno : yes
Checking for LGPL (version 2.1 or later) build : disabled
Checking for GPL (version 2 or later) build : yes
Checking for mpv CLI player : yes
Checking for shared library : yes
Checking for static library : disabled
Checking for static build : disabled
Checking for whether to include binary compile time : yes
Checking for whether to optimize : yes
Checking for whether to compile-in debugging information : disabled
Checking for unit tests (development only) : disabled
Checking for enable ta leak report by default (development only) : disabled
Checking for manpage generation : yes
Checking for html manual generation : disabled
Checking for pdf manual generation : disabled
Checking for dynamic loader : yes
Checking for C plugins : yes
Checking for inline assembly (currently without effect) : yes
Checking for GCC vector instructions : yes
Checking for generate a clang compilation database : disabled
Checking for static Swift linking : disabled
Checking for compiler support for noexecstack : no
Checking for linker support for --nxcompat --no-seh --dynamicbase : no
Checking for -lm : yes
Checking for MinGW : os-win32 not found
Checking for POSIX environment : yes
Checking for Android environment : no
Checking for tvOS environment : no
Checking for Android EGL support : android not found
Checking for development environment : yes
Checking for macOS Swift build tools : yes (version found: 5.5.2)
Checking for Universal Windows Platform : disabled
Checking for win32 desktop APIs : os-win32 not found
Checking for internal pthread wrapper for win32 (Vista+) : posix found
Checking for POSIX threads : yes
Checking for pthread runtime debugging wrappers : disabled
Checking for C11 stdatomic.h : yes
Checking for linking with -lrt : no
Checking for iconv : yes
Checking for w32/dos paths : os-win32 not found
Checking for glob() POSIX support : yes
Checking for glob() win32 replacement : posix found
Checking for any glob() support : yes
Checking for vt.h : no
Checking for consio.h : no
Checking for gbm.h : no
Checking for GLIBC API for setting thread name : no
Checking for OSX API for setting thread name : yes
Checking for BSD API for setting thread name : osx-thread-name found
Checking for BSD's fstatfs() : yes
Checking for Linux's fstatfs() : os-linux not found
Checking for Linux's input-event-codes.h : no
Checking for Lua : yes (version found: luajit)
Checking for Javascript (MuJS backend) : yes
Checking for SSA/ASS support : yes
Checking for zlib : yes
Checking for Bluray support : yes
Checking for dvdnav support : yes
Checking for cdda support (libcdio) : disabled
Checking for uchardet support : yes
Checking for librubberband support : yes
Checking for libzimg support (high quality software scaler) : yes
Checking for LCMS2 support : yes
Checking for VapourSynth filter bridge : yes
Checking for libarchive wrapper for reading zip files and more : yes
Checking for DVB input module : disabled
Checking for SDL2 : yes
Checking for SDL2 gamepad input : yes
Checking for FFmpeg library : yes
Checking for libavdevice : yes
Checking for SDL2 audio output : yes
Checking for OSSv4 audio output : no
Checking for PipeWire audio output : no ('libpipewire-0.3 >= 0.3.0' not found)
Checking for sndio audio input/output : disabled
Checking for PulseAudio audio output : no ('libpulse >= 1.0' not found)
Checking for JACK audio output : no ('jack' not found)
Checking for OpenAL audio output : disabled
Checking for OpenSL ES audio output : no
Checking for ALSA audio output : no ('alsa >= 1.0.18' not found)
Checking for CoreAudio audio output : yes
Checking for AudioUnit output for iOS : no
Checking for WASAPI audio output : os-win32 not found
Checking for SDL2 video output : yes
Checking for Cocoa : yes
Checking for DRM : vt.h not found
Checking for GBM : gbm.h not found
Checking for wayland-scanner : no
Checking for wayland-protocols : no ('wayland-protocols >= 1.15' not found)
Checking for Wayland : wayland-protocols not found
Checking for Linux's memfd_create() : wayland not found
Checking for X11 : no ('x11 >= 1.0.0 xscrnsaver >= 1.0.0 xext >= 1.0.0 xinerama >= 1.0.0 xrandr >= 1.2.0' not found)
Checking for Xv video output : x11 not found
Checking for OpenGL Cocoa Backend : yes
Checking for OpenGL X11/GLX (deprecated/legacy) : disabled
Checking for Raspberry Pi support : disabled
Checking for EGL 1.4 : no ('egl' not found)
Checking for OpenGL X11 EGL Backend : x11 not found
Checking for OpenGL DRM EGL Backend : drm not found
Checking for OpenGL Wayland Backend : wayland not found
Checking for OpenGL Win32 Backend : win32-desktop not found
Checking for OpenGL/DirectX Interop Backend : gl-win32 not found
Checking for OpenGL ANGLE headers : os-win32 not found
Checking for OpenGL Win32 ANGLE Library : egl-angle not found
Checking for OpenGL Win32 ANGLE Backend : egl-angle not found
Checking for VDPAU acceleration : x11 not found
Checking for VDPAU with OpenGL/X11 : vdpau not found
Checking for VAAPI acceleration : x11 not found
Checking for VAAPI (X11 support) : vaapi not found
Checking for VAAPI (Wayland support) : vaapi not found
Checking for VAAPI (DRM/EGL support) : vaapi not found
Checking for VAAPI EGL on X11 : vaapi-x11 not found
Checking for VAAPI EGL : vaapi-x-egl not found
Checking for CACA : no ('caca >= 0.99.beta18' not found)
Checking for JPEG support : no
Checking for Direct3D support : win32-desktop not found
Checking for libshaderc SPIR-V compiler (shared library) : yes
Checking for libshaderc SPIR-V compiler (static library) : shaderc-shared found
Checking for libshaderc SPIR-V compiler : yes
Checking for SPIRV-Cross SPIR-V shader converter (shared library) : yes
Checking for SPIRV-Cross SPIR-V shader converter (static library) : spirv-cross-shared found
Checking for SPIRV-Cross SPIR-V shader converter : yes
Checking for Direct3D 11 video output : win32-desktop not found
Checking for iOS OpenGL ES hardware decoding interop support : no
Checking for OpenGL without platform-specific code (e.g. for libmpv) : yes
Checking for OpenGL context support : yes
Checking for libplacebo support : yes
Checking for libplacebo v4.199+, needed for vo_gpu_next : yes
Checking for Vulkan context support : yes
Checking for VAAPI Vulkan : vaapi not found
Checking for EGL helper functions : egl not found
Checking for Sixel : no ('libsixel >= 1.5' not found)
Checking for libavcodec videotoolbox hwaccel : yes
Checking for Videotoolbox with OpenGL : yes
Checking for D3D11VA hwaccel : os-win32 not found
Checking for DXVA2 hwaccel : d3d-hwaccel not found
Checking for OpenGL/DirectX Interop Backend DXVA2 interop : gl-dxinterop not found
Checking for CUDA Headers and dynamic loader : no ('ffnvcodec >= 8.2.15.7' not found)
Checking for CUDA acceleration : ffnvcodec not found
Checking for CUDA with graphics interop : cuda-hwaccel not found
Checking for Raspberry Pi MMAL hwaccel : rpi not found
Checking for w32 executable : os-win32 not found
Checking for macOS Touch Bar support : yes
Checking for macOS 10.11 SDK Features : yes
Checking for macOS 10.11.2 SDK Features : yes
Checking for macOS 10.12 SDK Features : yes
Checking for macOS 10.12.2 SDK Features : yes
Checking for macOS 10.14 SDK Features : yes
Checking for macOS 10.14.6 SDK Features : yes
Checking for macOS 10.15.4 SDK Features : yes
Checking for macOS Media Player support : disabled
Checking for macOS libmpv backend : yes
Adding conditional Swift flags: : yes
Writing configuration header: : config.h
'configure' finished successfully (3.092s)
OS: macOS 12.2.1
$ uname -a
Darwin litongzhoudeMBP 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64 arm64 MacBookPro18,1 Darwin
vulkan sdk: 1.3.204.0 https://vulkan.lunarg.com/sdk/home#mac
@Akemi @haasn Any suggestions?
no idea about both. the high precision warning should be negligible for now.
@CarterLi The crash is due to requesting the wrong surface extension (which results in the vulkan ICD loader failing to run the surface-creation function); it can be fixed with this patch:
diff --git a/video/out/vulkan/context_mac.m b/video/out/vulkan/context_mac.m
index 59b956d6d7..139aa98960 100644
--- a/video/out/vulkan/context_mac.m
+++ b/video/out/vulkan/context_mac.m
@@ -51,7 +51,7 @@ static bool macos_vk_init(struct ra_ctx *ctx)
struct mpvk_ctx *vk = &p->vk;
int msgl = ctx->opts.probing ? MSGL_V : MSGL_ERR;
- if (!mpvk_init(vk, ctx, VK_MVK_MACOS_SURFACE_EXTENSION_NAME))
+ if (!mpvk_init(vk, ctx, VK_EXT_METAL_SURFACE_EXTENSION_NAME))
goto error;
p->vo_macos = [[MacCommon alloc] init:ctx->vo];
CC @Akemi ^.
(I do still get playback failures with this, though.)
with older moltenvk this was fine. they broke it, or rather changed the usage, and deprecated it afterwards. so it shouldn't be used anymore anyway.
if playback fails now, it's something moltenvk broke yet again. like so many things before. relying on this translations layer kinda feels more and more like a mistake.
[edit] i can't really work on anything right now, because i lack the time and the mac to properly test. buying a new mac is on my agenda but it still has to wait till october most likely. october is most likely also the point where i get some more free time again.
VK_MVK_macos_surface was for vkCreateMacOSSurfaceMVK, which this PR doesn't use. The correct extension for vkCreateMetalSurfaceEXT has always been VK_EXT_metal_surface. I'm guessing this worked previously because you were linking against MVK directly, rather than going through Vulkan-Loader? That or the Vulkan-Loader behavior has changed here.
The playback failures I was running into were specific to polar shaders, and likely regressed due to a change in libplacebo; see issue here for details: https://code.videolan.org/videolan/libplacebo/-/issues/206
i think i confused something here. i was thinking about the view and layer usage with VkMacOSSurfaceCreateInfoMVK which wasn't properly documented back then (it only mentioned the usage of an nsview and not the layer directly). that was before i used VkMetalSurfaceCreateInfoEXT and i probably simply forgot to also use VK_EXT_METAL_SURFACE_EXTENSION_NAME instead of VK_MVK_MACOS_SURFACE_EXTENSION_NAME. my bad.
I rebased (see rcombs/mac_vulkan) and vsync seems to be working fine on moltenvk 1.1.10 (SDK 1.3.216) from brew. With 24fps content and the display set to 48Hz, I consistently see a vsync ratio of 2.000 with low jitter. 10-bit also seems to be working fine.
the vsync problem i was seeing only occurred on my end after like ~20mins of continuous playback and not always. that only as a side note. there was also a slight color shift on some startups, which could be fixed by reiniting the vo.
the jitter should be significantly lower than on the libmpv backend, like ~0.00X instead of like ~0.0X(?).
at least auto-detecting 10bit shouldn't work because it's not implemented yet i believe (https://github.com/mpv-player/mpv/blob/master/video/out/vulkan/context.c#L234-L237).