Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dxvkinterop #12539

Open
Andarwinux opened this issue Oct 2, 2023 · 1 comment
Open

dxvkinterop #12539

Andarwinux opened this issue Oct 2, 2023 · 1 comment

Comments

@Andarwinux
Copy link
Contributor

Andarwinux commented Oct 2, 2023

meta:feature-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:

  • CASO
    • WCG/HDR Output
    • GPU-PV(Hyper-V VM): Driver does not support VK_KHR_swapchain
    • Performance
  • DRR
    • Output frame rate will not locked to minimum when DRR enabled
    • A jittering solution with lower performance requirements than interpolation
    • Increased battery-powered device life
  • Multiple monitors
    • Solve vsync problem when playing on multiple monitors with different refresh rates
      On Windows SV3 DWM has been updated to allow per-monitor vsync timing
  • Runtime switching rendering backend
    • Users may dynamically switch rendering backends for some reason, e.g. on NVIDIA:
      d3d11 is good at all kinds of high frame rate/resolution video, but HDR peak detection performance is worse than vulkan
      vulkan can use native hwdec to play hevc rext video, and can also get much better peak detection performance than d3d11
  • Potential Performance Improvements
  • Windows Auto HDR
  • Flip-mode Presentation
  • Multi-Plane Overlay

Alternative behavior of the wanted feature

gpu-context=d3d11

Log file

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
Copy link
Contributor

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.

@Andarwinux Andarwinux changed the title vulkan rendering, with d3d swapchain dxvkinterop Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants