dxinterop backend is broken after recent vo_gpu changes
mpv version and platform
Windows 10 May 2019 Update (Build 18362) Nvidia GTX 960 (441.08)
mpv 0.30.0-39-gfc29620ec8 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects built on Wed Oct 30 11:02:14 UTC 2019 ffmpeg library versions: libavutil 56.35.101 libavcodec 58.60.100 libavformat 58.33.100 libswscale 5.6.100 libavfilter 7.66.100 libswresample 3.6.100 ffmpeg version: N-95592-ga269fa044b
Reproduction steps
Open any video with --no-config --gpu-api=opengl --gpu-context=dxinterop
Expected behavior
It should work
Actual behavior
mpv crashes immediately
Log file
https://0x0.st/zYWx.log - fc29620 (broken) https://0x0.st/zYW3.log - b278360 (latest working)
Sample files
Reproducible with any video
I'm aware that dxinterop backend is obsolete and supposed to be superseded by d3d11 backend, but it was working just fine until now and I had no problems with it, so I hope this will be fixed.
Same here on Linux mpv-git with default VO and gpu-context.
Thanks for the log. Does it crash with --gpu-context=win as well?
Also, we should probably fix this bug regardless, but is there a reason why you're using dxinterop instead of d3d11? If it's because of bugs or performance issues with d3d11, it would be good to know, so we know what can be improved.
Thanks. Can confirm it works now. I forgot to check win backend as well.
@rossy
is there a reason why you're using dxinterop instead of d3d11?
I'm using dxinterop mostly because shaders compilation is very slow on any backends that recompile shaders (so it affects ANGLE and Vulkan as well). For example, I use igv's shaders and it takes about 3-4 seconds on my PC to compile each time I open any video and I only see white screen during this time, while using dxinterop the compilation is very fast and unnoticeable. Also, the player kinda hangs on window resizes, because compilation is slow. To avoid such issue, there is --gpu-shader-cache-dir option. But it raises another problem:
NOTE: This is not cleaned automatically, so old, unused cache files may stick around indefinitely.
In my experience, the folder with cached shaders was about 40 mb after a week of use, which is not a big waste, but potentially the size will increase indefinitely and it's kind of annoying.
Also, d3d11 and Vulkan require multiple external dependencies during compilation (shaderc, SPIRV-Cross, libplacebo etc.) and I prefer to have as less of them as possible.