-
Notifications
You must be signed in to change notification settings - Fork 439
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
Use ash::Entry instead of FunctionPointers #1876
Conversation
This is a change I wanted to make myself at some point, so good idea! Some comments though:
|
vulkano/src/instance/extensions.rs
Outdated
properties.set_len(num as usize); | ||
properties | ||
}; | ||
pub fn supported_by_core_with_loader(entry: &ash::Entry) -> Result<Self, OomError> { |
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.
Do we want to rename this function, now that we require ash::Entry
at all times?
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.
A while back, the way DeviceExtensions
is constructed was changed, so that supported extensions are now retrieved from PhysicalDevice
. Entry
(or whatever its new name will be) is a precursor to Instance
in much the same way that PhysicalDevice
is a precursor to Device
. So instance extensions could follow this model and be retrieved from the Entry
type.
Just some general questions before I move forward:
|
Backwards compatibility is not that important for the moment, as every release of Vulkano so far has breaking changes in it anyway. I think keeping them separate the way Ash does is good. That gives the user more control over how they want their application to behave, the same level of control that Ash now exposes. True, it means that loading a dynamic library is unsafe, but really it was unsafe all along. |
This looks good. There are some changes I'd like to make, but if you don't mind I'll make those myself in my own PR rather than burdening you with all the details. |
Thanks @Rua ! You can add me as a reviewer to that different PR too. |
The tests are failing, can you fix that please? |
Not sure why Windows was failing, both ash and vulkano should be using the same dll name which is |
Turns out the GitHub actions Windows and macOS environment does not have Vulkan installed. That make sense - macOS don't generally have MoltenVK installed. Line 19 in 741a506
Correct me if I'm wrong, but what this is saying is essentially: If we fail to load the vulkan library, or if instance creation fails for any reason, simply return from the test and mark it as success. So for those tests that failed - they should've failed a long time ago in #1437 but didn't. I can probably do something similar and maintain the current behavior, but this is a bug IMO and needs to be fixed. Either
This should probably be addressed in a separate PR. |
I ran into this problem in #1841 (comment), but it's not so easy to solve. In this PR, you can return with no error like before, and then make a new issue about it separately. |
@Neo-Zhixing Are you still interested in merging this? |
@Rua I don't have the time to fix all the unit tests so feel free to take this over or redo this. Thanks! |
@Neo-Zhixing I made an alternative implementation #1932, that takes some pieces from your PR but with a different approach. |
@Rua Thanks for the work to clean this up! I'll do some reviews too |
This PR removed
FunctionPointers
and the loader implementation in vulkano in favor of ash's implementation of the loader.Related: #1864