Open nyovaya opened 4 years ago
Instead of Vec
Vec
is available via the alloc
crate in no_std. You could cfg out the high level wrappers if you want no-alloc support as well.
I haven't looked at no_std at all yet. ash
also fetches all the function pointers at runtime, is that a problem for embedded devices?
Ok it seems like dynamic function loading is not trivial on no_std.
Dynamic function loading is intrinsic to Vulkan, minimal entry points aside.
Which "embedded devices" do you want to run vulkan on?
Dont have anything explicit in mind but I think it would be some device with an RTOS or with a statically linked vulkan driver.
Also, CStr
is only in libstd. Hopefully Rust gets better null-terminated strings eventually...
I do have some interest in this, there are few things I can think of to make moving towards being no_std capable (probably with alloc given we need dynamic function loading):
core
and alloc
instead of std
for imports where possible. This is a change that can be made without any api changes.I imagine there is more than those two things involved with no_std support.
probably with alloc given we need dynamic function loading
Loading functions does not require alloc.
probably with alloc given we need dynamic function loading
Loading functions does not require alloc.
Well I guess I am mistaken there.
I could make some pull requests to do some of the type import stuff for core and alloc if desired
To help with this, I am implementing the following clippy lint: https://github.com/rust-lang/rust-clippy/pull/9103
The lint should help us ensure we don't forget any types that could be specified in core or alloc instead.
Assuming all goes well for 1.64, CStr and CString will be accessible inside of core
and alloc
respectively: https://github.com/rust-lang/rust/pull/99277
The new clippy lints are also stabilized in 1.64
Can this crate be changed in a way that it supports no-std(as Vulkan explicitly supports embedded devices) or does it depend on std exclusive stuff?