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

[Feature request]: Allow specifying the physical device for Vulkan #48

Open
ilkecan opened this issue Feb 28, 2022 · 2 comments
Open

[Feature request]: Allow specifying the physical device for Vulkan #48

ilkecan opened this issue Feb 28, 2022 · 2 comments

Comments

@ilkecan
Copy link

ilkecan commented Feb 28, 2022

Please describe your feature request

What do you think about adding an option to specify the physical device for Vulkan? I have two on my system and the first one doesn't have the required extensions, so Vulkan can't initialize. It works fine if I change the code to use the second one.

let physical_devices = unsafe { instance.enumerate_physical_devices()? };
let physical_device = *physical_devices
.get(0)
.ok_or("Unable to find a physical device")?;

@maximbaz
Copy link
Owner

Thanks, truth be told I cut corners, hardcoded 0 and was waiting until someone asked for this, as I don't have a way to test it 😁

The correct approach is to query device capabilities and select the best device that supports everything we need.

Some examples:

If you would like to experiment and make a PR, let me know, it's very appreciated!

@ilkecan
Copy link
Author

ilkecan commented Feb 28, 2022

I will look into this. Thanks for the pointers.

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

No branches or pull requests

2 participants