-
Notifications
You must be signed in to change notification settings - Fork 70
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
Linux: select between X11 and Wayland at runtime. #223
Comments
I can probably work on this, but not until in three or four days from now, as I will be busy. Will post PR if any positive results are achieved. |
My opinion on the above considerations:
|
I am also happy to work on this. My answer to the above questions is:
@SaschaWillems Does the database API support a single report having information for multiple surface backends? |
Issue #216 is relevant. |
Can you elaborate? How would that look like? It's a SQL database, so linear tables and a e.g. 1:n relation between a report and it's surface formats. |
So on Linux it is possible (and increasingly common) to run a wayland compositor with xwayland. This means that both native wayland connections and X connections (via xwayland) are possible at the same time. So right now on my laptop X surfaces support BGRA8_SRGB and BGRA8_UNORM. While Wayland surfaces support considerably more. There's no requirement that the X-supported formats are a subset of the wayland formats (or vice versa). It looks like the DB has merged my two reports into a single entry? https://vulkan.gpuinfo.org/listreports.php?submitter=Karen%20Webb |
Well, the database doesn't really support that scenario. The "merge" you see is the update logic that allows for certain attributes of a report to be updated for an already submitted report. |
Given the DB only supports a single set of surface capabilities for a device, would it be acceptable to just report wayland information where possible and X only when wayland isn't available? |
Sure, should be fine. |
Background
On Linux, there are two commonly used WSI platforms available: Wayland and X11 (note: X11 is available in Vulkan as both XCB and Xlib, but they can be considered "basically the same"). X11 has been the dominating WSI platform for some time, but Wayland is gaining momentum.
Problem
Currently the application is distributed as distinct binaries for Wayland and X11. This is impractical as users migrate from X11 to Wayland, and for other reasons.
Proposed solution
The application can test for Wayland presence by looking at the return value of
getenv("WAYLAND_DISPLAY")
. Based on the returned value, the application can create either awl_surface
or anxcb_surface_t
and use it as the basis forVkSurfaceKHR
creation. Ifwl_surface
creation fails, the application can fallback to XCB.Considerations
wl_surface
or anxcb_surface
? If it does, should we use them?dlopen
anddlsym
lookups.The text was updated successfully, but these errors were encountered: