Commit graph

101 commits

Author SHA1 Message Date
Marijn Suijten befb8cdd36
Switch to safe CStr::from_bytes_until_nul on sized c_char array wrapper (#746)
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.
2023-12-02 20:04:57 +01:00
Marijn Suijten 4bbfa54146
Rename examples to ash-examples (#820)
[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
2023-11-17 17:27:28 +01:00
Marijn Suijten c87eb53b92
Update repository links and crate keywords/categories (#819)
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.
2023-11-17 16:55:05 +01:00
Marijn Suijten ff54d22a15
Resolve lint warnings for deprecated_in_future, rust_2018_idioms and unused_qualifications (#803)
* 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.
2023-10-26 08:30:16 +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 ba37cf3fc2
Update Vulkan-Headers to 1.3.235 (#667)
* 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
2022-11-22 23:13:09 +01:00
Marijn Suijten e51e4158bd
ash: Add missing Apache-2.0 to Cargo.toml license field
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.
2022-07-28 09:48:15 -07:00
James Farrell e5c4d11b03
Fix instructions for running the examples on a Mac. (#609)
- `$VULKAN_SDK` must now be set, and serves as a base value for the other variables;
- ICD and layers moved from the `etc` to `share` subfolder.
2022-04-07 20:47:37 +02:00
Marijn Suijten e537e0ba9d
Release ash 0.37.0 and ash-window 0.10.0 (#600) 2022-03-23 22:04:12 +01: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
hoj-senna fdaafe760a Update README.md
loaded/linked feature: correctly identify default, adjust order
2022-01-05 15:12:37 -08:00
hoj-senna 84bf62b219 Update README.md
Change Entry::new to Entry::linked in accordance with the changelog for ash 0.35.0.
2022-01-05 15:12:37 -08:00
Umbreon 675f91e9cd
Fix broken vulkan-tutorial link in README.md (#492) 2021-11-11 22:41:52 +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
Marijn Suijten de8ff6b5dc
Unify readme between Ash and Ash-window (#455) 2021-07-30 12:32:52 +02:00
Marijn Suijten eb75ded793
README: Add lifetime-preserving builder example using slice::from_ref (#381)
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.
2021-03-02 18:22:04 +01:00
Maik Klein 683a065ed6
Add gpu-alloactor to the readme 2020-11-11 14:40:21 +01:00
RustyNixieTube b9ac0c3892
Fix syntax highlighting on crates.io
Co-authored-by: RustyNixieTube <RustyNixieTube@users.noreply.github.com>
2020-08-14 13:40:06 -07:00
Maik Klein bcff1b7868
Remove tokei from the readme 2020-03-22 16:12:18 +01:00
Maik Klein 8e78a2cc0d Add 1.2 support to README 2020-01-26 09:38:58 +01:00
Stephan Dilly 96490987d9 fix ordering 2019-11-16 15:49:51 -08:00
maik 1637ed4bf4 Rename actions workflow in README 2019-10-20 17:47:38 +02:00
maik da9fa12eb9 Rename workflow 2019-10-20 17:45:18 +02:00
Maik Klein 6dd7f98d07
Add github actions (#244)
* Add github actions

* Update readme

* Delete travis and appveyor

* Rm Iamdone

* Update bors
2019-10-20 17:41:13 +02:00
Felix Rabe 77fff855d3 Vulkano is now vulkano-rs/vulkano 2019-05-11 08:09:12 -07:00
Felix Rabe db26cd20bc Typo 2019-05-09 16:46:58 -07:00
Felix Rabe e1d6f0dd31
Fix broken link 2019-05-09 21:49:51 +02:00
Benjamin Saunders c1b540ac96
Improve temporary lifetimes rules in readme
Co-Authored-By: MaikKlein <maikklein@googlemail.com>
2019-03-22 11:00:56 +01:00
Maik Klein d6ba3f9a16 Add lifetime of temporaries 2019-03-20 18:31:21 +01:00
Maik Klein 5f09e83023 Remove unnecessary function body 2019-03-20 10:48:32 +01:00
Maik Klein bd2f990100 Rewrite builder in the readme 2019-03-20 10:37:55 +01:00
Maik Klein d667e58358 Add example 2019-03-09 19:35:38 +01:00
Maik Klein f4d2f75a2b Add missing list for gfx 2019-02-15 10:10:02 +01:00
Maik Klein 6cd1b2227b Add resources in the readme 2019-02-15 10:08:38 +01:00
Maik Klein ced4e186b5 Update extension use in README 2019-01-19 10:00:44 +01:00
Maik Klein f26bbb303d Remove imadone 2018-11-22 19:15:35 +01:00
imdone.io app user f7381f2307 TODO comments updated by @imdoneio [ci skip] [imdone skip] 2018-11-20 11:55:06 -05:00
Benjamin Saunders bb7d025fc1 Clarify some patterns in the README
- Dedicated section for strongly typed handles
- Extended discussion of builder safety
2018-11-19 20:35:48 -08:00
Maik Klein 790b2a5b90 Rewrite the loader in the README 2018-11-13 10:07:37 +01:00
Maik Klein 7bdd6a47f9 Improve readme 2018-11-12 16:25:31 +01:00
Maik Klein 4bf5888b15 Update the readme 2018-11-12 14:53:06 +01:00
Maik Klein 69f3644362 Merge branch 'generator' 2018-11-12 13:10:52 +01:00
Maik Klein 50b42e97be Fix rendering in readme 2018-11-11 18:06:48 +01:00
Maik Klein 36566f8fa1 Update readme 2018-11-11 18:05:44 +01:00
Gray Olson 462e7760de add note to readme 2018-07-06 21:55:59 -07:00
Maik Klein 19ce439156 Remove changelog from readme 2017-07-09 09:14:15 +02:00
Maik Klein f76766fda7 Wrong version in README 2017-06-11 15:06:09 +02:00
Maik Klein 173bb67b5c Update readme 2017-06-11 15:02:05 +02:00