-
Notifications
You must be signed in to change notification settings - Fork 196
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
Provide Vulkan library loader from custom path #319
Merged
MaikKlein
merged 1 commit into
ash-rs:master
from
MarijnS95:entry-load-dll-from-arbitrary-location
Aug 3, 2020
Merged
Provide Vulkan library loader from custom path #319
MaikKlein
merged 1 commit into
ash-rs:master
from
MarijnS95:entry-load-dll-from-arbitrary-location
Aug 3, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It is in some cases necessary to load a specific Vulkan dll/so with a different name and/or from a different location. Instead of copying this function to a downstream project (and making the LoadingError constructor public to retain the same interface), split Entry::new() such that downstream projects can easily specify and use an alternate Vulkan implementation.
MaikKlein
approved these changes
Aug 3, 2020
MarijnS95
added a commit
to Traverse-Research/ash
that referenced
this pull request
Mar 8, 2021
If a `&str` were to be passed this supposedly requires `AsRef<OsStr>` to be implemented for `str` instead of `&str`, leading to the inability to pass string literals: 18 | let entry = ash::Entry::with_library("foo")?; | ^^^^^ doesn't have a size known at compile-time | ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39 | 73 | pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> { | ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library` After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow. Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (ash-rs#319)")
MarijnS95
added a commit
to Traverse-Research/ash
that referenced
this pull request
Mar 8, 2021
All type parameters are implicitly bound by Sized; matching the `&` out of `&str` implies that `str` must be bound by `Sized` (and that `str` rather than `&str` implements `AsRef<OsStr>`) which is not true, resulting in: 18 | let entry = ash::Entry::with_library("foo")?; | ^^^^^ doesn't have a size known at compile-time | ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39 | 73 | pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> { | ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library` After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow, and `str` can't retrieve a borrow to itself. Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (ash-rs#319)")
MarijnS95
added a commit
to Traverse-Research/ash
that referenced
this pull request
Mar 8, 2021
All type parameters are implicitly bound by Sized; matching the `&` out of `&str` implies that `str` must be bound by `Sized` which is not true, resulting in: 18 | let entry = ash::Entry::with_library("foo")?; | ^^^^^ doesn't have a size known at compile-time | ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39 | 73 | pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> { | ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library` After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow, which is what this function is modeled after to pass the same parameter on directly. Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (ash-rs#319)")
MarijnS95
added a commit
to Traverse-Research/ash
that referenced
this pull request
Mar 8, 2021
All type parameters are implicitly bound by `Sized`; matching the `&` out of `&str` implies that `str` must be bound by `Sized` which is not true, resulting in: 18 | let entry = ash::Entry::with_library("foo")?; | ^^^^^ doesn't have a size known at compile-time | ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39 | 73 | pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> { | ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library` After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow, which is what this function is modeled after to pass the same parameter on directly. Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (ash-rs#319)")
MaikKlein
pushed a commit
that referenced
this pull request
Mar 8, 2021
All type parameters are implicitly bound by `Sized`; matching the `&` out of `&str` implies that `str` must be bound by `Sized` which is not true, resulting in: 18 | let entry = ash::Entry::with_library("foo")?; | ^^^^^ doesn't have a size known at compile-time | ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39 | 73 | pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> { | ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library` After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow, which is what this function is modeled after to pass the same parameter on directly. Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (#319)")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is in some cases necessary to load a specific Vulkan dll/so with a different name and/or from a different location. Instead of copying this function to a downstream project (and making the
LoadingError
constructor public to retain the same interface), splitEntry::new()
such that downstream projects can easily specify and use an alternate Vulkan implementation.