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

Add a bitset that allows libraries to state what types of raw window/display handles are supported #155

Open
i509VCB opened this issue Nov 10, 2023 · 1 comment

Comments

@i509VCB
Copy link

i509VCB commented Nov 10, 2023

Sometimes there may be a situation where you need to ask a library what windowing systems it could support before initializing a library like winit. For example if running wgpu under renderdoc, the Wayland WSI will not be supported because renderdoc disables Wayland for Vulkan (since it is broken still). In this case it may be preferable to run under XWayland while still using Vulkan.

The proposal is to create a standard type that libraries like wgpu can return to let the application know if a different windowing backend may need to be chosen. A library like wgpu could return the type shown below from an Adapter so that the application can initialize the correct windowing backend before creating a surface.

In the case of wgpu this could become a part of AdapterInfo. Glutin's EGL backend could also use this to notify the user what handle types are supported as well (although this would probably apply to all APIs in the case of glutin).

The type would look something like this.

bitflags! {
    pub struct SupportedHandles {
        const WIN_32 = 1 << 0;

        const XLIB = 1 << 1;

        const WAYLAND = 1 << 2;

        // ... The rest
    }
}
@notgull
Copy link
Member

notgull commented Nov 11, 2023

I would be fine with this as long as there is a method to tell if a window handle matches that but set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants