Commit graph

1049 commits

Author SHA1 Message Date
Marijn Suijten
6b6f2ee8a8
generator: Limit pCode member workaround to VkShaderModuleCreateInfo (#707)
An upcoming extension will ship with an untyped `pCode` member (`void
*`) including a valid `len` field pointing to a `codeSize` field rather
than obscure Latex math and a `/4` expression in `altlen`.  Limit the
scope of our workaround for that SPIR-V-specific `pCode` field to
`VkShaderModuleCreateInfo`.
2023-04-02 22:29:27 +02:00
Philippe Renon
56d8507acb
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-04-02 22:29:25 +02:00
HugoPeters1024
aca947df12
examples: Fix error description in texture example (#696)
fix error description in texture example
2023-04-02 22:28:23 +02:00
Marijn Suijten
826bc89775 Release ash 0.37.2 2023-01-11 11:34:14 +01:00
Teodor Tanasoaia
5ffd797a83 extensions/khr/draw_indirect_count: Use the right function pointer for non-indexed draw call (#695) 2023-01-11 11:32:19 +01:00
Marijn Suijten
c1d5b5794d
Update Vulkan-Headers to 1.3.238 (#688)
* Update Vulkan-Headers to 1.3.236

* Update Vulkan-Headers to 1.3.237

* Update Vulkan-Headers to 1.3.238
2022-12-19 20:01:06 +01:00
Marijn Suijten
61d33d50cb
examples: Remove unneeded casts as pointed out by Rust 1.66 (#692)
Strangely some no-op cast remained in the codebase, and are only now
caught since Rust 1.66.  In both cases the input value is already of the
correct type (independent of the platform).
2022-12-19 19:47:48 +01:00
Marijn Suijten
c3212b8c7c
Replace <<ref>> in documentation with link to ref (#693)
Rustdoc since 1.66 points out that `<<ref>>` is malformed HTML, and the
resulting `<<devsandqueues-lost-device>>` isn't very helpful to users.
Convert it to the relevant link in both documentation and `Result`
`Display` to solve both issues at once.
2022-12-19 19:42:52 +01:00
Marijn Suijten
e93dfdaaf5
Release ash 0.37.1 (#632) 2022-11-23 23:23:26 +01:00
Marijn Suijten
4b1c03e4d9 extensions/ext: Add VK_EXT_descriptor_buffer (#679) 2022-11-22 23:40:55 +01:00
Marijn Suijten
1d800d0d60 extensions/ext: Add VK_EXT_extended_dynamic_state3 (#671) 2022-11-22 23:40:55 +01:00
Marijn Suijten
d176eef678 Call Vec::set_len() after checking for Vulkan errors (#684)
The entire reason for calling `unsafe` `set_len()` after the Vulkan
driver function call is to ensure the `Vec` never gives safe access to
uninitialized values (as allocted via `Vec::with_capacity()`).  This
contract is broken within the implementation of these functions by
temporarily setting a nonzero length when the Vulkan driver may not have
initialized the underlying data at all, and communicated this by
returning an error code.

Simply check the error code first, before jumping to a now-infallible
codepath that calls `.set_len()` and always returns `Ok()`.
2022-11-22 23:40:55 +01:00
Marijn Suijten
47ec56c30e 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:40:53 +01:00
Marijn Suijten
047676a443 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 23:39:49 +01:00
Charles Giessen
24000c1249 generator: Update list of vendor names (#676) 2022-11-18 10:21:34 +01:00
Marijn Suijten
ca9168bc3a CI: Only MSRV-test published ash and ash-window crates (#677)
`bytemuck` recently bumped its MSRV to 1.60 which is incompatible with
what we're currently advertising.  Fortunately this doesn't affect MSRV
of the publicly published crates, but only `dev-dependencies` inside
`ash-window` via `winit`: make sure the CI doesn't reject this.
2022-11-18 10:21:34 +01:00
Marijn Suijten
e400f5150c generator: Upgrade to bindgen 0.61.0 (#673)
Seems to mostly result in less unused type aliases being generated, and
improved/reworked testing infrastructure.
2022-11-18 10:21:34 +01:00
Marijn Suijten
1d14729721 extensions: Only call assume_init() when Vulkan returns SUCCESS (#669)
It is undefined behaviour to construct a safe object by calling
`MaybeUninit::assume_init()` when the object in question hasn't been
initialized by anything (in this case the underlying Vulkan call) at
all, even if the object is never "used".  Postpone the `assume_init()`
call until after checking if `vk::Result::SUCCESS` has been returned by
the native implementation, by introducing a new
`assume_init_on_success()` helper that takes a `MaybeUninit<T>`.
2022-10-16 15:58:41 +02:00
AidoP
23856e9eb8 extensions/ext: Add VK_EXT_acquire_drm_display (#668)
Co-authored-by: Aidan Prangnell <aidop@trifuse.xyz>
2022-10-16 15:58:34 +02:00
Marijn Suijten
812b9bb214 generator: Support nested arrays in builders without hardcoding (#666)
Prepare the generator for more struct fields that have nested "dynamic
arrays" with a hardcoded size of `1` (effectively arrays with pointers
to single objects) in `vk.xml`s `len` attribute.  These structs are
introduced by `VK_EXT_opacity_micromap` in 1.3.230.
2022-10-03 12:02:49 +02:00
BeastLe9enD
c2f21d2949 extensions/ext: Add VK_EXT_mesh_shader (#657) 2022-09-26 00:31:52 +02:00
BeastLe9enD
38543a1643 extensions/ext: Rename debug_utils_set_object_name to set_debug_utils_object_name and debug_utils_set_object_tag to set_debug_utils_object_tag for consistency and deprecate old ones (#661) 2022-09-24 11:09:20 +02:00
Marijn Suijten
359c1c1051
Release ash-window 0.12.0 2022-09-23 19:47:08 +02:00
Marijn Suijten
0a96643e26 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:43:45 +02:00
Marijn Suijten
7933bf5709 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-23 12:41:23 +02:00
David Koloski
cc3d65a486 extensions/khr/ray_tracing_pipeline: Set length of capture-replay shader handle buffer after filling (#658) 2022-09-22 10:51:12 +02:00
Marijn Suijten
6a7303271a Update Vulkan-Headers to 1.3.228 (#655)
* Update Vulkan-Headers to 1.3.220
* Update Vulkan-Headers to 1.3.221
* Update Vulkan-Headers to 1.3.222
* Update Vulkan-Headers to 1.3.223
* Update Vulkan-Headers to 1.3.224
* Update Vulkan-Headers to 1.3.225
* Update Vulkan-Headers to 1.3.226
* Update Vulkan-Headers to 1.3.227
* Update Vulkan-Headers to 1.3.228
2022-09-21 16:10:22 +02:00
Marijn Suijten
21bbc79188 ash: Add const STRUCTURE_TYPE to all Vulkan structures for matching with match_struct! macro (#614)
* ash: Add `const STRUCTURE_TYPE` to all Vulkan structures for matching with `match_struct!` macro

In Vulkan layers extracing a structure based on its `s_type` is a common
operation, but comparing against an enum value and subsequently casting
to the right type is verbose and error-prone.

By generating a `const STRUCTURE_TYPE` with the given value for every
Vulkan structure it becomes possible to implement a macro that abstracts
this logic away in a safer way.

* generator: Reuse `HasStructureType::STRUCTURE_TYPE` in `s_type` initializer
2022-09-21 15:58:21 +02:00
Marijn Suijten
45b2b12bbc Fix new/improved Rust 1.63 clippy lints (#649)
More `clippy::use_self` is found in manual code, and superfluous
transmutes in bindgen output are now also found and disallowed.
2022-09-05 11:33:52 +02:00
Marijn Suijten
dc3cb6e8d8 vk/prelude: Drop upstream-fixed Self:: doc workaround (#648)
The report at https://github.com/rust-lang/rust/issues/93205 was closed
as it has presumably been fixed in
https://github.com/rust-lang/rust/pull/93805 which has long trickled
down into stable releases, and I cannot reproduce the issue on `1.62.1`
anymore (latest stable as of writing) 🎉

This workaround was originally added in #559.
2022-09-05 11:33:41 +02:00
Marijn Suijten
29072411a6
Release ash-window 0.11.0 2022-07-29 22:24:47 +02:00
Marijn Suijten
7315d9914e 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:20:17 +02:00
Marijn Suijten
9f18e51ae4 ash-window: Upgrade winit example to 0.26 2022-07-29 22:19:59 +02:00
Marijn Suijten
f5e1f93d01 generator: Upgrade bindgen, heck and vk-parse
`heck` got its API slightly renamed, and `bindgen` fixed all code-smell
linter warnings in its output (except naming style, which is inherent).
2022-07-29 17:26:56 +02:00
Marijn Suijten
1ee5a01d4b 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 20:59:34 +02:00
Marijn Suijten
62960ad680 extensions: Inline all trivial functions (#638)
* extensions: Inline simple getter functions

* extensions: Inline all `unsafe fn` helper functions

* instance: Inline "skipped" `read_into_uninitialized_vector()` functions

* enums: Inline `from_raw`/`as_raw` functions
2022-07-07 17:28:10 +02:00
Marijn Suijten
0d4f2ba23a extensions/ext: Add VK_EXT_image_compression_control device extension (#621) 2022-07-06 13:24:48 +02:00
Marijn Suijten
89f3271463 extensions/khr: Add VK_KHR_ray_tracing_maintenance1 device extension (#620) 2022-07-06 13:24:47 +02:00
Marijn Suijten
85b2696a1f Update Vulkan-Headers to 1.3.219 (#619)
* Update Vulkan-Headers to 1.3.212

* Update Vulkan-Headers to 1.3.213

* Update Vulkan-Headers to 1.3.214

* Update Vulkan-Headers to 1.3.215

* Update Vulkan-Headers to 1.3.216

* Update Vulkan-Headers to 1.3.217

* Update Vulkan-Headers to 1.3.218

* Update Vulkan-Headers to 1.3.219

* Changelog: reorder entries chronologically based on PR ID
2022-07-06 13:24:26 +02:00
Marijn Suijten
9c9552b8a4 extensions/khr: Add VK_KHR_device_group (#631) 2022-07-01 22:23:05 +02:00
Marijn Suijten
3fafe975e0 generator: Fix clippy::is_digit_ascii_radix (#637) 2022-07-01 22:22:54 +02:00
Marijn Suijten
06443f8cf9 extensions/khr: Implement additional Swapchain functions since Vulkan 1.1 (#629)
* extensions/khr: Reorder `Swapchain` functions to match `KhrSwapchainFn`

* extensions/khr: Implement additional `Swapchain` functions since Vulkan 1.1

These are also made available by `VK_KHR_device_group` when
`VK_KHR_swapchain` (and for certain functions only the underlying
`VK_KHR_surface` extension) is enabled.
2022-06-05 22:22:38 +02:00
Marijn Suijten
934f167f09 Remove unused version.rs module file from git (#634)
This seems to have been forgotten in #412.
2022-06-05 21:06:24 +02:00
Marijn Suijten
b444d414ec Inline trivial Entry wrapper methods and impl functions (#633) 2022-06-05 20:59:41 +02:00
Marijn Suijten
3624b56391 extensions/khr: Add VK_KHR_device_group_creation (#630) 2022-06-05 15:49:48 +02:00
lilly lizard
8fff0584b3 Document crate features in library docs (#627) 2022-06-05 15:49:36 +02:00
Lucas Jenß
9406685ab9 examples: Fix validation errors on macOS and iOS (#623)
* Error: vkCreateDevice: VK_KHR_portability_subset must be enabled [...]
* Error: Attempting to create a VkDevice from a VkPhysicalDevice which is from a portability driver without the VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the VkInstanceCreateInfo flags being set and the VK_KHR_portability_enumeration extension enabled.
2022-06-05 15:49:21 +02:00
Benjamin Saunders
a6336a5b7b Inline builder setters 2022-06-05 12:55:04 +02:00
Michael Pollind
28a4868dc3 generator: Upgrade nom to 0.7 where parser macros have been removed (#610) 2022-05-11 11:23:20 +02:00
Marijn Suijten
90179c81dc extensions/nv: Add VK_NV_coverage_reduction_mode (#617) 2022-05-11 11:23:17 +02:00