mpv-player / mpv

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

egl: allow customizing egl config #14244

Closed ruihe774 closed 3 months ago

ruihe774 commented 4 months ago

This PR adds two options:

This allow users to customize swapchain format when using EGL.

github-actions[bot] commented 4 months ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1581067342.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1581069483.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1581074259.zip)
macOS * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1581067527.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1581067694.zip) * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1581067545.zip)
ruihe774 commented 4 months ago

cc @sfan5 @haasn

sfan5 commented 4 months ago

question: what's the usecase for float formats? where is it supported?

because my AMD system doesn't ``` ./build/mpv --force-window --idle --egl-output-format=rgba16f --msg-level=vo=trace --gpu-context=x11egl [vo/gpu-next/opengl] Initializing GPU context 'x11egl' [vo/gpu-next/x11] X11 opening display: :0.0 [vo/gpu-next/x11] X11 running at 1920x1080 (":0.0" => local display) [vo/gpu-next/x11] Detected wm supports NetWM. [vo/gpu-next/x11] Detected wm supports ABOVE state. [vo/gpu-next/x11] Detected wm supports BELOW state. [vo/gpu-next/x11] Detected wm supports FULLSCREEN state. [vo/gpu-next/x11] Detected wm supports SKIP_TASKBAR state. [vo/gpu-next/x11] Detected wm supports STICKY state. [vo/gpu-next/x11] Display 0 (HDMI-1): [0, 0, 1920, 1080] @ 60.000000 FPS [vo/gpu-next/x11] Current display FPS: 60.000000 [vo/gpu-next/opengl] EGL_VERSION=1.5 [vo/gpu-next/opengl] EGL_VENDOR=Mesa Project [vo/gpu-next/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES [vo/gpu-next/opengl] Trying to create Desktop OpenGL context. [vo/gpu-next/opengl] Could not choose EGLConfig for Desktop OpenGL! [vo/gpu-next/opengl] Trying to create GLES 2.x + context. [vo/gpu-next/opengl] Could not choose EGLConfig for GLES 2.x +! [vo/gpu-next/opengl] Could not create a GL context. [vo/gpu-next/x11] uninit ... [vo/gpu-next] Failed initializing any suitable GPU context! Error opening/initializing the VO window. Exiting... (Quit) ```
ruihe774 commented 4 months ago

question: what's the usecase for float formats? where is it supported? because my AMD system doesn't

It's not AMD; Wayland is required to use float formats; X11 EGL does not support them.

float formats are used by Wayland color management protocol to support compositor-side color management and HDR processing; though it is not supported by mpv (and major compositors) now.

sfan5 commented 4 months ago

It's not AMD; Wayland is required to use float formats; X11 EGL does not support them.

I see. I tested on a Wayland/Intel system I have and it supports rgba16f but not rgba16.

ruihe774 commented 4 months ago

it supports rgba16f but not rgba16.

Yep. Same as mine. Nothing bad to have support for some theoretically possible formats. The formats in this option list are also in the Vulkan surface format picking code of libplacebo, and I think they are there for reasons.

sfan5 commented 3 months ago

please rebase to move the documentation changes (docs: add docs for --egl-* options) into the commit that adds the option

also squashing opengl: make format packing & unpacking beautiful would make sense