Certain structs contain sized character arrays that are converted to
`CStr` for convenient accss to the user and our `Debug` implementation
using unsafe `CStr::from_ptr(...as_ptr())`. There is no need to
round-trip to a pointer and possibly read out of bounds if the
NUL-terminator index (string length) is instead searched for by the
newly stabilized `CStr::from_bytes_until_nul()` fn since Rust 1.69
(which panics if no NUL-terminator is found before the end of the
slice).
Unfortunately `unsafe` is still needed to cast the array from a `c_char`
(`i8` on most platforms) to `u8`, which is what `from_bytes_until_nul()`
accepts.
[Dependabot complains] that:
the binary target name `examples` is forbidden, it conflicts with with cargo's build directory names
And fails to provide dependency upgrades for Rust code. Fix that by
renaming the folder and crate to `ash-examples`.
[Dependabot complains]: https://github.com/ash-rs/ash/network/updates/748770724
Some links were still pointing to the (moved) `MaikKlein/ash` repo,
instead of the new shared `ash-rs/ash` repository under this
organisation, GitHub still provides a redirect, but we should aim to
provide the correct link from the get-go. Only the gitter channel
remains as it was impossible to get the room to be renamed. The
`ash-rs/ash` channel exists but there is currently no activity.
* generator: Add many missing lifetime parameters
* Globally find-replace common patterns that need a `<'_>` lifetime annotation
perl -pi -E "s/(&(mut )?\[?vk::(?\!\w+(V1_\d|Fn|<))\w+)/\$1<'_>/" **/*.{rs,md}
* generator: Include aliased types in `has_lifetime` lookup table
* Manually revert wrong find-replace lifetimes
* Resolve lint warnings for `deprecated_in_future`, `rust_2018_idioms` and `unused_qualifications`
These are 3 non-default lints that cause a lot of violations in this
project that are sensible to resolve, and reduce noise when
test-including a local `ash` checkout in other projects that have
stricter lint setups.
* README: Autoformat
* README: Remove deprecated `builder()` snippets and guidelines
#602 introduced builder functions directly on the raw Vulkan struct
types by using lifetime borrows which are FFI compatible (ABI is
identical) wuth raw pointers, simplifying the whole system and
protecting the user against losing lifetimes upon calling `.build()`.
However, this change wasn't propagated through to the `README` so the
code snippets were still showcasing removed `::builder()` and `.build()`
functions and documenting "the `.build()` footgun" which doesn't even
exist anymore 🎉
`CStr::from_bytes_with_nul_unchecked` is `const`-stable since Rust 1.59
which is already required for `ash` so it is high time to finally turn
these inlined `name()` functions into associated constants (which is a
breaking change in itself that cannot be backported).
`raw-window-handle 0.5.1` bumped from 1.60 to 1.64 in a
semver-compatible release, failing our CI infrastructure overnight.
Keep the `ash` version at `1.60` for now.
* Update Vulkan-Headers to 1.3.229
* Update Vulkan-Headers to 1.3.230
* Update Vulkan-Headers to 1.3.231
* Update Vulkan-Headers to 1.3.232
* Update Vulkan-Headers to 1.3.233
* Update Vulkan-Headers to 1.3.235
* README: Document experimental Vulkan Video bindings being semver-exempt
We already ship both license files in the published crate, have both
licenses listed in the `README`, and even `ash-window` already lists
both in `Cargo.toml`.
I found this while experimenting with shields.io badges, as there's a
special link that scrapes the license straight off of crates.io:
https://img.shields.io/crates/l/ash (and many more). This might've been
nice to use except that it's outdated until we publish the next release,
and doesn't allow a nice link to either `LICENSE-XXX` file that we have
now.
And drop the deprecated =/- markdown syntax from our readme: this is
analogous to #/## for a h1/h2 header, instead of defining a title and
(usually smaller font) subtitle or description.
* Mark EntryCustom::new_custom as unsafe
Passing a badly-behaved `load` function can invoke undefined behavior.
* Document required feature for Entry
* Support linking Vulkan directly
This is the preferred pattern in most environments when an application
cannot function without Vulkan, as it saves the libloading dependency,
eliminates an error case, and makes the Vulkan dependency visible to
the OS.
* Rename libloading feature to "loaded"
* Link by default
* Guide users towards linking the loader directly
* Remove unnecessary error type
InstanceError::LoadError was never constructed.
* Unify entry types
Simplifies the interface and allows a bunch of code to become
monomorphic.
It isn't too uncommon to pass a single builder element into another
builder, and `slice::from_ref` fits perfectly while preserving lifetime
of the builder without calling `.build()`. We have used this
successfully in our codebase to uncover and prevent numerous
use-after-free bugs, and thought it's worth to share on the front page.