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

Slint + vulkano collaboration #6805

Open
burbokop opened this issue Nov 16, 2024 · 6 comments
Open

Slint + vulkano collaboration #6805

burbokop opened this issue Nov 16, 2024 · 6 comments
Labels
a:renderer-skia Skia Renderer (mS) api Changes or additions to APIs enhancement New feature or request

Comments

@burbokop
Copy link
Contributor

There is a rust example opengl_texture in the repo, showning how to collaborate with opengl. Is there a way to collaborate with vulkan though rust vulkano crate the same way as in this opengl example? If not, it would be good to have this ability because vulkan (vulkano) is more idiomatic and modern way to work with gpu then opengl. If yes, it would be good to add an official example.

@tronical tronical added enhancement New feature or request a:renderer-skia Skia Renderer (mS) api Changes or additions to APIs labels Nov 16, 2024
@tronical
Copy link
Member

Agreed. Besides the new API to select a renderer by features (where Vulkan need to be added), the big question is: how to represent the different typed needed in the GraphicsAPI enum? (Device, queue index, instance, etc)

@SuchAFuriousDeath
Copy link
Contributor

SuchAFuriousDeath commented Nov 17, 2024

Maybe you could create wrapper types around the types that slint uses internally and then have as_raw/into_raw methods on each.

The wrappers could also implement Rust conversion traits for converting into the types from the most common vulkan libraries like vulkano/ash and so on (Those could be hidden behind feature gates).

At a first glance, it seems that at least vulkano and ash allow constructing various things from raw handles (Vulkano considers the ash types as raw handles), so it could work:
https://docs.rs/vulkano/latest/vulkano/?search=from_handle
https://docs.rs/ash/latest/ash/index.html?search=from_raw

@tronical
Copy link
Member

I think you're right, passing the raw handles (u64?) should work.

@SuchAFuriousDeath
Copy link
Contributor

Somewhere usize might be more appropriate, not sure

@SuchAFuriousDeath
Copy link
Contributor

@tronical What exact values do we want to expose in the GraphicsAPI Vulkan variant?
I'm thinking of opening a PR - I currently got this to work with the renderer-skia-vulkan feature:

image
Selecting not done yet, but I think I know how to do that.

@tronical
Copy link
Member

Great :). Yeah, I think instance, physical device, logical device, queue, queue family index, get_proc_addr for instance and one for device. But I don't know how to best handle the drawable part....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:renderer-skia Skia Renderer (mS) api Changes or additions to APIs enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants