mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.77k stars 2.86k forks source link

dxvkinterop #12539

Open Andarwinux opened 11 months ago

Andarwinux commented 11 months ago

https://github.com/mpv-player/mpv/labels/meta%3Afeature-request

Expected behavior of the wanted feature

using Vulkan for rendering and DXGI for presentation, just like dxinterop ref: https://evergine.com/directx-vulkan-interop https://github.com/malstraem/vulkan-interop-directx

Windows Vulkan WSI is shit

Neither Intel nor NVIDIA's Vulkan drivers expose any WCG/HDR surface format when not connected to any monitor (Cross Adapter Scan-Out), so winvk can't output WCG/HDR video in this case (target-colorspace-hint=yes), but everything works fine with d3d11

Additionally, Intel's Vulkan driver does not expose surfaces with

format = FORMAT_A2B10G10R10_UNORM_PACK32
colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR

in any case. Consequently, it is not possible to output WCG/HDR video when using winvk

The above problem is supposed to be a driver problem, but I've consulted with NVIDIA and Intel, and NVIDIA will not fix the problem, while Intel confirms the problem but does not indicate any fixes will be made

Therefore, this issue is both a bug report and a feature request.

Summarize the problems and potential new features that this feature could solve for MPV Windows Vulkan:

vulkaninfo

monitor connected to dGPU:

GPU id : 0 (NVIDIA GeForce RTX 3060 Laptop GPU):
        Surface type = VK_KHR_win32_surface
        Formats: count = 7
                SurfaceFormat[0]:
                        format = FORMAT_B8G8R8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[1]:
                        format = FORMAT_B8G8R8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[2]:
                        format = FORMAT_R8G8B8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[3]:
                        format = FORMAT_R8G8B8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[4]:
                        format = FORMAT_R16G16B16A16_SFLOAT
                        colorSpace = COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
                SurfaceFormat[5]:
                        format = FORMAT_A2B10G10R10_UNORM_PACK32
                        colorSpace = COLOR_SPACE_HDR10_ST2084_EXT
                SurfaceFormat[6]:
                        format = FORMAT_A2B10G10R10_UNORM_PACK32
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
GPU id : 1 (Intel(R) UHD Graphics):
        Surface type = VK_KHR_win32_surface
        Formats: count = 4
                SurfaceFormat[0]:
                        format = FORMAT_B8G8R8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[1]:
                        format = FORMAT_B8G8R8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[2]:
                        format = FORMAT_R8G8B8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[3]:
                        format = FORMAT_R8G8B8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR

monitor connected to iGPU:

GPU id : 0 (Intel(R) UHD Graphics):
        Surface type = VK_KHR_win32_surface
        Formats: count = 6
                SurfaceFormat[0]:
                        format = FORMAT_B8G8R8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[1]:
                        format = FORMAT_B8G8R8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[2]:
                        format = FORMAT_R8G8B8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[3]:
                        format = FORMAT_R8G8B8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[4]:
                        format = FORMAT_R16G16B16A16_SFLOAT
                        colorSpace = COLOR_SPACE_HDR10_ST2084_EXT
                SurfaceFormat[5]:
                        format = FORMAT_A2R10G10B10_UNORM_PACK32
                        colorSpace = COLOR_SPACE_HDR10_ST2084_EXT
GPU id : 1 (NVIDIA GeForce RTX 3060 Laptop GPU):
        Surface type = VK_KHR_win32_surface
        Formats: count = 5
                SurfaceFormat[0]:
                        format = FORMAT_B8G8R8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[1]:
                        format = FORMAT_B8G8R8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[2]:
                        format = FORMAT_R8G8B8A8_UNORM
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[3]:
                        format = FORMAT_R8G8B8A8_SRGB
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR
                SurfaceFormat[4]:
                        format = FORMAT_A2B10G10R10_UNORM_PACK32
                        colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR

kasper93 commented 10 months ago

Like I said in other issue, only after this https://code.videolan.org/videolan/libplacebo/-/merge_requests/507 is merged and integrated in mpv. Not worth to make things more complicated only to refactor it again next week.