Commit graph

41 commits

Author SHA1 Message Date
Marijn Suijten 1e7ee6762f
Remove "drop" mention from create_* docs when the result doesn't implement Drop (#625)
Ash doesn't implement `Drop` intentionally, to not be too opinionated
about holding (heap) references to their parent objects
(`Device`->`Instance`->`Entry`) and ensuring they are destroyed in the
right order.  As such, reword the `create` documentation for `Instance`
and `Device` to mention their respective `destroy_*` function instead of
referring to them as being "droppable".

Note that `Entry` is droppable as it does not have a Vulkan `destroy`
function _and_ the dynamically loaded library (behind the "loaded"
feature) is kept alive only for the lifetime of `Entry`.
2023-05-29 20:40:08 +02:00
Marijn Suijten 23da5dbc8c
README: Remove deprecated builder() snippets and guidelines (#743)
* 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 🎉
2023-04-16 22:19:09 +02:00
Marijn Suijten 7a1686014e
Replace const fn name() with associated NAME constants (#715)
`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).
2023-03-09 23:53:04 +01:00
Marijn Suijten 1c9e422577
ash-window: Bump MSRV to 1.64 to match raw-window-handle 0.5.1 (#716)
`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.
2023-03-09 23:39:44 +01:00
Marijn Suijten 935e5a4490
ash-window: Sync up with 0.12.0 release 2023-02-24 22:05:04 +01:00
Marijn Suijten 9e71ab9e34
Bump MSRV to 1.60 to accomodate for winit 0.28/objc requirement (#709)
These dependencies fail to resolve on older Rust/cargo versions before
even complaining about them being a too-high MSRV.
2023-02-24 21:51:07 +01:00
Marijn Suijten 8c63c9e08b
examples: Upgrade winit to 0.28 (#703) 2023-02-21 11:27:23 -08:00
Philippe Renon 9cd6c07744
fix clippy::uninlined_format_args (#705)
* ash/util: fix `clippy::seek_to_start_instead_of_rewind`

* examples: fix `clippy::uninlined_format_args`

* ash: fix `clippy::uninlined_format_args`

* generator: fix `clippy::uninlined_format_args`

* rust: upgrade to edition 2021
2023-02-17 18:11:44 +01:00
Marijn Suijten 8b4575086e
Replace as *... raw pointer-type changes with more explicit .cast() (#685)
`.cast()` allows changing the pointer type without hiding (accidental)
mutability changes (noting that `*mut` still coerces to `*.const`).

For mutability changes Rust 1.65 included `cast_mut()` and
`cast_const()`, but those would bump our MSRV too eagerly for now.
2022-11-22 10:52:14 -08:00
Marijn Suijten b4fc334083
ash-window: Upgrade to raw-window-handle 0.5.0 (#645)
* ash-window: Upgrade to raw-window-handle 0.5.0

* Bump `raw-window-metal` to recently-released `0.3`

https://github.com/norse-rs/raw-window-metal/pull/5

* examples: Bump `winit` to `0.27.1` to resolve our MSRV tests

While the examples technically aren't part of our MSRV requirement (it's
nice, but core crate compatibility is much more important), it's
annoying to exempt these especially now that `winit` removed some
unneeded MSRV 1.60/1.61 requirements.

* Take `Raw{Display,Window}Handle` directly instead of through trait
2022-09-23 12:40:12 +02:00
Marijn Suijten 82a93ef0b4
ash-window: Link to the ash gitter instead of nonexistent ash-window (#659)
It seems there's no gitter channel for `ash-window` (404), and since
everyone is in the `ash` channel already, just use the same one.
2022-09-22 09:07:17 -07:00
Marijn Suijten b093e67515
Release ash-window 0.11.0 2022-07-29 22:29:18 +02:00
Marijn Suijten da49568977
ash-window: Upgrade to raw-window-handle 0.4.2 (#505)
The match arms are not guarded by `cfg` anymore, allowing us to
compile-test these simple arms on every system whenever our Ash
extension helpers and types are not guarded by `cfg` attributes either.
This applies to every platform except Mac/IOS where the symbols and
external raw-window-metal crate are themselves guarded by cfg's.
2022-07-29 22:19:30 +02:00
Marijn Suijten f4acfbe2cb
ash-window: Upgrade winit example to 0.26 2022-07-29 10:42:10 -07:00
Benjamin Saunders 71bb3d337c
Replace builders with lifetimes/setters directly on Vulkan structs (#602)
* Replace builders with lifetimes/setters directly on Vulkan structs

* Inline setters
2022-03-29 19:15:14 +02:00
Marijn Suijten e43e9c0c9b
Set MSRV through rust-version in Cargo.toml and validate in CI (#604)
[#590] introduced an unsuspecting MSRV bump.  While we're pro-ba-bly
fine having these at the benefit of better code (in this case more
appropriate `const` annotations), they should at least be clear to us
when merging through a CI failure (or up-front bump of this version in
the CI script).  At the same time setting [`rust-version` in
`Cargo.toml`] provides a more helpful "requires newer rustc" error
message (since Rust 1.56.0) instead of showing potentially tons of
irrelevant compile errors in this crate to the user.

[#590]: https://github.com/MaikKlein/ash/pull/590
[`rust-version` in `Cargo.toml`]: https://doc.rust-lang.org/cargo/reference/manifest.html?highlight=pack#the-rust-version-field
2022-03-27 14:30:10 -07:00
Marijn Suijten e537e0ba9d
Release ash 0.37.0 and ash-window 0.10.0 (#600) 2022-03-23 22:04:12 +01:00
Steve Wooster 1cd810653c
ash-window: Make enumerate_required_extensions return &[*const c_char] (#590)
* Constify generated extension names

* Constify hand-written extension names

* Make ash-window list extensions as &[*const c_char]

This alters enumerate_required_extensions() to return the same type that
is expected by vk::InstanceCreateInfoBuilder::enabled_extension_names(),
allowing simple Vulkan apps to omit the boilerplate of mapping to an
intermediate Vec<*const c_char>.

Co-authored-by: Steve Wooster <s.f.m.wooster@gmail.com>
2022-03-22 23:47:26 +01:00
Marijn Suijten 8d7abfb6f1
Release ash 0.36.0 and ash-window 0.9.1 (#585) 2022-02-21 21:46:34 +01:00
Marijn Suijten e18e0243ef
ash: Remove unnecessary trivial_casts and trivial_numeric_casts (#564)
While making the code only marginally harder to read such casts can also
introduce subtle bugs when used incorrectly, and are best omitted
whenever unnecessary: Rust already coerces borrows into raw pointers
when the types on both ends are clear, and even then there remain many
casts that are identical to the source type.

In addition these errors show up when using a local crate reference to
`ash` in a workspace that uses "the `.cargo/config.toml` setup" from
[EmbarkStudios/rust-ecosystem#68] to configure linter warnings
project-wide instead of for all crates in that workspace individually.
In our case aforementioned linter warnings are enabled on top of
Embark's configuration, leading to a lot of these warnings in our build
process.

[EmbarkStudios/rust-ecosystem#68]: https://github.com/EmbarkStudios/rust-ecosystem/pull/68
2022-02-18 16:01:46 -08:00
Marijn Suijten a28a667d7c
changelog: Add entries for recent PRs #545, #534, #553, #551, #549 (#555)
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.
2022-01-17 20:45:10 +01:00
Marijn Suijten 130c150841
ash-window: Require at least raw-window-handle 0.3.4 for 0.4 interop (#553)
`raw-window-handle 0.3.4` was pushed as a "semver-trick-like" patch
release, implementing the `0.3` trait for the `0.4` crate release [74].
This allows `ash-window` as a window-handle "consumer" crate to accept
both `0.3` and `0.4` handles from consumer crates simultaneously.  To
ensure this patch release is available even when users omit regular
`cargo update` or build with `-Z minimal-versions`, set the minimal
patch version in `Cargo.toml` to it.

[74]: https://github.com/rust-windowing/raw-window-handle/pull/74
2022-01-10 12:59:35 -08:00
Marijn Suijten ab36e84bac ash-window: Bump to 0.9.0
This change missed out from 9e7c1bff62.
2021-12-27 23:54:09 +01:00
Marijn Suijten 9e7c1bff62
Release ash 0.35 and ash-window 0.9 without default compile-time linking (#529) 2021-12-27 23:52:23 +01:00
Benjamin Saunders 7cf3b4f09e
Don't link Vulkan by default (#526)
This was found to be unreasonably disruptive to downstream CI
configurations.
2021-12-27 11:49:40 +01:00
Marijn Suijten f99f9cfa90
Prepare release notes for 0.34 (and ash-window 0.8) with Vulkan 1.2.203 (#515) 2021-12-22 02:39:11 +01:00
Benjamin Saunders 6e31d1f229
Disable default features in ash-window -> ash dependency (#524) 2021-12-22 02:31:13 +01:00
Benjamin Saunders aa7b429f4f
Support linking Vulkan directly (#457)
* 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.
2021-09-09 22:50:34 +02:00
Kane Rogers 56bbf839a4
Bump version in README.md (#473) 2021-09-03 10:15:16 +02:00
Marijn Suijten 17149bd791
Update changelog and prepare for ash-0.33 and ash-window-0.7 release (#460)
* changelog: Add all entries for 0.33

* Prepare for ash-0.33 and ash-window-0.7 release
2021-07-30 15:22:29 +02:00
Marijn Suijten de8ff6b5dc
Unify readme between Ash and Ash-window (#455) 2021-07-30 12:32:52 +02:00
Jason Macnak ed351996e5
Adds LICENSE-* files to crate subdirectories (#452)
... so that the license files appear in downloaded crates.
2021-07-09 12:21:15 +02:00
Marijn Suijten d6e049f340 Use intradoc-links and explain the various loading methods 2021-06-07 09:54:11 -07:00
Marijn Suijten 06b4f8ef35
Vulkan 1.2.175: Provisional Video Extensions (#417)
* generator: Add edegecases for broken Video extension enum variants

* Replace deprecated `make_version()` with `make_api_version()`

* generator: Use the same predicate for push_next and its traits

Some structs turn out to be root structs when their name is not in the
`root_structs` set, even when they themselves extend another struct.
This was already taken care of for `push_next` which is emitted in this
situation, but the trait referenced by `push_next`'s `T` bound is still
relying on the `extends` field to not exist in `vk.xml` at all, leading
to it not being generated despite `push_next` needing it.

Fixes: 215511f ("Implement ExtendXXX for multiple root create infos if
there are more than 1")

* Update Vulkan-Headers to 12.175

* generator: Generate low-level structs with bindgen (for vk_video)
2021-06-06 11:00:29 +02:00
Rua f5e7cfe896
Impl trait functions directly on EntryCustom/Instance/Device (#412)
* Implement EntryV1_x, InstanceV1_x, DeviceV1_x functions directly
2021-04-30 17:13:23 +02:00
Marijn Suijten c942328cab changelog: Add missing link for 0.32.1, document changes to ash-window 2021-04-15 11:39:35 +02:00
Maik Klein 9662364c8b Bump version of ash-window 2021-03-07 20:17:48 +01:00
Marijn Suijten 00c7eea860 ash-winow: Fix clippy::single-match 2020-09-02 17:08:20 -07:00
Maik Klein 9aae30ecc2 Add version to ash 2020-07-14 16:54:40 +02:00
Maik Klein 99d81ca90a Bump ash-window to 0.5.0 2020-07-14 16:48:28 +02:00
msiglreith a1a42c067a
Add interoperability functions for raw-window-handle (#308)
* Add ash-window as workspace member

* ash-window: fix repository link

* ash-window: Address CI fmt&clippy issues

* ash-window: Try fix SDL2 CI issues

* ash-window: Remove beryllium example
2020-07-04 15:21:39 +02:00