-
Notifications
You must be signed in to change notification settings - Fork 923
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
Initial Support for DRM interface in vulkan backend #5908
base: trunk
Are you sure you want to change the base?
Conversation
Looking at those Vulkan functions, it seems important to know what |
I don't think we need a new function, just another variant in the unsafe enum, in which we can have an adapter passed. |
Please open a PR against the |
I think it would be more appropriate to pass a device rather than an adapter since the actual device isn't created until request_device is called. Would it also be logical to pass mode information here? I’m still figuring out what’s needed to choose the correct mode, but it’s clear that some sort of information must be provided. I the case of the device, it is also unclear to me how to obtain the raw vkPhysicalDevice from the generic Device struct
I've opened a PR here: rust-windowing/raw-window-handle#170. |
The passed File Descriptor should be the opened Note that you can already enumerate the available While Regarding |
if drm_props.primary_major == major.into() && drm_props.primary_minor == minor.into() { | ||
physical_device = Some(device); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before there can be >1 physical device for which this is true.
This pull request introduces initial support for the Linux DRM interface in wgpu. This enables wgpu to be utilized in environments where a windowing system is unavailable and, more importantly, allows wgpu to function as a renderer for Wayland compositors.
For additional context, please refer to issue #1674.
The implementation is straightforward, though there are known limitations due to my limited familiarity with wgpu internals:
Despite these issues, the code functions, and I demonstrated this by porting the hello_triangle example, available here: https://github.com/verdiwm/diretto/blob/main/examples/wgpu.rs
I also created a fork of raw-window-handle, adding the necessary connector_id for display initialization.
While this pull request is not ready for merging, I am submitting it to illustrate the feasibility of DRM support and to receive feedback from the wgpu development team.