History

video/out/gpu/context: prefer vulkan over opengl when reasonable

For most actual desktop users, vulkan should be the a superior experience over opengl as this point and our autoprobe should pick that. For linux users, vulkan on wayland is rapidly seeing improvements and is far ahead of egl. There is no sign of that changing anytime soon and working fifo is on the horizon, so really wayland users should just all be using vulkan from now on. For x11, there is not a big difference between using egl vs vulkan as far as I know and both work well. macOS already prefers the vulkan backend over the libmpv one anyways, and finally windows still defaults to d3d11. Probably virtually no one uses opengl on windows, but vulkan is reasonably common among windows users and it doesn't make any sense to prefer opengl over it. The two outliers here are Android and VK_KHR_display. On Android, vulkan drivers are probably just a total disaster and let's not put ourselves in that mess if there's no reason to. For VK_KHR_display, it actually works fine except for one really big problem: VT switching doesn't work. If you try it, enjoy losing all input and being forced to do a hard reboot. It might be fixable if you use logind or something, but the method of using signals like the drm context does won't work because VK_KHR_display uses render nodes not primary nodes. Also, the opengl drm context could support hdr in theory (some attempts were made but none succesful) so it is probably "better". Maybe. Anyways, for these two platforms, we still prefer opengl.

Dudemanguy committed 2 years ago

Commit 851df701 parent a8d91b01 file · +17 −14Browse files

Unified · Split

video/out/gpu/context.c+17−14
@@ -82,6 +82,22 @@ static const struct ra_ctx_fns *contexts[] = { · 81 unmodified lines
8282 &ra_ctx_d3d11,
8383 #endif
8484
85+// Vulkan contexts:
86+#if HAVE_VULKAN
87+#if HAVE_WIN32_DESKTOP
88+ &ra_ctx_vulkan_win,
89+#endif
90+#if HAVE_WAYLAND
91+ &ra_ctx_vulkan_wayland,
92+#endif
93+#if HAVE_X11
94+ &ra_ctx_vulkan_xlib,
95+#endif
96+#if HAVE_COCOA && HAVE_SWIFT
97+ &ra_ctx_vulkan_mac,
98+#endif
99+#endif
100+
85101 // OpenGL contexts:
86102 #if HAVE_EGL_ANDROID
87103 &ra_ctx_android,
@@ -108,27 +124,14 @@ static const struct ra_ctx_fns *contexts[] = { · 20 unmodified lines
108124 &ra_ctx_drm_egl,
109125 #endif
110126
111−// Vulkan contexts:
127+// Vulkan contexts (fallbacks):
112128 #if HAVE_VULKAN
113−
114129 #if HAVE_ANDROID
115130 &ra_ctx_vulkan_android,
116131 #endif
117−#if HAVE_WIN32_DESKTOP
118− &ra_ctx_vulkan_win,
119−#endif
120−#if HAVE_WAYLAND
121− &ra_ctx_vulkan_wayland,
122−#endif
123−#if HAVE_X11
124− &ra_ctx_vulkan_xlib,
125−#endif
126132 #if HAVE_VK_KHR_DISPLAY
127133 &ra_ctx_vulkan_display,
128134 #endif
129−#if HAVE_COCOA && HAVE_SWIFT
130− &ra_ctx_vulkan_mac,
131−#endif
132135 #endif
133136 };
134137

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t