Commit graph

1051 commits

Author SHA1 Message Date
i509VCB e76830bdef
extensions/ext: Add VK_EXT_image_drm_format_modifier (#603) 2022-04-29 14:12:27 +02:00
Marijn Suijten 61ab543d75
generator: Use _ as suffix instead of prefix to mask keywords (#613)
`_` as prefix is intended for unused variables and bindings; it should
be used in suffix position when intending to prevent a clash with a
keyword instead.
2022-04-15 11:12:51 -07:00
Marijn Suijten b9d5b588fa
ash/entry: Fix trivial_casts lint warning on Android/aarch64 (#612)
On certain platforms including Android and `aarch64` `c_char` is
unsigned, resulting in the same `u8` type as the byte-string here making
the cast redundant.

Just like any other code calling `get_instance_proc_addr`, use
`CStr::from_bytes_with_nul_unchecked` which abstracts away any
pointer-cast.
2022-04-15 11:12:06 -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 2a9a59e75c
Update Vulkan-Headers to 1.3.211 (#608) 2022-04-05 09:49:23 -07:00
Markus Siglreithmaier 3121816488
Remove experimental AMD extensions. (#607)
The extensions haven't being promoted to actual extensions within a long time frame and don't provide any value in its current state.
2022-04-04 12:36:43 +02:00
Marijn Suijten 50a86824da Regenerate against Vulkan-Headers 1.3.210 with generator updates
8dd682b ("Update Vulkan-Headers to 1.3.210 (#605)") wasn't based off of
the most recent master containing generator updates, leading to obvious
changes missing in generated output.
2022-04-01 10:07:01 +02:00
Marijn Suijten b905e16b17 Add changelog entry and bump version-metadata for Vulkan-Headers 1.3.210 2022-04-01 09:54:31 +02:00
Marijn Suijten 8dd682bac0
Update Vulkan-Headers to 1.3.210 (#605) 2022-03-31 21:31:19 -07:00
Benjamin Saunders 362cf83fa8
Inline Default impls and trivial instance/device wrapper methods (#606) 2022-03-29 19:54:38 +02: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
Marijn Suijten 8ae0312f03
Update Vulkan-Headers to 1.3.209 (#601) 2022-03-23 21:52:28 +01:00
Marijn Suijten 777977174a
device_diagnostic_checkpoints: Enable passing pNext-initialized structs to get_queue_checkpoint_data (#588)
To match all other functions which accept an array of to-be-initialized
structs with a `pNext` pointer that is possibly initialized by the
caller.
2022-03-23 00:03:34 +01:00
Benjamin Saunders 84cddb7383
Omit wrapper functions on Fp structs (#599)
* Omit wrapper functions on Fp structs

These wrappers contributed thousands of lines of code but offered
insignificant ergonomic benefit as the same functions are also wrapped
at a higher level and, if necessary, wrapper functions can be called
directly.

* Standardize on direct fp table access in wrapper functions
2022-03-22 23:50:18 +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 fde6f92c70
Update Vulkan-Headers to 1.3.207 (#597)
* Update Vulkan-Headers to 1.3.207

* Update Vulkan-Headers to 1.3.208
2022-03-22 23:30:41 +01:00
Zhixing Zhang 79a2ef040b
Fix unused_unsafe warning since Rust 1.61 nightly (#596) 2022-03-15 09:28:23 +01:00
Steve Wooster 3c7615b3bb
Iterator simplification (#565)
* Unnest iterators

This hopefully makes the iterator definitions better resemble paths into
the XML tree.

* Use for-loop instead of .for_each()

* Use elems.contains(x) instead of elems.iter().any(...)

* Shrink commands-related .fold()

Co-authored-by: Steve Wooster <s.f.m.wooster@gmail.com>
2022-02-26 15:03:54 -08:00
Steve Wooster b16bb4e62c
Appease clippy (#591)
* Simplify .map().flatten().next() and .filter_map().next() to .find_map()

* Avoid unnecessary closures for cheap expressions

* Use character instead of string for replacement pattern

Co-authored-by: Steve Wooster <s.f.m.wooster@gmail.com>
2022-02-26 13:01:28 -08:00
Marijn Suijten d180a3b655
extensions/ext: Add VK_EXT_headless_surface instance extension 2022-02-23 11:16:00 -08: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 157524c869
Add helper wrappers for Vulkan core 1.3 Instance and Device functions (#568)
* ash: Add function loading support for Vulkan 1.3

* ash/instance: Implement wrapper function for Vulkan 1.3 instance

* ash/device: Implement wrapper functions for Vulkan 1.3 device
2022-02-19 10:39:58 +01:00
Michael Pollind 40b572ff3a
entry: Allow querying enumerate_instance_extension_properties() by layer name (#574) 2022-02-19 10:30:35 +01:00
Marijn Suijten 955cb28d12
Update Vulkan-Headers to 1.3.206 (#563)
* Update Vulkan-Headers to 1.3.205

* Update Vulkan-Headers to 1.3.206
2022-02-19 10:18:21 +01:00
Marijn Suijten d6cb64de3d
extensions/khr: Drop _khr suffix from get_memory_fd_properties_khr (#580)
This is an erroneous suffix that's already captured in the module path
of this item, and should be omitted everywhere.  This method is the only
offender besides the experimental AMD extensions.

Fixes: 98def0a ("Add `VK_KHR_external_memory_fd` extension support (#270)")
2022-02-19 01:16:43 +01:00
Marijn Suijten b7e40117e9
Release ash 0.35.2 (#584) 2022-02-19 01:13:21 +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 9df926ab3e
extensions/khr: Add VK_KHR_external_fence_win32 (#582) 2022-02-16 15:23:45 -08:00
Marijn Suijten 4fcd93016e
extensions/khr: Add VK_KHR_external_semaphore_win32 (#581) 2022-02-16 23:13:19 +01:00
Marijn Suijten c5f68eab9d
extensions/khr: Add VK_KHR_external_memory_win32 (#579) 2022-02-16 13:30:54 -08:00
Marijn Suijten b7aff3b432
extensions/ext: Add VK_EXT_extended_dynamic_state2 (#572) 2022-01-29 21:39:48 +01:00
Marijn Suijten 89ca1d03f4
extensions/khr: Add VK_KHR_copy_commands2 (#571) 2022-01-29 21:34:30 +01:00
Marijn Suijten d4d9276636
extensions/ext: Add VK_EXT_private_data (#570) 2022-01-28 17:12:42 -08:00
Marijn Suijten bb02b20339
Replace 1.2-extensions documentation links with 1.3-extensions (#569)
All these 1.2 links redirect to the 1.3 pages: spare the redirects by
specifying the right - latest - version directly.
2022-01-28 17:10:52 -08:00
Marijn Suijten 0fd73279e1
Use link text in docs to omit Self:: prefix in rendered docs (#561)
Suggestion from [#559].

[#559]: https://github.com/MaikKlein/ash/pull/559#discussion_r790178735
2022-01-24 11:40:58 -08:00
Marijn Suijten b5a2744694
Replace link #[doc] bits with /// in manual code files (#562)
Manual code files usually see extra documentation lines added with
`///`, making for a rather unpleasant (source code) reading experience
when mixed with a link wrapped in `#[doc]`.  This is just a copy-paste
remnant from autogenerated code (`quote` macro converts `///` to
`#[doc]`) and can easily be omitted in manual code.
2022-01-24 10:50:36 -08:00
Marijn Suijten 315f1f00c3
ci: Build-test documentation with warnings disallowed, and fix links (#559)
Broken links that snuck in (most recently in #530 and #537) while the
CI was not testing the documentation have also been corrected, to allow
it to succeed again (and to have proper docs in the first place).
2022-01-22 11:27:07 -08:00
Steve Wooster fbcc45fffe
Add conversions from Extent2D to Extent3D and Rect2D (#557)
These two conversions occur all the time in Vulkan applications. For
example, Extent2D -> Extent3D occurs whenever you need to make an image
the same size as a surface and Extent2D -> Rect2D occurs whenever you
fill out a scissors or render area from a surface resolution.

Co-authored-by: Steve Wooster <s.f.m.wooster@gmail.com>
2022-01-22 16:29:45 +01:00
Marijn Suijten cebfd544fc Release ash 0.35.1 2022-01-18 12:07:54 +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
Marijn Suijten 5169862dbd
extensions/ext: Add VK_EXT_calibrated_timestamps extension (#556)
This extension can be used to correlate timestamps on the GPU timeline
(`vkCmdWriteTimestamp`, `vkCmdWriteTimestamp2KHR`) to the CPU timeline
(ie. `CLOCK_MONOTONIC` and friends).
2022-01-17 16:32:05 +01:00
thorjelly 98192d11f2
Convert vk_bitflags_wrapped! methods to const fn (#549) 2022-01-11 17:49:53 +01:00
Marijn Suijten 03068a8734
examples: Update winit to 0.26 and image to 0.23 (#551)
Examples-only excerpt of #547, as the generator and ash-window example
changes need more work.  Fixes #550.
2022-01-10 13:43:18 -08: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 405449901c
generator: Exclude static macro code (macros.rs) from the generator (#552)
Much like `platform_types.rs` and `vk.rs` before, there is no need to
generate this file as its contents are completely static.  This allows
direct editing of the file without realizing that a copy lives in the
generator - and will overwrite `macros.rs` when the generator is being
run.
2022-01-10 12:07:54 -08:00
Marijn Suijten 570b554894
Assert that Vulkan array-getters return the same length (#534)
Originally introduced in [#489] this inserts the array-length equality
check everywhere else: in the supposedly invalid and inexistant event
where Vulkan suddenly returns less items (`count` has been modified)
than were originally queried through respective `_len()` functions (or
more likely: a slice of invalid length passed by the user) and some
elements at the end of the slice are left uninitialized, panic.

Wherever there is valid concern or possibility for this to happen - or
to circumvent assertions and panics altogether - mutable references to
mutable slices should be passed allowing the length to be promptly
updated.

[#489]: https://github.com/MaikKlein/ash/pull/489#discussion_r753020089
2022-01-06 00:17:32 +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