From 4180359ba7e5496edc81173c92351ace6bc728d2 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 30 Oct 2023 12:20:28 +0100 Subject: [PATCH 01/23] gitmodules: Disable `update` to prevent cloning on cargo checkout (#808) When using a `git` reference on this repo, `cargo` will unnecessarily clone the `Vulkan-Headers` submodule (which is only needed by maintainers together with the `generator`). By setting the update mode to `none` (https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtupdate) this is disabled, and `git submodule update` will now also no longer fetch/clone/update the repository unless `--checkout` is used (https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-checkout). I.e. running `cargo update` on a repo with a `git` dependency on `ash`: Updating git repository `https://github.com/ash-rs/ash` Skipping git submodule `https://github.com/KhronosGroup/Vulkan-Headers` due to update strategy in .gitmodules --- .github/workflows/ci.yml | 5 +++-- .gitmodules | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d83ae75..dfb25f374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - with: - submodules: true + - name: Checkout submodule + # Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise + run: git submodule update --recursive --init --force --checkout - name: Run generator run: cargo run -p generator - name: Diff autogen result diff --git a/.gitmodules b/.gitmodules index 8673d0aaf..f59e7f906 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "generator/Vulkan-Headers"] path = generator/Vulkan-Headers url = https://github.com/KhronosGroup/Vulkan-Headers + update = none From 335251d383da2c2f08cf13e08da5ba40b1ea409c Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 31 Oct 2023 10:16:34 +0100 Subject: [PATCH 02/23] Enable `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (#809) This parameter is not only used for the length of `pImageInfo`, `pBufferInfo` or `pTexelBufferView`, but also matching the value of `dataSize` when `VkWriteDescriptorSetInlineUniformBlock` is appended in `pNext`, or the value of `accelerationStructureCount` when `VkWriteDescriptorSetAccelerationStructureKHR` is in `pNext`. Having the count setter directly avaialble makes builder code more natural, instead of having to use a `mut` variable and manually assign `.descriptor_count = xx.len();` afterwards. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkWriteDescriptorSet.html --- Changelog.md | 1 + ash/src/vk/definitions.rs | 5 +++++ generator/src/lib.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Changelog.md b/Changelog.md index b0654193e..2a9fe580f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `VK_NV_low_latency2` device extension (#802) - Added `VK_EXT_hdr_metadata` device extension (#804) - Added `VK_NV_cuda_kernel_launch` device extension (#805) +- Added `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (#809) ### Changed diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index 6646a5292..d9f9dc5bb 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -1835,6 +1835,11 @@ impl<'a> WriteDescriptorSet<'a> { self } #[inline] + pub fn descriptor_count(mut self, descriptor_count: u32) -> Self { + self.descriptor_count = descriptor_count; + self + } + #[inline] pub fn descriptor_type(mut self, descriptor_type: DescriptorType) -> Self { self.descriptor_type = descriptor_type; self diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 3cc8ad857..5eb3bfbe7 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1893,6 +1893,9 @@ fn derive_setters( ("VkDescriptorSetLayoutBinding", "descriptorCount"), // No ImageView attachments when VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT is set ("VkFramebufferCreateInfo", "attachmentCount"), + // descriptorCount also describes descriptor length in pNext extension structures + // https://github.com/ash-rs/ash/issues/806 + ("VkWriteDescriptorSet", "descriptorCount"), ]; let skip_members = members .iter() From 6c7540473a19b35e3ff0ae19e5bd1990f72aa9a2 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 3 Nov 2023 18:20:47 +0100 Subject: [PATCH 03/23] Add simple dependabot config for `cargo` and `github-actions` (#810) Even though we don't have many dependencies, our GitHub Actions are getting severely out of date and are best updated to the latest version. Let dependabot help us with this, together with the few `cargo` crate dependencies that we have (mainly in examples). --- .github/dependabot.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 000000000..8be550a8b --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: cargo + directory: "/" + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: "/.github/workflows/" + schedule: + interval: weekly From d0c5e97826ee787bf31f08eef2c57cec82909f61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 18:38:00 +0100 Subject: [PATCH 04/23] build(deps): bump actions/checkout from 1 to 4 in /.github/workflows (#812) Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v1...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfb25f374..6ccf83c7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,14 +7,14 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - run: cargo check --workspace --all-targets --all-features check_msrv: name: Check ash MSRV (1.60.0) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.60.0 - run: cargo check -p ash -p ash-rewrite --all-features @@ -22,7 +22,7 @@ jobs: name: Check ash-window MSRV (1.64.0) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.64.0 - run: cargo check -p ash-window -p examples --all-features @@ -31,7 +31,7 @@ jobs: name: Generated runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Checkout submodule # Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise run: git submodule update --recursive --init --force --checkout @@ -46,7 +46,7 @@ jobs: steps: - name: Install Vulkan loader run: sudo apt-get install libvulkan-dev - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Test all targets run: cargo test --workspace --all-targets - name: Test docs @@ -56,7 +56,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - run: cargo fmt --all -- --check clippy: @@ -70,7 +70,7 @@ jobs: - x86_64-apple-darwin - aarch64-apple-ios steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Add Rust target ${{ matrix.target }} run: rustup target add ${{ matrix.target }} - name: Clippy lint without features @@ -91,7 +91,7 @@ jobs: name: Build-test docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Document all crates env: RUSTDOCFLAGS: -Dwarnings From d40ab4b36722a2f3aa63d48bd13848cdb15b6dca Mon Sep 17 00:00:00 2001 From: David Koloski Date: Wed, 15 Nov 2023 04:19:14 -0500 Subject: [PATCH 05/23] Bump libloading to 0.8 (#739) --- Changelog.md | 1 + ash-rewrite/Cargo.toml | 2 +- ash/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 2a9fe580f..69df75a8d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replaced `const fn name()` with associated `NAME` constants (#715) - Generic builders now automatically set `objecttype` to `::ObjectType` (#724) - `get_calibrated_timestamps()` now returns a single value for `max_deviation` (#738) +- Bumped `libloading` from `0.7` to `0.8` (#739) - extensions/khr: Take the remaining `p_next`-containing structs as `&mut` to allow chains (#744) - `AccelerationStructure::get_acceleration_structure_build_sizes()` - `ExternalMemoryFd::get_memory_fd_properties()` diff --git a/ash-rewrite/Cargo.toml b/ash-rewrite/Cargo.toml index f84365ce1..324ff65cc 100644 --- a/ash-rewrite/Cargo.toml +++ b/ash-rewrite/Cargo.toml @@ -19,7 +19,7 @@ edition = "2021" rust-version = "1.60.0" [dependencies] -libloading = { version = "0.7", optional = true } +libloading = { version = "0.8", optional = true } [features] default = ["loaded", "debug"] diff --git a/ash/Cargo.toml b/ash/Cargo.toml index fa424e8bd..130854fa0 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -16,7 +16,7 @@ edition = "2021" rust-version = "1.60.0" [dependencies] -libloading = { version = "0.7", optional = true } +libloading = { version = "0.8", optional = true } [features] default = ["loaded", "debug"] From c87eb53b92c03f53ac074333c7dfe25a04a1afe8 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 17 Nov 2023 16:55:05 +0100 Subject: [PATCH 06/23] 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. --- Changelog.md | 34 +++++++++++++++++----------------- README.md | 12 ++++++------ ash-rewrite/Cargo.toml | 2 ++ ash-window/Cargo.toml | 20 ++++++++++++-------- ash-window/Changelog.md | 32 ++++++++++++++++---------------- ash-window/README.md | 4 ++-- ash/Cargo.toml | 12 +++++++++--- ash/src/util.rs | 2 +- 8 files changed, 65 insertions(+), 53 deletions(-) diff --git a/Changelog.md b/Changelog.md index 69df75a8d..7f0a41e01 100644 --- a/Changelog.md +++ b/Changelog.md @@ -436,20 +436,20 @@ flags: vk::CommandPoolCreateFlags::RESET_COMMAND_BUFFER_BIT, - `ash::util::Align` is a helper struct that can write to aligned memory. -[Unreleased]: https://github.com/MaikKlein/ash/compare/0.37.2...HEAD -[0.37.2]: https://github.com/MaikKlein/ash/releases/tag/0.37.2 -[0.37.1]: https://github.com/MaikKlein/ash/releases/tag/0.37.1 -[0.37.0]: https://github.com/MaikKlein/ash/releases/tag/0.37.0 -[0.36.0]: https://github.com/MaikKlein/ash/releases/tag/0.36.0 -[0.35.2]: https://github.com/MaikKlein/ash/releases/tag/0.35.2 -[0.35.1]: https://github.com/MaikKlein/ash/releases/tag/0.35.1 -[0.35.0]: https://github.com/MaikKlein/ash/releases/tag/0.35.0 -[0.34.0]: https://github.com/MaikKlein/ash/releases/tag/0.34.0 -[0.33.3]: https://github.com/MaikKlein/ash/releases/tag/0.33.3 -[0.33.2]: https://github.com/MaikKlein/ash/releases/tag/0.33.2 -[0.33.1]: https://github.com/MaikKlein/ash/releases/tag/0.33.1 -[0.33.0]: https://github.com/MaikKlein/ash/releases/tag/0.33.0 -[0.32.1]: https://github.com/MaikKlein/ash/releases/tag/0.32.1 -[0.32.0]: https://github.com/MaikKlein/ash/releases/tag/0.32.0 -[0.31.0]: https://github.com/MaikKlein/ash/releases/tag/0.31.0 -[0.30.0]: https://github.com/MaikKlein/ash/releases/tag/0.30.0 +[Unreleased]: https://github.com/ash-rs/ash/compare/0.37.2...HEAD +[0.37.2]: https://github.com/ash-rs/ash/releases/tag/0.37.2 +[0.37.1]: https://github.com/ash-rs/ash/releases/tag/0.37.1 +[0.37.0]: https://github.com/ash-rs/ash/releases/tag/0.37.0 +[0.36.0]: https://github.com/ash-rs/ash/releases/tag/0.36.0 +[0.35.2]: https://github.com/ash-rs/ash/releases/tag/0.35.2 +[0.35.1]: https://github.com/ash-rs/ash/releases/tag/0.35.1 +[0.35.0]: https://github.com/ash-rs/ash/releases/tag/0.35.0 +[0.34.0]: https://github.com/ash-rs/ash/releases/tag/0.34.0 +[0.33.3]: https://github.com/ash-rs/ash/releases/tag/0.33.3 +[0.33.2]: https://github.com/ash-rs/ash/releases/tag/0.33.2 +[0.33.1]: https://github.com/ash-rs/ash/releases/tag/0.33.1 +[0.33.0]: https://github.com/ash-rs/ash/releases/tag/0.33.0 +[0.32.1]: https://github.com/ash-rs/ash/releases/tag/0.32.1 +[0.32.0]: https://github.com/ash-rs/ash/releases/tag/0.32.0 +[0.31.0]: https://github.com/ash-rs/ash/releases/tag/0.31.0 +[0.30.0]: https://github.com/ash-rs/ash/releases/tag/0.30.0 diff --git a/README.md b/README.md index e71f90221..d554e42cc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A very lightweight wrapper around Vulkan [![Crates.io Version](https://img.shields.io/crates/v/ash.svg)](https://crates.io/crates/ash) [![Documentation](https://docs.rs/ash/badge.svg)](https://docs.rs/ash) -[![Build Status](https://github.com/MaikKlein/ash/workflows/CI/badge.svg)](https://github.com/MaikKlein/ash/actions?workflow=CI) +[![Build Status](https://github.com/ash-rs/ash/workflows/CI/badge.svg)](https://github.com/ash-rs/ash/actions?workflow=CI) [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT) [![LICENSE](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE-APACHE) [![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -145,7 +145,7 @@ Custom loaders can be implemented. ### Extension loading -Additionally, every Vulkan extension has to be loaded explicitly. You can find all extensions under [ash::extensions](https://github.com/MaikKlein/ash/tree/master/ash/src/extensions). +Additionally, every Vulkan extension has to be loaded explicitly. You can find all extensions under [`ash::extensions`](https://github.com/ash-rs/ash/tree/master/ash/src/extensions). ```rust use ash::extensions::khr::Swapchain; @@ -195,7 +195,7 @@ If, on the other hand, your application cannot handle Vulkan being missing at ru ## Example -You can find the examples [here](https://github.com/MaikKlein/ash/tree/master/examples). +You can find the examples [here](https://github.com/ash-rs/ash/tree/master/examples). All examples currently require: the LunarG Validation layers and a Vulkan library that is visible in your `PATH`. An easy way to get started is to use the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/) #### Windows @@ -218,7 +218,7 @@ VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \ cargo run ... ``` -### [Triangle](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs) +### [Triangle](https://github.com/ash-rs/ash/blob/master/examples/src/bin/triangle.rs) Displays a triangle with vertex colors. @@ -229,7 +229,7 @@ cargo run --bin triangle ![screenshot](http://i.imgur.com/PQZcL6w.jpg) -### [Texture](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/texture.rs) +### [Texture](https://github.com/ash-rs/ash/blob/master/examples/src/bin/texture.rs) Displays a texture on a quad. @@ -252,7 +252,7 @@ cargo run --bin texture - [vk-sync](https://github.com/gwihlidal/vk-sync-rs) - Simplified Vulkan synchronization logic, written in rust. - [vk-mem-rs](https://github.com/gwihlidal/vk-mem-rs) - This crate provides an FFI layer and idiomatic rust wrappers for the excellent AMD Vulkan Memory Allocator (VMA) C/C++ library. -- [gpu-allocator](https://github.com/Traverse-Research/gpu-allocator) - Memory allocator written in pure Rust for GPU memory in Vulkan and in the future DirectX 12 +- [gpu-allocator](https://github.com/Traverse-Research/gpu-allocator) - GPU Memory allocator written in pure Rust for Vulkan and DirectX 12. - [lahar](https://github.com/Ralith/lahar) - Tools for asynchronously uploading data to a Vulkan device. ### Libraries that use ash diff --git a/ash-rewrite/Cargo.toml b/ash-rewrite/Cargo.toml index 324ff65cc..2f1c33ac1 100644 --- a/ash-rewrite/Cargo.toml +++ b/ash-rewrite/Cargo.toml @@ -9,10 +9,12 @@ readme = "../README.md" keywords = ["gamedev", "graphics", "vulkan", "bindings"] categories = [ "api-bindings", + "external-ffi-bindings", "game-development", "graphics", "rendering::graphics-api", ] +# TODO: Remove when crate is renamed, this is the default documentation = "https://docs.rs/ash" edition = "2021" # TODO: reevaluate, then update in ci.yml diff --git a/ash-window/Cargo.toml b/ash-window/Cargo.toml index 76ad7c154..761bf645a 100644 --- a/ash-window/Cargo.toml +++ b/ash-window/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "ash-window" version = "0.12.0" -authors = ["msiglreith "] +authors = [ + "msiglreith ", + "Marijn Suijten ", +] license = "MIT OR Apache-2.0" description = "Interop library between ash and raw-window-handle" -documentation = "https://docs.rs/ash-window" -repository = "https://github.com/MaikKlein/ash" -readme = "README.md" -keywords = ["window", "ash", "graphics"] -categories = ["game-engines", "graphics"] -exclude = [".github/*"] -workspace = ".." +repository = "https://github.com/ash-rs/ash" +keywords = ["windowing", "ash", "graphics", "vulkan", "raw-window-handle"] +categories = [ + "api-bindings", + "game-development", + "graphics", + "rendering::graphics-api" +] edition = "2021" rust-version = "1.64.0" diff --git a/ash-window/Changelog.md b/ash-window/Changelog.md index ec2cbbf8f..bf8716f5d 100644 --- a/ash-window/Changelog.md +++ b/ash-window/Changelog.md @@ -21,38 +21,38 @@ ### Changed -- Bumped `ash` version to [`0.37`](https://github.com/MaikKlein/ash/releases/tag/0.37.0) (#600) +- Bumped `ash` version to [`0.37`](https://github.com/ash-rs/ash/releases/tag/0.37.0) (#600) - Make `enumerate_required_extensions()` return `&[*const c_char]` instead of `Vec<&CStr>` to match `ash::vk::InstanceCreateInfo` (#590) ## [0.9.1] - 2022-02-21 ### Changed -- Convert `ash` version to a range, allowing [`0.34`](https://github.com/MaikKlein/ash/releases/tag/0.34.0)-[`0.36`](https://github.com/MaikKlein/ash/releases/tag/0.36.0) (#585) +- Convert `ash` version to a range, allowing [`0.34`](https://github.com/ash-rs/ash/releases/tag/0.34.0)-[`0.36`](https://github.com/ash-rs/ash/releases/tag/0.36.0) (#585) ## [0.9.0] - 2021-12-27 ### Changed -- Bumped `ash` version to [`0.35`](https://github.com/MaikKlein/ash/releases/tag/0.35.0) +- Bumped `ash` version to [`0.35`](https://github.com/ash-rs/ash/releases/tag/0.35.0) ## [0.8.0] - 2021-12-22 ### Changed -- Bumped `ash` version to [`0.34`](https://github.com/MaikKlein/ash/releases/tag/0.34.0) +- Bumped `ash` version to [`0.34`](https://github.com/ash-rs/ash/releases/tag/0.34.0) ## [0.7.0] - 2021-07-30 ### Changed -- Bumped `ash` version to [`0.33`](https://github.com/MaikKlein/ash/releases/tag/0.33.0) +- Bumped `ash` version to [`0.33`](https://github.com/ash-rs/ash/releases/tag/0.33.0) ## [0.6.0] ### Changed -- Bumped `ash` version to [`0.32`](https://github.com/MaikKlein/ash/releases/tag/0.32.0) +- Bumped `ash` version to [`0.32`](https://github.com/ash-rs/ash/releases/tag/0.32.0) ## [0.5.0] @@ -85,13 +85,13 @@ ## Version 0.1.0 Initial release for `raw-window-handle = "0.3"` with Windows, Linux, Android, MacOS/iOS support. -[Unreleased]: https://github.com/MaikKlein/ash/compare/ash-window-0.12.0...HEAD -[0.12.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.12.0 -[0.11.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.11.0 -[0.10.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.10.0 -[0.9.1]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.9.1 -[0.9.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.9.0 -[0.8.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.8.0 -[0.7.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.7.0 -[0.6.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.6.0 -[0.5.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.5.0 +[Unreleased]: https://github.com/ash-rs/ash/compare/ash-window-0.12.0...HEAD +[0.12.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.12.0 +[0.11.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.11.0 +[0.10.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.10.0 +[0.9.1]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.9.1 +[0.9.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.9.0 +[0.8.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.8.0 +[0.7.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.7.0 +[0.6.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.6.0 +[0.5.0]: https://github.com/ash-rs/ash/releases/tag/ash-window-0.5.0 diff --git a/ash-window/README.md b/ash-window/README.md index 8cb3279f1..b683999ac 100644 --- a/ash-window/README.md +++ b/ash-window/README.md @@ -1,10 +1,10 @@ ## Ash-window -Interoperability between [`ash`](https://github.com/MaikKlein/ash) and [`raw-window-handle`](https://github.com/rust-windowing/raw-window-handle) for surface creation. +Interoperability between [`ash`](https://github.com/ash-rs/ash) and [`raw-window-handle`](https://github.com/rust-windowing/raw-window-handle) for surface creation. [![Crates.io Version](https://img.shields.io/crates/v/ash-window.svg)](https://crates.io/crates/ash-window) [![Documentation](https://docs.rs/ash-window/badge.svg)](https://docs.rs/ash-window) -[![Build Status](https://github.com/MaikKlein/ash/workflows/CI/badge.svg)](https://github.com/MaikKlein/ash/actions?workflow=CI) +[![Build Status](https://github.com/ash-rs/ash/workflows/CI/badge.svg)](https://github.com/ash-rs/ash/actions?workflow=CI) [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT) [![LICENSE](https://img.shields.io/badge/license-apache-blue.svg)](LICENSE-APACHE) [![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/ash/Cargo.toml b/ash/Cargo.toml index 130854fa0..19952f37b 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -8,10 +8,16 @@ authors = [ ] description = "Vulkan bindings for Rust" license = "MIT OR Apache-2.0" -repository = "https://github.com/MaikKlein/ash" +repository = "https://github.com/ash-rs/ash" readme = "../README.md" -keywords = ["vulkan", "graphic"] -documentation = "https://docs.rs/ash" +keywords = ["gamedev", "graphics", "vulkan", "bindings"] +categories = [ + "api-bindings", + "external-ffi-bindings", + "game-development", + "graphics", + "rendering::graphics-api" +] edition = "2021" rust-version = "1.60.0" diff --git a/ash/src/util.rs b/ash/src/util.rs index 894af0b32..0116f74b8 100644 --- a/ash/src/util.rs +++ b/ash/src/util.rs @@ -117,7 +117,7 @@ pub fn read_spv(x: &mut R) -> io::Result> { return Err(io::Error::new(io::ErrorKind::InvalidData, "input too long")); } let words = (size / 4) as usize; - // https://github.com/MaikKlein/ash/issues/354: + // https://github.com/ash-rs/ash/issues/354: // Zero-initialize the result to prevent read_exact from possibly // reading uninitialized memory. let mut result = vec![0u32; words]; From 4bbfa54146480666d605b825064fdb48d648eae2 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 17 Nov 2023 17:27:28 +0100 Subject: [PATCH 07/23] 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 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- README.md | 16 +++++++--------- {examples => ash-examples}/Cargo.toml | 3 ++- {examples => ash-examples}/assets/rust.png | Bin .../shader/texture/frag.spv | Bin .../shader/texture/texture.frag | 0 .../shader/texture/texture.vert | 0 .../shader/texture/vert.spv | Bin .../shader/triangle/frag.spv | Bin .../shader/triangle/triangle.frag | 0 .../shader/triangle/triangle.vert | 0 .../shader/triangle/vert.spv | Bin {examples => ash-examples}/src/bin/texture.rs | 3 +-- {examples => ash-examples}/src/bin/triangle.rs | 7 ++++--- {examples => ash-examples}/src/lib.rs | 0 generator-rewrite/Cargo.toml | 1 + generator/Cargo.toml | 1 + 18 files changed, 19 insertions(+), 18 deletions(-) rename {examples => ash-examples}/Cargo.toml (92%) rename {examples => ash-examples}/assets/rust.png (100%) rename {examples => ash-examples}/shader/texture/frag.spv (100%) rename {examples => ash-examples}/shader/texture/texture.frag (100%) rename {examples => ash-examples}/shader/texture/texture.vert (100%) rename {examples => ash-examples}/shader/texture/vert.spv (100%) rename {examples => ash-examples}/shader/triangle/frag.spv (100%) rename {examples => ash-examples}/shader/triangle/triangle.frag (100%) rename {examples => ash-examples}/shader/triangle/triangle.vert (100%) rename {examples => ash-examples}/shader/triangle/vert.spv (100%) rename {examples => ash-examples}/src/bin/texture.rs (99%) rename {examples => ash-examples}/src/bin/triangle.rs (99%) rename {examples => ash-examples}/src/lib.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ccf83c7e..ab7db47d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.64.0 - - run: cargo check -p ash-window -p examples --all-features + - run: cargo check -p ash-window -p ash-examples --all-features # TODO: add a similar job for the rewrite once that generates code generated: diff --git a/Cargo.toml b/Cargo.toml index a11a2c018..4138968ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [workspace] members = [ - "examples", + "analysis", "ash", + "ash-examples", "ash-rewrite", "ash-window", - "analysis", "generator", "generator-rewrite", ] diff --git a/README.md b/README.md index d554e42cc..235d48aee 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ If, on the other hand, your application cannot handle Vulkan being missing at ru ## Example -You can find the examples [here](https://github.com/ash-rs/ash/tree/master/examples). +You can find the examples [here](https://github.com/ash-rs/ash/tree/master/ash-examples). All examples currently require: the LunarG Validation layers and a Vulkan library that is visible in your `PATH`. An easy way to get started is to use the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/) #### Windows @@ -218,24 +218,22 @@ VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \ cargo run ... ``` -### [Triangle](https://github.com/ash-rs/ash/blob/master/examples/src/bin/triangle.rs) +### [Triangle](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/triangle.rs) Displays a triangle with vertex colors. -``` -cd examples -cargo run --bin triangle +```sh +cargo run -p ash-examples --bin triangle ``` ![screenshot](http://i.imgur.com/PQZcL6w.jpg) -### [Texture](https://github.com/ash-rs/ash/blob/master/examples/src/bin/texture.rs) +### [Texture](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/texture.rs) Displays a texture on a quad. -``` -cd examples -cargo run --bin texture +```sh +cargo run -p ash-examples --bin texture ``` ![texture](http://i.imgur.com/trow00H.png) diff --git a/examples/Cargo.toml b/ash-examples/Cargo.toml similarity index 92% rename from examples/Cargo.toml rename to ash-examples/Cargo.toml index 22ddf61fe..853d7ab5e 100644 --- a/examples/Cargo.toml +++ b/ash-examples/Cargo.toml @@ -1,8 +1,9 @@ [package] -name = "examples" +name = "ash-examples" version = "0.1.0" authors = ["maik klein "] edition = "2021" +publish = false [dependencies] image = "0.24" diff --git a/examples/assets/rust.png b/ash-examples/assets/rust.png similarity index 100% rename from examples/assets/rust.png rename to ash-examples/assets/rust.png diff --git a/examples/shader/texture/frag.spv b/ash-examples/shader/texture/frag.spv similarity index 100% rename from examples/shader/texture/frag.spv rename to ash-examples/shader/texture/frag.spv diff --git a/examples/shader/texture/texture.frag b/ash-examples/shader/texture/texture.frag similarity index 100% rename from examples/shader/texture/texture.frag rename to ash-examples/shader/texture/texture.frag diff --git a/examples/shader/texture/texture.vert b/ash-examples/shader/texture/texture.vert similarity index 100% rename from examples/shader/texture/texture.vert rename to ash-examples/shader/texture/texture.vert diff --git a/examples/shader/texture/vert.spv b/ash-examples/shader/texture/vert.spv similarity index 100% rename from examples/shader/texture/vert.spv rename to ash-examples/shader/texture/vert.spv diff --git a/examples/shader/triangle/frag.spv b/ash-examples/shader/triangle/frag.spv similarity index 100% rename from examples/shader/triangle/frag.spv rename to ash-examples/shader/triangle/frag.spv diff --git a/examples/shader/triangle/triangle.frag b/ash-examples/shader/triangle/triangle.frag similarity index 100% rename from examples/shader/triangle/triangle.frag rename to ash-examples/shader/triangle/triangle.frag diff --git a/examples/shader/triangle/triangle.vert b/ash-examples/shader/triangle/triangle.vert similarity index 100% rename from examples/shader/triangle/triangle.vert rename to ash-examples/shader/triangle/triangle.vert diff --git a/examples/shader/triangle/vert.spv b/ash-examples/shader/triangle/vert.spv similarity index 100% rename from examples/shader/triangle/vert.spv rename to ash-examples/shader/triangle/vert.spv diff --git a/examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs similarity index 99% rename from examples/src/bin/texture.rs rename to ash-examples/src/bin/texture.rs index 482b5c3db..298446c4c 100644 --- a/examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -6,8 +6,7 @@ use std::os::raw::c_void; use ash::util::*; use ash::vk; - -use examples::*; +use ash_examples::*; #[derive(Clone, Debug, Copy)] struct Vertex { diff --git a/examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs similarity index 99% rename from examples/src/bin/triangle.rs rename to ash-examples/src/bin/triangle.rs index 46eb1ce52..621b57b2e 100644 --- a/examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -1,12 +1,13 @@ -use ash::util::*; -use ash::vk; -use examples::*; use std::default::Default; use std::ffi::CStr; use std::io::Cursor; use std::mem; use std::mem::align_of; +use ash::util::*; +use ash::vk; +use ash_examples::*; + #[derive(Clone, Debug, Copy)] struct Vertex { pos: [f32; 4], diff --git a/examples/src/lib.rs b/ash-examples/src/lib.rs similarity index 100% rename from examples/src/lib.rs rename to ash-examples/src/lib.rs diff --git a/generator-rewrite/Cargo.toml b/generator-rewrite/Cargo.toml index ba95a8155..08e458ac0 100644 --- a/generator-rewrite/Cargo.toml +++ b/generator-rewrite/Cargo.toml @@ -2,6 +2,7 @@ name = "generator-rewrite" version = "2.0.0" edition = "2021" +publish = false [dependencies] analysis = { path = "../analysis" } diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 8df2ba1da..83fa5578a 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -3,6 +3,7 @@ name = "generator" version = "0.1.0" authors = ["Maik Klein "] edition = "2021" +publish = false [dependencies] bindgen = "0.64" From 7a73f011c858c1e41936a6a8a90c4ebe2f510cbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:39:24 +0100 Subject: [PATCH 08/23] build(deps): update vk-parse requirement from 0.10 to 0.12 (#825) Updates the requirements on [vk-parse](https://github.com/krolli/vk-parse) to permit the latest version. - [Commits](https://github.com/krolli/vk-parse/compare/vk-parse-0.10.0...vk-parse-0.12.0) --- updated-dependencies: - dependency-name: vk-parse dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- generator/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 83fa5578a..7d15cf544 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -14,7 +14,7 @@ once_cell = "1.7" proc-macro2 = "1.0" quote = "1.0" regex = "1.4" -vk-parse = { version = "0.10", features = ["vkxml-convert"] } +vk-parse = { version = "0.12", features = ["vkxml-convert"] } vkxml = "0.3" [dependencies.syn] From 5952227dc449138e14d3ec7a418dc84f74a60f4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:39:32 +0100 Subject: [PATCH 09/23] build(deps): update itertools requirement from 0.10 to 0.12 (#824) Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version. - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.0...v0.12.0) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- generator/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 7d15cf544..73ebace46 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] bindgen = "0.64" heck = "0.4" -itertools = "0.10" +itertools = "0.12" nom = "7.1" once_cell = "1.7" proc-macro2 = "1.0" From c045383ab1f753e64396c141f0ec531471b7dc0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:53:08 +0100 Subject: [PATCH 10/23] build(deps): update bindgen requirement from 0.64 to 0.69 (#823) Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version. - [Release notes](https://github.com/rust-lang/rust-bindgen/releases) - [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.64.0...v0.69.1) --- updated-dependencies: - dependency-name: bindgen dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ash/src/vk/native.rs | 2 +- generator/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ash/src/vk/native.rs b/ash/src/vk/native.rs index ac304d0a0..223fb738f 100644 --- a/ash/src/vk/native.rs +++ b/ash/src/vk/native.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.64.0 */ +/* automatically generated by rust-bindgen 0.69.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 73ebace46..0422e161a 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" publish = false [dependencies] -bindgen = "0.64" +bindgen = "0.69" heck = "0.4" itertools = "0.12" nom = "7.1" From 7005a490b20efa8da7aafc5d7271963f88321b75 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 21 Nov 2023 11:14:32 +0100 Subject: [PATCH 11/23] cargo: Set `resolver = "2"` and avoid warning Since a few Rust versions `cargo` complains: warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` Avoid that by setting the resolver for the virtual manifest to `"2"` explicitly. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 4138968ab..17b22f707 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "analysis", "ash", From b358b9dd8d4e0a32639044a420dfe3ae507e51ed Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 25 Nov 2023 11:08:48 +0100 Subject: [PATCH 12/23] extensions/khr/ray_tracing_pipeline: Pass indirect SBT regions as single item (#829) In an identical fashion to commit 84624fd ("ray_tracing_pipeline: Pass SBT regions as reference instead of slice (#350)") `cmd_trace_rays_indirect()` also only needs a pointer to a single `StridedDeviceAddressRegionKHR` structure. After all no length is ever passed to the API anywhere, and this could also lead to users passing empty slices, or passing too many elements that are never used. Clear up the confusion by replacing the slice argument with a direct borrow of the struct. --- Changelog.md | 1 + ash/src/extensions/khr/ray_tracing_pipeline.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Changelog.md b/Changelog.md index 7f0a41e01..00b6b1230 100644 --- a/Changelog.md +++ b/Changelog.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `VK_KHR_device_group_creation`: Take borrow of `Entry` in `fn new()` (#753) - `VK_KHR_device_group_creation`: Rename `vk::Instance`-returning function from `device()` to `instance()` (#759) - Windows `HANDLE` types (`HWND`, `HINSTANCE`, `HMONITOR`) are now defined as `isize` instead of `*const c_void` (#797) +- extensions/ext/ray_tracing_pipeline: Pass indirect SBT regions as single item reference. (#829) ### Removed diff --git a/ash/src/extensions/khr/ray_tracing_pipeline.rs b/ash/src/extensions/khr/ray_tracing_pipeline.rs index 72e7de34b..ed397cd7b 100644 --- a/ash/src/extensions/khr/ray_tracing_pipeline.rs +++ b/ash/src/extensions/khr/ray_tracing_pipeline.rs @@ -122,18 +122,18 @@ impl RayTracingPipeline { pub unsafe fn cmd_trace_rays_indirect( &self, command_buffer: vk::CommandBuffer, - raygen_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR], - miss_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR], - hit_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR], - callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR], + raygen_shader_binding_table: &vk::StridedDeviceAddressRegionKHR, + miss_shader_binding_table: &vk::StridedDeviceAddressRegionKHR, + hit_shader_binding_table: &vk::StridedDeviceAddressRegionKHR, + callable_shader_binding_table: &vk::StridedDeviceAddressRegionKHR, indirect_device_address: vk::DeviceAddress, ) { (self.fp.cmd_trace_rays_indirect_khr)( command_buffer, - raygen_shader_binding_table.as_ptr(), - miss_shader_binding_table.as_ptr(), - hit_shader_binding_table.as_ptr(), - callable_shader_binding_table.as_ptr(), + raygen_shader_binding_table, + miss_shader_binding_table, + hit_shader_binding_table, + callable_shader_binding_table, indirect_device_address, ); } From ccf6be8be3c0206578ae6cbb9766d6281bbda2a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 09:33:50 +0100 Subject: [PATCH 13/23] build(deps): update syn requirement from 1.0 to 2.0 (#834) Updates the requirements on [syn](https://github.com/dtolnay/syn) to permit the latest version. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/1.0.0...2.0.39) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- generator/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 0422e161a..046fafd3d 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -18,5 +18,5 @@ vk-parse = { version = "0.12", features = ["vkxml-convert"] } vkxml = "0.3" [dependencies.syn] -version = "1.0" +version = "2.0" features = ["full", "extra-traits"] From 5938fd2633023c720eeb3282ee7145319c8e3425 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 28 Nov 2023 15:05:27 +0100 Subject: [PATCH 14/23] Update Vulkan-Headers to 1.3.271 (#816) * Update Vulkan-Headers to 1.3.270 * Update Vulkan-Headers to 1.3.271 * extensions/nv/low_latency2: Support extension revision 2 Upon request the VK_NV_low_latency2 spec and API has been updated to move the count pointer from the `vkGetLatencyTimingsNV()` function to the `vkGetLatencyMarkerInfoNV` struct where the array pointer already resided. This got uncovered when it was realized that the `latency_marker_info` argument isn't an array at all (which the original design of this extension suggested), but a pointer to a single struct that _contains_ a pointer to an array, with the length passed as a separate argument to the function instead. The move of this count argument to a struct field - together with proper array length annotations - gets our generator to automatically emit a setter based on a slice argument. --- Changelog.md | 2 +- ash/Cargo.toml | 2 +- ash/src/extensions/nv/low_latency2.rs | 23 ++---------- ash/src/vk/const_debugs.rs | 3 ++ ash/src/vk/definitions.rs | 50 ++++++++++++++++++++++++--- ash/src/vk/extensions.rs | 16 +++++++-- generator/Vulkan-Headers | 2 +- 7 files changed, 66 insertions(+), 32 deletions(-) diff --git a/Changelog.md b/Changelog.md index 00b6b1230..13d9cd84a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `Handle::is_null()` to allow checking if a handle is a `NULL` value (#694) - Allow building `Entry`/`Instance`/`Device` from handle+fns (see their `from_parts_1_x()` associated functions) (#748) -- Update Vulkan-Headers to 1.3.269 (#760, #763, #783) +- Update Vulkan-Headers to 1.3.271 (#760, #763, #783, #816) - Added `VK_NV_memory_decompression` device extension (#761) - Added `VK_GOOGLE_display_timing` device extension (#765) - Added `VK_ANDROID_external_memory_android_hardware_buffer` device extension (#769) diff --git a/ash/Cargo.toml b/ash/Cargo.toml index 19952f37b..e27f2280a 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ash" -version = "0.37.0+1.3.269" +version = "0.37.0+1.3.271" authors = [ "Maik Klein ", "Benjamin Saunders ", diff --git a/ash/src/extensions/nv/low_latency2.rs b/ash/src/extensions/nv/low_latency2.rs index 88a1f9233..76a6720bc 100644 --- a/ash/src/extensions/nv/low_latency2.rs +++ b/ash/src/extensions/nv/low_latency2.rs @@ -4,7 +4,6 @@ use crate::RawPtr; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; -use std::ptr; /// #[derive(Clone)] @@ -53,32 +52,14 @@ impl LowLatency2 { (self.fp.set_latency_marker_nv)(self.handle, swapchain, latency_marker_info) } - /// Retrieve the number of elements to pass to [`get_latency_timings()`][Self::get_latency_timings()] - #[inline] - pub unsafe fn get_latency_timings_len(&self, swapchain: vk::SwapchainKHR) -> usize { - let mut count = 0; - (self.fp.get_latency_timings_nv)(self.handle, swapchain, &mut count, ptr::null_mut()); - count as usize - } - /// - /// - /// Call [`get_latency_timings_len()`][Self::get_latency_timings_len()] to query the number of elements to pass to `latency_marker_info`. - /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer. #[inline] pub unsafe fn get_latency_timings( &self, swapchain: vk::SwapchainKHR, - latency_marker_info: &mut [vk::GetLatencyMarkerInfoNV<'_>], + latency_marker_info: &mut vk::GetLatencyMarkerInfoNV<'_>, ) { - let mut count = latency_marker_info.len() as u32; - (self.fp.get_latency_timings_nv)( - self.handle, - swapchain, - &mut count, - latency_marker_info.as_mut_ptr(), - ); - assert_eq!(count as usize, latency_marker_info.len()); + (self.fp.get_latency_timings_nv)(self.handle, swapchain, latency_marker_info) } /// diff --git a/ash/src/vk/const_debugs.rs b/ash/src/vk/const_debugs.rs index c7b2b6145..af86517d7 100644 --- a/ash/src/vk/const_debugs.rs +++ b/ash/src/vk/const_debugs.rs @@ -5272,6 +5272,9 @@ impl fmt::Debug for StructureType { Some("PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT") } Self::HDR_METADATA_EXT => Some("HDR_METADATA_EXT"), + Self::PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG => { + Some("PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG") + } Self::SHARED_PRESENT_SURFACE_CAPABILITIES_KHR => { Some("SHARED_PRESENT_SURFACE_CAPABILITIES_KHR") } diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index d9f9dc5bb..a3b4de47f 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -58,7 +58,7 @@ pub const API_VERSION_1_2: u32 = make_api_version(0, 1, 2, 0); #[doc = ""] pub const API_VERSION_1_3: u32 = make_api_version(0, 1, 3, 0); #[doc = ""] -pub const HEADER_VERSION: u32 = 269; +pub const HEADER_VERSION: u32 = 271; #[doc = ""] pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 3, HEADER_VERSION); #[doc = ""] @@ -49770,7 +49770,7 @@ impl<'a> DirectDriverLoadingInfoLUNARG<'a> { #[doc = ""] pub struct DirectDriverLoadingListLUNARG<'a> { pub s_type: StructureType, - pub p_next: *mut c_void, + pub p_next: *const c_void, pub mode: DirectDriverLoadingModeLUNARG, pub driver_count: u32, pub p_drivers: *const DirectDriverLoadingInfoLUNARG<'a>, @@ -49781,7 +49781,7 @@ impl ::std::default::Default for DirectDriverLoadingListLUNARG<'_> { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null_mut(), + p_next: ::std::ptr::null(), mode: DirectDriverLoadingModeLUNARG::default(), driver_count: u32::default(), p_drivers: ::std::ptr::null(), @@ -51872,6 +51872,7 @@ impl<'a> SetLatencyMarkerInfoNV<'a> { pub struct GetLatencyMarkerInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, + pub timing_count: u32, pub p_timings: *mut LatencyTimingsFrameReportNV<'a>, pub _marker: PhantomData<&'a ()>, } @@ -51881,6 +51882,7 @@ impl ::std::default::Default for GetLatencyMarkerInfoNV<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), + timing_count: u32::default(), p_timings: ::std::ptr::null_mut(), _marker: PhantomData, } @@ -51891,8 +51893,9 @@ unsafe impl<'a> TaggedStructure for GetLatencyMarkerInfoNV<'a> { } impl<'a> GetLatencyMarkerInfoNV<'a> { #[inline] - pub fn timings(mut self, timings: &'a mut LatencyTimingsFrameReportNV<'a>) -> Self { - self.p_timings = timings; + pub fn timings(mut self, timings: &'a mut [LatencyTimingsFrameReportNV<'a>]) -> Self { + self.timing_count = timings.len() as _; + self.p_timings = timings.as_mut_ptr(); self } } @@ -52327,3 +52330,40 @@ impl<'a> PhysicalDeviceSchedulingControlsPropertiesARM<'a> { self } } +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub relaxed_line_rasterization: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + relaxed_line_rasterization: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> {} +impl<'a> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + #[inline] + pub fn relaxed_line_rasterization(mut self, relaxed_line_rasterization: bool) -> Self { + self.relaxed_line_rasterization = relaxed_line_rasterization.into(); + self + } +} diff --git a/ash/src/vk/extensions.rs b/ash/src/vk/extensions.rs index 882d79385..d66bbebcc 100644 --- a/ash/src/vk/extensions.rs +++ b/ash/src/vk/extensions.rs @@ -5703,6 +5703,18 @@ impl StructureType { pub const SUBPASS_BEGIN_INFO_KHR: Self = Self::SUBPASS_BEGIN_INFO; pub const SUBPASS_END_INFO_KHR: Self = Self::SUBPASS_END_INFO; } +impl ImgRelaxedLineRasterizationFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_relaxed_line_rasterization\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct ImgRelaxedLineRasterizationFn; +#[doc = "Generated from 'VK_IMG_relaxed_line_rasterization'"] +impl StructureType { + pub const PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: Self = Self(1_000_110_000); +} impl KhrSharedPresentableImageFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shared_presentable_image\0") @@ -21711,7 +21723,7 @@ impl StructureType { impl NvLowLatency2Fn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_low_latency2\0") }; - pub const SPEC_VERSION: u32 = 1u32; + pub const SPEC_VERSION: u32 = 2u32; } #[allow(non_camel_case_types)] pub type PFN_vkSetLatencySleepModeNV = unsafe extern "system" fn( @@ -21735,7 +21747,6 @@ pub type PFN_vkSetLatencyMarkerNV = unsafe extern "system" fn( pub type PFN_vkGetLatencyTimingsNV = unsafe extern "system" fn( device: Device, swapchain: SwapchainKHR, - p_timing_count: *mut u32, p_latency_marker_info: *mut GetLatencyMarkerInfoNV<'_>, ); #[allow(non_camel_case_types)] @@ -21817,7 +21828,6 @@ impl NvLowLatency2Fn { unsafe extern "system" fn get_latency_timings_nv( _device: Device, _swapchain: SwapchainKHR, - _p_timing_count: *mut u32, _p_latency_marker_info: *mut GetLatencyMarkerInfoNV<'_>, ) { panic!(concat!( diff --git a/generator/Vulkan-Headers b/generator/Vulkan-Headers index 374f9fd97..9d27c893c 160000 --- a/generator/Vulkan-Headers +++ b/generator/Vulkan-Headers @@ -1 +1 @@ -Subproject commit 374f9fd97520f6dd1b80745de09208d878ab4a52 +Subproject commit 9d27c893cdfc8d96bc8ad5f6f4d88743f958305e From 02c7a8359282fa8d947fb3258e07f899bf732d14 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Wed, 29 Nov 2023 00:37:21 +0100 Subject: [PATCH 15/23] Provide `CStr` getters and setters for `c_char` pointers and arrays (#831) It is a common operation to read and write NUL-terminated C string in the Vulkan API, yet the only helpers for that were thus far open-coded in the `Debug` printing implementations. Move them to separate functions that are exposed to the user, in hopes of helping them no longer misunderstand NUL-terminated strings (see e.g. #830). Important to note is that the array-copy for a static-sized `c_char` array has also been replaced with a `CStr` wrapper: this forces the user and our implementation to have a NUL-terminator at the end of the string, and the setter returns `Err()` when the given `CStr (with NUL-terminator) is too large for the static-sized array it has to be written to. --- Changelog.md | 4 +- ash/src/vk/definitions.rs | 468 +++++++++++++++++++++++++------------- ash/src/vk/prelude.rs | 43 ++++ generator/src/lib.rs | 149 ++++++------ 4 files changed, 436 insertions(+), 228 deletions(-) diff --git a/Changelog.md b/Changelog.md index 13d9cd84a..99b391b69 100644 --- a/Changelog.md +++ b/Changelog.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `VK_EXT_hdr_metadata` device extension (#804) - Added `VK_NV_cuda_kernel_launch` device extension (#805) - Added `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (#809) +- Added `*_as_c_str()` getters for `c_char` pointers and `c_char` arrays (#831) ### Changed @@ -48,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `VK_KHR_device_group_creation`: Take borrow of `Entry` in `fn new()` (#753) - `VK_KHR_device_group_creation`: Rename `vk::Instance`-returning function from `device()` to `instance()` (#759) - Windows `HANDLE` types (`HWND`, `HINSTANCE`, `HMONITOR`) are now defined as `isize` instead of `*const c_void` (#797) -- extensions/ext/ray_tracing_pipeline: Pass indirect SBT regions as single item reference. (#829) +- extensions/ext/ray_tracing_pipeline: Pass indirect SBT regions as single item reference (#829) +- Replaced `c_char` array setters with `CStr` setters (#831) ### Removed diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index a3b4de47f..c0b537d52 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -817,9 +817,7 @@ impl fmt::Debug for PhysicalDeviceProperties { .field("vendor_id", &self.vendor_id) .field("device_id", &self.device_id) .field("device_type", &self.device_type) - .field("device_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.device_name.as_ptr()) - }) + .field("device_name", &unsafe { self.device_name_as_c_str() }) .field("pipeline_cache_uuid", &self.pipeline_cache_uuid) .field("limits", &self.limits) .field("sparse_properties", &self.sparse_properties) @@ -869,9 +867,15 @@ impl PhysicalDeviceProperties { self } #[inline] - pub fn device_name(mut self, device_name: [c_char; MAX_PHYSICAL_DEVICE_NAME_SIZE]) -> Self { - self.device_name = device_name; - self + pub fn device_name( + mut self, + device_name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.device_name, device_name).map(|()| self) + } + #[inline] + pub unsafe fn device_name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.device_name) } #[inline] pub fn pipeline_cache_uuid(mut self, pipeline_cache_uuid: [u8; UUID_SIZE]) -> Self { @@ -900,9 +904,7 @@ pub struct ExtensionProperties { impl fmt::Debug for ExtensionProperties { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("ExtensionProperties") - .field("extension_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.extension_name.as_ptr()) - }) + .field("extension_name", &unsafe { self.extension_name_as_c_str() }) .field("spec_version", &self.spec_version) .finish() } @@ -918,9 +920,15 @@ impl ::std::default::Default for ExtensionProperties { } impl ExtensionProperties { #[inline] - pub fn extension_name(mut self, extension_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { - self.extension_name = extension_name; - self + pub fn extension_name( + mut self, + extension_name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.extension_name, extension_name).map(|()| self) + } + #[inline] + pub unsafe fn extension_name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.extension_name) } #[inline] pub fn spec_version(mut self, spec_version: u32) -> Self { @@ -941,14 +949,10 @@ pub struct LayerProperties { impl fmt::Debug for LayerProperties { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("LayerProperties") - .field("layer_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.layer_name.as_ptr()) - }) + .field("layer_name", &unsafe { self.layer_name_as_c_str() }) .field("spec_version", &self.spec_version) .field("implementation_version", &self.implementation_version) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("description", &unsafe { self.description_as_c_str() }) .finish() } } @@ -965,9 +969,15 @@ impl ::std::default::Default for LayerProperties { } impl LayerProperties { #[inline] - pub fn layer_name(mut self, layer_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { - self.layer_name = layer_name; - self + pub fn layer_name( + mut self, + layer_name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.layer_name, layer_name).map(|()| self) + } + #[inline] + pub unsafe fn layer_name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.layer_name) } #[inline] pub fn spec_version(mut self, spec_version: u32) -> Self { @@ -980,9 +990,15 @@ impl LayerProperties { self } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } } #[repr(C)] @@ -1019,21 +1035,29 @@ unsafe impl<'a> TaggedStructure for ApplicationInfo<'a> { } impl<'a> ApplicationInfo<'a> { #[inline] - pub fn application_name(mut self, application_name: &'a ::std::ffi::CStr) -> Self { + pub fn application_name(mut self, application_name: &'a std::ffi::CStr) -> Self { self.p_application_name = application_name.as_ptr(); self } #[inline] + pub unsafe fn application_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_application_name) + } + #[inline] pub fn application_version(mut self, application_version: u32) -> Self { self.application_version = application_version; self } #[inline] - pub fn engine_name(mut self, engine_name: &'a ::std::ffi::CStr) -> Self { + pub fn engine_name(mut self, engine_name: &'a std::ffi::CStr) -> Self { self.p_engine_name = engine_name.as_ptr(); self } #[inline] + pub unsafe fn engine_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_engine_name) + } + #[inline] pub fn engine_version(mut self, engine_version: u32) -> Self { self.engine_version = engine_version; self @@ -3651,11 +3675,15 @@ impl<'a> PipelineShaderStageCreateInfo<'a> { self } #[inline] - pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_name) + } + #[inline] pub fn specialization_info(mut self, specialization_info: &'a SpecializationInfo<'a>) -> Self { self.p_specialization_info = specialization_info; self @@ -7712,11 +7740,15 @@ impl<'a> DisplayPropertiesKHR<'a> { self } #[inline] - pub fn display_name(mut self, display_name: &'a ::std::ffi::CStr) -> Self { + pub fn display_name(mut self, display_name: &'a std::ffi::CStr) -> Self { self.display_name = display_name.as_ptr(); self } #[inline] + pub unsafe fn display_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.display_name) + } + #[inline] pub fn physical_dimensions(mut self, physical_dimensions: Extent2D) -> Self { self.physical_dimensions = physical_dimensions; self @@ -8985,10 +9017,14 @@ impl<'a> DebugMarkerObjectNameInfoEXT<'a> { self } #[inline] - pub fn object_name(mut self, object_name: &'a ::std::ffi::CStr) -> Self { + pub fn object_name(mut self, object_name: &'a std::ffi::CStr) -> Self { self.p_object_name = object_name.as_ptr(); self } + #[inline] + pub unsafe fn object_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_object_name) + } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] @@ -9073,11 +9109,15 @@ unsafe impl<'a> TaggedStructure for DebugMarkerMarkerInfoEXT<'a> { } impl<'a> DebugMarkerMarkerInfoEXT<'a> { #[inline] - pub fn marker_name(mut self, marker_name: &'a ::std::ffi::CStr) -> Self { + pub fn marker_name(mut self, marker_name: &'a std::ffi::CStr) -> Self { self.p_marker_name = marker_name.as_ptr(); self } #[inline] + pub unsafe fn marker_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_marker_name) + } + #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { self.color = color; self @@ -10908,12 +10948,8 @@ impl fmt::Debug for PhysicalDeviceDriverProperties<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) - .field("driver_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr()) - }) - .field("driver_info", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr()) - }) + .field("driver_name", &unsafe { self.driver_name_as_c_str() }) + .field("driver_info", &unsafe { self.driver_info_as_c_str() }) .field("conformance_version", &self.conformance_version) .finish() } @@ -10943,14 +10979,26 @@ impl<'a> PhysicalDeviceDriverProperties<'a> { self } #[inline] - pub fn driver_name(mut self, driver_name: [c_char; MAX_DRIVER_NAME_SIZE]) -> Self { - self.driver_name = driver_name; - self + pub fn driver_name( + mut self, + driver_name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.driver_name, driver_name).map(|()| self) } #[inline] - pub fn driver_info(mut self, driver_info: [c_char; MAX_DRIVER_INFO_SIZE]) -> Self { - self.driver_info = driver_info; - self + pub unsafe fn driver_name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.driver_name) + } + #[inline] + pub fn driver_info( + mut self, + driver_info: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) + } + #[inline] + pub unsafe fn driver_info_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.driver_info) } #[inline] pub fn conformance_version(mut self, conformance_version: ConformanceVersion) -> Self { @@ -18302,10 +18350,14 @@ impl<'a> DebugUtilsObjectNameInfoEXT<'a> { self } #[inline] - pub fn object_name(mut self, object_name: &'a ::std::ffi::CStr) -> Self { + pub fn object_name(mut self, object_name: &'a std::ffi::CStr) -> Self { self.p_object_name = object_name.as_ptr(); self } + #[inline] + pub unsafe fn object_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_object_name) + } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] @@ -18386,11 +18438,15 @@ unsafe impl<'a> TaggedStructure for DebugUtilsLabelEXT<'a> { } impl<'a> DebugUtilsLabelEXT<'a> { #[inline] - pub fn label_name(mut self, label_name: &'a ::std::ffi::CStr) -> Self { + pub fn label_name(mut self, label_name: &'a std::ffi::CStr) -> Self { self.p_label_name = label_name.as_ptr(); self } #[inline] + pub unsafe fn label_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_label_name) + } + #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { self.color = color; self @@ -18525,21 +18581,29 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { self } #[inline] - pub fn message_id_name(mut self, message_id_name: &'a ::std::ffi::CStr) -> Self { + pub fn message_id_name(mut self, message_id_name: &'a std::ffi::CStr) -> Self { self.p_message_id_name = message_id_name.as_ptr(); self } #[inline] + pub unsafe fn message_id_name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_message_id_name) + } + #[inline] pub fn message_id_number(mut self, message_id_number: i32) -> Self { self.message_id_number = message_id_number; self } #[inline] - pub fn message(mut self, message: &'a ::std::ffi::CStr) -> Self { + pub fn message(mut self, message: &'a std::ffi::CStr) -> Self { self.p_message = message.as_ptr(); self } #[inline] + pub unsafe fn message_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_message) + } + #[inline] pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self { self.queue_label_count = queue_labels.len() as _; self.p_queue_labels = queue_labels.as_ptr(); @@ -27064,15 +27128,9 @@ impl fmt::Debug for PerformanceCounterDescriptionKHR<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("flags", &self.flags) - .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr()) - }) - .field("category", &unsafe { - ::std::ffi::CStr::from_ptr(self.category.as_ptr()) - }) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("name", &unsafe { self.name_as_c_str() }) + .field("category", &unsafe { self.category_as_c_str() }) + .field("description", &unsafe { self.description_as_c_str() }) .finish() } } @@ -27100,19 +27158,37 @@ impl<'a> PerformanceCounterDescriptionKHR<'a> { self } #[inline] - pub fn name(mut self, name: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.name = name; - self + pub fn name( + mut self, + name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub fn category(mut self, category: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.category = category; - self + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.name) } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn category( + mut self, + category: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.category, category).map(|()| self) + } + #[inline] + pub unsafe fn category_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.category) + } + #[inline] + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } } #[repr(C)] @@ -28151,12 +28227,8 @@ impl fmt::Debug for PipelineExecutablePropertiesKHR<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("stages", &self.stages) - .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr()) - }) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("name", &unsafe { self.name_as_c_str() }) + .field("description", &unsafe { self.description_as_c_str() }) .field("subgroup_size", &self.subgroup_size) .finish() } @@ -28185,14 +28257,26 @@ impl<'a> PipelineExecutablePropertiesKHR<'a> { self } #[inline] - pub fn name(mut self, name: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.name = name; - self + pub fn name( + mut self, + name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.name) + } + #[inline] + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn subgroup_size(mut self, subgroup_size: u32) -> Self { @@ -28271,12 +28355,8 @@ impl fmt::Debug for PipelineExecutableStatisticKHR<'_> { fmt.debug_struct("PipelineExecutableStatisticKHR") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr()) - }) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("name", &unsafe { self.name_as_c_str() }) + .field("description", &unsafe { self.description_as_c_str() }) .field("format", &self.format) .field("value", &"union") .finish() @@ -28301,14 +28381,26 @@ unsafe impl<'a> TaggedStructure for PipelineExecutableStatisticKHR<'a> { } impl<'a> PipelineExecutableStatisticKHR<'a> { #[inline] - pub fn name(mut self, name: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.name = name; - self + pub fn name( + mut self, + name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.name) + } + #[inline] + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn format(mut self, format: PipelineExecutableStatisticFormatKHR) -> Self { @@ -28340,12 +28432,8 @@ impl fmt::Debug for PipelineExecutableInternalRepresentationKHR<'_> { fmt.debug_struct("PipelineExecutableInternalRepresentationKHR") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr()) - }) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("name", &unsafe { self.name_as_c_str() }) + .field("description", &unsafe { self.description_as_c_str() }) .field("is_text", &self.is_text) .field("data_size", &self.data_size) .field("p_data", &self.p_data) @@ -28373,14 +28461,26 @@ unsafe impl<'a> TaggedStructure for PipelineExecutableInternalRepresentationKHR< } impl<'a> PipelineExecutableInternalRepresentationKHR<'a> { #[inline] - pub fn name(mut self, name: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.name = name; - self + pub fn name( + mut self, + name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.name) + } + #[inline] + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn is_text(mut self, is_text: bool) -> Self { @@ -29848,12 +29948,8 @@ impl fmt::Debug for PhysicalDeviceVulkan12Properties<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) - .field("driver_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr()) - }) - .field("driver_info", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr()) - }) + .field("driver_name", &unsafe { self.driver_name_as_c_str() }) + .field("driver_info", &unsafe { self.driver_info_as_c_str() }) .field("conformance_version", &self.conformance_version) .field( "denorm_behavior_independence", @@ -30117,14 +30213,26 @@ impl<'a> PhysicalDeviceVulkan12Properties<'a> { self } #[inline] - pub fn driver_name(mut self, driver_name: [c_char; MAX_DRIVER_NAME_SIZE]) -> Self { - self.driver_name = driver_name; - self + pub fn driver_name( + mut self, + driver_name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.driver_name, driver_name).map(|()| self) } #[inline] - pub fn driver_info(mut self, driver_info: [c_char; MAX_DRIVER_INFO_SIZE]) -> Self { - self.driver_info = driver_info; - self + pub unsafe fn driver_name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.driver_name) + } + #[inline] + pub fn driver_info( + mut self, + driver_info: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) + } + #[inline] + pub unsafe fn driver_info_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.driver_info) } #[inline] pub fn conformance_version(mut self, conformance_version: ConformanceVersion) -> Self { @@ -31204,19 +31312,11 @@ impl fmt::Debug for PhysicalDeviceToolProperties<'_> { fmt.debug_struct("PhysicalDeviceToolProperties") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr()) - }) - .field("version", &unsafe { - ::std::ffi::CStr::from_ptr(self.version.as_ptr()) - }) + .field("name", &unsafe { self.name_as_c_str() }) + .field("version", &unsafe { self.version_as_c_str() }) .field("purposes", &self.purposes) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) - .field("layer", &unsafe { - ::std::ffi::CStr::from_ptr(self.layer.as_ptr()) - }) + .field("description", &unsafe { self.description_as_c_str() }) + .field("layer", &unsafe { self.layer_as_c_str() }) .finish() } } @@ -31240,14 +31340,26 @@ unsafe impl<'a> TaggedStructure for PhysicalDeviceToolProperties<'a> { } impl<'a> PhysicalDeviceToolProperties<'a> { #[inline] - pub fn name(mut self, name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { - self.name = name; - self + pub fn name( + mut self, + name: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub fn version(mut self, version: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { - self.version = version; - self + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.name) + } + #[inline] + pub fn version( + mut self, + version: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.version, version).map(|()| self) + } + #[inline] + pub unsafe fn version_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.version) } #[inline] pub fn purposes(mut self, purposes: ToolPurposeFlags) -> Self { @@ -31255,14 +31367,26 @@ impl<'a> PhysicalDeviceToolProperties<'a> { self } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub fn layer(mut self, layer: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { - self.layer = layer; - self + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) + } + #[inline] + pub fn layer( + mut self, + layer: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.layer, layer).map(|()| self) + } + #[inline] + pub unsafe fn layer_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.layer) } } #[repr(C)] @@ -41397,10 +41521,14 @@ impl<'a> CuFunctionCreateInfoNVX<'a> { self } #[inline] - pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } + #[inline] + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_name) + } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] @@ -43812,10 +43940,14 @@ impl<'a> CudaFunctionCreateInfoNV<'a> { self } #[inline] - pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } + #[inline] + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_name) + } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] @@ -45685,9 +45817,7 @@ impl fmt::Debug for RenderPassSubpassFeedbackInfoEXT { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("RenderPassSubpassFeedbackInfoEXT") .field("subpass_merge_status", &self.subpass_merge_status) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("description", &unsafe { self.description_as_c_str() }) .field("post_merge_index", &self.post_merge_index) .finish() } @@ -45709,9 +45839,15 @@ impl RenderPassSubpassFeedbackInfoEXT { self } #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn post_merge_index(mut self, post_merge_index: u32) -> Self { @@ -48456,9 +48592,7 @@ pub struct DeviceFaultVendorInfoEXT { impl fmt::Debug for DeviceFaultVendorInfoEXT { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("DeviceFaultVendorInfoEXT") - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("description", &unsafe { self.description_as_c_str() }) .field("vendor_fault_code", &self.vendor_fault_code) .field("vendor_fault_data", &self.vendor_fault_data) .finish() @@ -48476,9 +48610,15 @@ impl ::std::default::Default for DeviceFaultVendorInfoEXT { } impl DeviceFaultVendorInfoEXT { #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn vendor_fault_code(mut self, vendor_fault_code: u64) -> Self { @@ -48554,9 +48694,7 @@ impl fmt::Debug for DeviceFaultInfoEXT<'_> { fmt.debug_struct("DeviceFaultInfoEXT") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr()) - }) + .field("description", &unsafe { self.description_as_c_str() }) .field("p_address_infos", &self.p_address_infos) .field("p_vendor_infos", &self.p_vendor_infos) .field("p_vendor_binary_data", &self.p_vendor_binary_data) @@ -48582,9 +48720,15 @@ unsafe impl<'a> TaggedStructure for DeviceFaultInfoEXT<'a> { } impl<'a> DeviceFaultInfoEXT<'a> { #[inline] - pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn description( + mut self, + description: &std::ffi::CStr, + ) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn address_infos(mut self, address_infos: &'a mut DeviceFaultAddressInfoEXT) -> Self { @@ -50311,11 +50455,15 @@ impl<'a> ShaderCreateInfoEXT<'a> { self } #[inline] - pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_name) + } + #[inline] pub fn set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self { self.set_layout_count = set_layouts.len() as _; self.p_set_layouts = set_layouts.as_ptr(); @@ -51105,11 +51253,15 @@ unsafe impl<'a> TaggedStructure for PipelineShaderStageNodeCreateInfoAMDX<'a> { unsafe impl ExtendsPipelineShaderStageCreateInfo for PipelineShaderStageNodeCreateInfoAMDX<'_> {} impl<'a> PipelineShaderStageNodeCreateInfoAMDX<'a> { #[inline] - pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] + pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.p_name) + } + #[inline] pub fn index(mut self, index: u32) -> Self { self.index = index; self diff --git a/ash/src/vk/prelude.rs b/ash/src/vk/prelude.rs index cb2f17718..c91892f7f 100644 --- a/ash/src/vk/prelude.rs +++ b/ash/src/vk/prelude.rs @@ -1,3 +1,6 @@ +use std::fmt; +use std::os::raw::c_char; + use crate::vk; /// Holds 24 bits in the least significant bits of memory, @@ -59,3 +62,43 @@ impl From for vk::Rect2D { pub unsafe trait TaggedStructure { const STRUCTURE_TYPE: vk::StructureType; } + +#[inline] +pub(crate) unsafe fn wrap_c_str_slice_until_nul(str: &[c_char]) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(str.as_ptr()) +} + +#[derive(Debug)] +pub struct CStrTooLargeForStaticArray { + pub static_array_size: usize, + pub c_str_size: usize, +} +impl std::error::Error for CStrTooLargeForStaticArray {} +impl fmt::Display for CStrTooLargeForStaticArray { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "static `c_char` target array of length `{}` is too small to write a `CStr` (with `NUL`-terminator) of length `{}`", + self.static_array_size, self.c_str_size + ) + } +} + +#[inline] +pub(crate) fn write_c_str_slice_with_nul( + target: &mut [c_char], + str: &std::ffi::CStr, +) -> Result<(), CStrTooLargeForStaticArray> { + let bytes = str.to_bytes_with_nul(); + // SAFETY: The cast from c_char to u8 is ok because a c_char is always one byte. + let bytes = unsafe { std::slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; + let static_array_size = target.len(); + target + .get_mut(..bytes.len()) + .ok_or(CStrTooLargeForStaticArray { + static_array_size, + c_str_size: bytes.len(), + })? + .copy_from_slice(bytes); + Ok(()) +} diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 5eb3bfbe7..806c9741a 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1822,25 +1822,16 @@ fn derive_debug( let param_ident = field.param_ident(); let param_str = param_ident.to_string(); let debug_value = if is_static_array(field) && field.basetype == "char" { - quote! { - &unsafe { - ::std::ffi::CStr::from_ptr(self.#param_ident.as_ptr()) - } - } + let param_ident = format_ident!("{}_as_c_str", param_ident); + quote!(&unsafe { self.#param_ident() }) } else if param_str.contains("pfn") { - quote! { - &(self.#param_ident.map(|x| x as *const ())) - } + quote!(&(self.#param_ident.map(|x| x as *const ()))) } else if union_types.contains(field.basetype.as_str()) { quote!(&"union") } else { - quote! { - &self.#param_ident - } + quote!(&self.#param_ident) }; - quote! { - .field(#param_str, #debug_value) - } + quote!(.field(#param_str, #debug_value)) }); let name_str = name.to_string(); let lifetime = has_lifetime.then(|| quote!(<'_>)); @@ -1989,83 +1980,103 @@ fn derive_setters( }); } - // TODO: Improve in future when https://github.com/rust-lang/rust/issues/53667 is merged id:6 - if field.reference.is_some() { - if field.basetype == "char" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { + if field.basetype == "char" { + let param_ident_as_c_str = format_ident!("{}_as_c_str", param_ident_short); + if matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { assert!(field.null_terminate); assert_eq!(field.size, None); - return Some(quote!{ + return Some(quote! { #[inline] #deprecated - pub fn #param_ident_short(mut self, #param_ident_short: &'a ::std::ffi::CStr) -> Self { + pub fn #param_ident_short(mut self, #param_ident_short: &'a std::ffi::CStr) -> Self { self.#param_ident = #param_ident_short.as_ptr(); self } + #[inline] + #deprecated + pub unsafe fn #param_ident_as_c_str(&self) -> &std::ffi::CStr { + std::ffi::CStr::from_ptr(self.#param_ident) + } + }); + } else if is_static_array(field) { + assert_eq!(field.size, None); + return Some(quote! { + #[inline] + #deprecated + pub fn #param_ident_short(mut self, #param_ident_short: &std::ffi::CStr) -> std::result::Result { + write_c_str_slice_with_nul(&mut self.#param_ident, #param_ident_short).map(|()| self) + } + #[inline] + #deprecated + pub unsafe fn #param_ident_as_c_str(&self) -> &std::ffi::CStr { + wrap_c_str_slice_until_nul(&self.#param_ident) + } }); } + } - if matches!(field.array, Some(vkxml::ArrayType::Dynamic)) { - if let Some(ref array_size) = field.size { - let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); + // TODO: Improve in future when https://github.com/rust-lang/rust/issues/53667 is merged id:6 + if field.reference.is_some() && matches!(field.array, Some(vkxml::ArrayType::Dynamic)) { + if let Some(ref array_size) = field.size { + let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); - let mut ptr = if field.is_const { - quote!(.as_ptr()) - } else { - quote!(.as_mut_ptr()) - }; + let mut ptr = if field.is_const { + quote!(.as_ptr()) + } else { + quote!(.as_mut_ptr()) + }; - // Interpret void array as byte array - if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { - slice_param_ty_tokens = quote!([u8]); - ptr = quote!(#ptr.cast()); - }; + // Interpret void array as byte array + if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { + slice_param_ty_tokens = quote!([u8]); + ptr = quote!(#ptr.cast()); + }; - let set_size_stmt = if field.is_pointer_to_static_sized_array() { - // this is a pointer to a piece of memory with statically known size. - let array_size = field.c_size.as_ref().unwrap(); - let c_size = convert_c_expression(array_size, &BTreeMap::new()); - let inner_type = field.inner_type_tokens(None, None); + let set_size_stmt = if field.is_pointer_to_static_sized_array() { + // this is a pointer to a piece of memory with statically known size. + let array_size = field.c_size.as_ref().unwrap(); + let c_size = convert_c_expression(array_size, &BTreeMap::new()); + let inner_type = field.inner_type_tokens(None, None); - slice_param_ty_tokens = quote!([#inner_type; #c_size]); - ptr = quote!(); + slice_param_ty_tokens = quote!([#inner_type; #c_size]); + ptr = quote!(); - quote!() + quote!() + } else { + // Deal with a "special" 2D dynamic array with an inner size of 1 (effectively an array containing pointers to single objects) + let array_size = if let Some(array_size) = array_size.strip_suffix(",1") { + param_ident_short = format_ident!("{}_ptrs", param_ident_short); + slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), Some(1)); + ptr = quote!(#ptr.cast()); + array_size } else { - // Deal with a "special" 2D dynamic array with an inner size of 1 (effectively an array containing pointers to single objects) - let array_size = if let Some(array_size) = array_size.strip_suffix(",1") { - param_ident_short = format_ident!("{}_ptrs", param_ident_short); - slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), Some(1)); - ptr = quote!(#ptr.cast()); - array_size - } else { - array_size - }; - - let array_size_ident = format_ident!("{}", array_size.to_snake_case()); + array_size + }; - let size_field = members.iter().find(|member| member.vkxml_field.name.as_deref() == Some(array_size)).unwrap(); + let array_size_ident = format_ident!("{}", array_size.to_snake_case()); - let cast = if size_field.vkxml_field.basetype == "size_t" { - quote!() - } else { - quote!(as _) - }; + let size_field = members.iter().find(|member| member.vkxml_field.name.as_deref() == Some(array_size)).unwrap(); - quote!(self.#array_size_ident = #param_ident_short.len()#cast;) + let cast = if size_field.vkxml_field.basetype == "size_t" { + quote!() + } else { + quote!(as _) }; - let mutable = if field.is_const { quote!() } else { quote!(mut) }; + quote!(self.#array_size_ident = #param_ident_short.len()#cast;) + }; - return Some(quote! { - #[inline] - #deprecated - pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self { - #set_size_stmt - self.#param_ident = #param_ident_short #ptr; - self - } - }); - } + let mutable = if field.is_const { quote!() } else { quote!(mut) }; + + return Some(quote! { + #[inline] + #deprecated + pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self { + #set_size_stmt + self.#param_ident = #param_ident_short #ptr; + self + } + }); } } From 4e99de1cbbc040126608ce352188a2daf1cd8f13 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 1 Dec 2023 22:25:45 +0100 Subject: [PATCH 16/23] Convert `mem::zeroed()` / `0` to `MaybeUninit::uninit()` (#798) * Convert `mem::zeroed()` / `0` to `MaybeUninit::uninit()` As noted in #792 changes like this might help us more strictly identify and validate that the argument in question is only relevant as an output argument (i.e. structs with `sType` are read by the function call, even if the caller strictly expects return values there, so that it can fill in multiple structures in a `pNext` chain, and must hence be `Default`- initialized). * Use uninit `Vec`s with late `set_len()` call instead of zero-initialization * Use `uninit()` instead of `-1` for file descriptors * Introduce `set_vec_len_on_success()` helper for `Vec::with_capacity()` --- ash-examples/src/bin/texture.rs | 1 - ash-examples/src/bin/triangle.rs | 1 - ash/src/device.rs | 238 +++++++++--------- ash/src/entry.rs | 20 +- ash/src/extensions/amdx/shader_enqueue.rs | 10 +- ...external_memory_android_hardware_buffer.rs | 6 +- .../extensions/ext/calibrated_timestamps.rs | 12 +- ash/src/extensions/ext/debug_report.rs | 6 +- ash/src/extensions/ext/debug_utils.rs | 6 +- ash/src/extensions/ext/descriptor_buffer.rs | 12 +- .../extensions/ext/full_screen_exclusive.rs | 6 +- ash/src/extensions/ext/headless_surface.rs | 6 +- ash/src/extensions/ext/metal_surface.rs | 6 +- ash/src/extensions/ext/private_data.rs | 12 +- ash/src/extensions/ext/shader_object.rs | 4 +- ash/src/extensions/google/display_timing.rs | 6 +- .../extensions/khr/acceleration_structure.rs | 14 +- ash/src/extensions/khr/android_surface.rs | 6 +- ash/src/extensions/khr/create_render_pass2.rs | 6 +- .../khr/deferred_host_operations.rs | 6 +- ash/src/extensions/khr/device_group.rs | 25 +- .../extensions/khr/device_group_creation.rs | 7 +- ash/src/extensions/khr/display.rs | 6 +- ash/src/extensions/khr/display_swapchain.rs | 4 +- ash/src/extensions/khr/external_fence_fd.rs | 5 +- .../extensions/khr/external_fence_win32.rs | 3 +- ash/src/extensions/khr/external_memory_fd.rs | 5 +- .../extensions/khr/external_memory_win32.rs | 3 +- .../extensions/khr/external_semaphore_fd.rs | 5 +- .../khr/external_semaphore_win32.rs | 3 +- .../khr/get_memory_requirements2.rs | 6 +- .../khr/get_physical_device_properties2.rs | 12 +- .../khr/get_surface_capabilities2.rs | 6 +- ash/src/extensions/khr/maintenance4.rs | 6 +- ash/src/extensions/khr/maintenance5.rs | 6 +- ash/src/extensions/khr/performance_query.rs | 13 +- .../extensions/khr/ray_tracing_pipeline.rs | 12 +- .../khr/sampler_ycbcr_conversion.rs | 6 +- ash/src/extensions/khr/surface.rs | 13 +- ash/src/extensions/khr/swapchain.rs | 33 +-- ash/src/extensions/khr/timeline_semaphore.rs | 6 +- ash/src/extensions/khr/wayland_surface.rs | 6 +- ash/src/extensions/khr/win32_surface.rs | 6 +- ash/src/extensions/khr/xcb_surface.rs | 6 +- ash/src/extensions/khr/xlib_surface.rs | 6 +- ash/src/extensions/mvk/ios_surface.rs | 6 +- ash/src/extensions/mvk/macos_surface.rs | 6 +- ash/src/extensions/nn/vi_surface.rs | 6 +- .../extensions/nv/coverage_reduction_mode.rs | 7 +- .../nv/device_diagnostic_checkpoints.rs | 6 +- ash/src/extensions/nv/ray_tracing.rs | 19 +- ash/src/instance.rs | 64 ++--- ash/src/prelude.rs | 21 +- 53 files changed, 380 insertions(+), 348 deletions(-) diff --git a/ash-examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs index 298446c4c..b512a22fc 100644 --- a/ash-examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -768,7 +768,6 @@ fn main() { device.cmd_end_render_pass(draw_command_buffer); }, ); - //let mut present_info_err = mem::zeroed(); let present_info = vk::PresentInfoKHR { wait_semaphore_count: 1, p_wait_semaphores: &base.rendering_complete_semaphore, diff --git a/ash-examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs index 621b57b2e..ee0bcc5be 100644 --- a/ash-examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -423,7 +423,6 @@ fn main() { device.cmd_end_render_pass(draw_command_buffer); }, ); - //let mut present_info_err = mem::zeroed(); let wait_semaphors = [base.rendering_complete_semaphore]; let swapchains = [base.swapchain]; let image_indices = [present_index]; diff --git a/ash/src/device.rs b/ash/src/device.rs index d64a760e7..6775b3894 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -70,14 +70,14 @@ impl Device { create_info: &vk::PrivateDataSlotCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut private_data_slot = mem::zeroed(); + let mut private_data_slot = mem::MaybeUninit::uninit(); (self.device_fn_1_3.create_private_data_slot)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut private_data_slot, + private_data_slot.as_mut_ptr(), ) - .result_with_success(private_data_slot) + .assume_init_on_success(private_data_slot) } /// @@ -119,15 +119,15 @@ impl Device { object: T, private_data_slot: vk::PrivateDataSlot, ) -> u64 { - let mut data = mem::zeroed(); + let mut data = mem::MaybeUninit::uninit(); (self.device_fn_1_3.get_private_data)( self.handle, T::TYPE, object.as_raw(), private_data_slot, - &mut data, + data.as_mut_ptr(), ); - data + data.assume_init() } /// @@ -511,16 +511,16 @@ impl Device { &self, memory_requirements: &vk::DeviceImageMemoryRequirements<'_>, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self .device_fn_1_3 .get_device_image_sparse_memory_requirements)( self.handle, memory_requirements, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// @@ -606,14 +606,14 @@ impl Device { create_info: &vk::RenderPassCreateInfo2<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut renderpass = mem::zeroed(); + let mut renderpass = mem::MaybeUninit::uninit(); (self.device_fn_1_2.create_render_pass2)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut renderpass, + renderpass.as_mut_ptr(), ) - .result_with_success(renderpass) + .assume_init_on_success(renderpass) } /// @@ -670,9 +670,13 @@ impl Device { /// #[inline] pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { - let mut value = 0; - (self.device_fn_1_2.get_semaphore_counter_value)(self.handle(), semaphore, &mut value) - .result_with_success(value) + let mut value = mem::MaybeUninit::uninit(); + (self.device_fn_1_2.get_semaphore_counter_value)( + self.handle(), + semaphore, + value.as_mut_ptr(), + ) + .assume_init_on_success(value) } /// @@ -765,15 +769,15 @@ impl Device { local_device_index: u32, remote_device_index: u32, ) -> vk::PeerMemoryFeatureFlags { - let mut peer_memory_features = mem::zeroed(); + let mut peer_memory_features = mem::MaybeUninit::uninit(); (self.device_fn_1_1.get_device_group_peer_memory_features)( self.handle(), heap_index, local_device_index, remote_device_index, - &mut peer_memory_features, + peer_memory_features.as_mut_ptr(), ); - peer_memory_features + peer_memory_features.assume_init() } /// @@ -831,14 +835,14 @@ impl Device { &self, info: &vk::ImageSparseMemoryRequirementsInfo2<'_>, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self.device_fn_1_1.get_image_sparse_memory_requirements2)( self.handle(), info, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// @@ -874,9 +878,9 @@ impl Device { /// #[inline] pub unsafe fn get_device_queue2(&self, queue_info: &vk::DeviceQueueInfo2<'_>) -> vk::Queue { - let mut queue = mem::zeroed(); - (self.device_fn_1_1.get_device_queue2)(self.handle(), queue_info, &mut queue); - queue + let mut queue = mem::MaybeUninit::uninit(); + (self.device_fn_1_1.get_device_queue2)(self.handle(), queue_info, queue.as_mut_ptr()); + queue.assume_init() } /// @@ -886,14 +890,14 @@ impl Device { create_info: &vk::SamplerYcbcrConversionCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut ycbcr_conversion = mem::zeroed(); + let mut ycbcr_conversion = mem::MaybeUninit::uninit(); (self.device_fn_1_1.create_sampler_ycbcr_conversion)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut ycbcr_conversion, + ycbcr_conversion.as_mut_ptr(), ) - .result_with_success(ycbcr_conversion) + .assume_init_on_success(ycbcr_conversion) } /// @@ -917,14 +921,14 @@ impl Device { create_info: &vk::DescriptorUpdateTemplateCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut descriptor_update_template = mem::zeroed(); + let mut descriptor_update_template = mem::MaybeUninit::uninit(); (self.device_fn_1_1.create_descriptor_update_template)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut descriptor_update_template, + descriptor_update_template.as_mut_ptr(), ) - .result_with_success(descriptor_update_template) + .assume_init_on_success(descriptor_update_template) } /// @@ -1030,14 +1034,14 @@ impl Device { create_info: &vk::EventCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut event = mem::zeroed(); + let mut event = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_event)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut event, + event.as_mut_ptr(), ) - .result_with_success(event) + .assume_init_on_success(event) } /// Returns [`true`] if the event was set, and [`false`] if the event was reset, otherwise it will @@ -1363,14 +1367,14 @@ impl Device { create_info: &vk::SamplerCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut sampler = mem::zeroed(); + let mut sampler = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_sampler)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut sampler, + sampler.as_mut_ptr(), ) - .result_with_success(sampler) + .assume_init_on_success(sampler) } /// @@ -1542,10 +1546,7 @@ impl Device { allocate_info, desc_set.as_mut_ptr(), ) - .result()?; - - desc_set.set_len(allocate_info.descriptor_set_count as usize); - Ok(desc_set) + .set_vec_len_on_success(desc_set, allocate_info.descriptor_set_count as usize) } /// @@ -1555,14 +1556,14 @@ impl Device { create_info: &vk::DescriptorSetLayoutCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut layout = mem::zeroed(); + let mut layout = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_descriptor_set_layout)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut layout, + layout.as_mut_ptr(), ) - .result_with_success(layout) + .assume_init_on_success(layout) } /// @@ -1578,14 +1579,14 @@ impl Device { create_info: &vk::DescriptorPoolCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut pool = mem::zeroed(); + let mut pool = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_descriptor_pool)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut pool, + pool.as_mut_ptr(), ) - .result_with_success(pool) + .assume_init_on_success(pool) } /// @@ -2123,14 +2124,14 @@ impl Device { create_info: &vk::SemaphoreCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut semaphore = mem::zeroed(); + let mut semaphore = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_semaphore)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut semaphore, + semaphore.as_mut_ptr(), ) - .result_with_success(semaphore) + .assume_init_on_success(semaphore) } /// @@ -2188,14 +2189,14 @@ impl Device { create_info: &vk::BufferCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut buffer = mem::zeroed(); + let mut buffer = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_buffer)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut buffer, + buffer.as_mut_ptr(), ) - .result_with_success(buffer) + .assume_init_on_success(buffer) } /// @@ -2205,14 +2206,14 @@ impl Device { create_info: &vk::PipelineLayoutCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut pipeline_layout = mem::zeroed(); + let mut pipeline_layout = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_pipeline_layout)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut pipeline_layout, + pipeline_layout.as_mut_ptr(), ) - .result_with_success(pipeline_layout) + .assume_init_on_success(pipeline_layout) } /// @@ -2222,14 +2223,14 @@ impl Device { create_info: &vk::PipelineCacheCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut pipeline_cache = mem::zeroed(); + let mut pipeline_cache = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_pipeline_cache)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut pipeline_cache, + pipeline_cache.as_mut_ptr(), ) - .result_with_success(pipeline_cache) + .assume_init_on_success(pipeline_cache) } /// @@ -2273,9 +2274,16 @@ impl Device { size: vk::DeviceSize, flags: vk::MemoryMapFlags, ) -> VkResult<*mut c_void> { - let mut data: *mut c_void = ptr::null_mut(); - (self.device_fn_1_0.map_memory)(self.handle(), memory, offset, size, flags, &mut data) - .result_with_success(data) + let mut data = mem::MaybeUninit::uninit(); + (self.device_fn_1_0.map_memory)( + self.handle(), + memory, + offset, + size, + flags, + data.as_mut_ptr(), + ) + .assume_init_on_success(data) } /// @@ -2319,27 +2327,27 @@ impl Device { create_info: &vk::FramebufferCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut framebuffer = mem::zeroed(); + let mut framebuffer = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_framebuffer)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut framebuffer, + framebuffer.as_mut_ptr(), ) - .result_with_success(framebuffer) + .assume_init_on_success(framebuffer) } /// #[inline] pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> vk::Queue { - let mut queue = mem::zeroed(); + let mut queue = mem::MaybeUninit::uninit(); (self.device_fn_1_0.get_device_queue)( self.handle(), queue_family_index, queue_index, - &mut queue, + queue.as_mut_ptr(), ); - queue + queue.assume_init() } /// @@ -2375,14 +2383,14 @@ impl Device { create_info: &vk::RenderPassCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut renderpass = mem::zeroed(); + let mut renderpass = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_render_pass)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut renderpass, + renderpass.as_mut_ptr(), ) - .result_with_success(renderpass) + .assume_init_on_success(renderpass) } /// @@ -2472,14 +2480,14 @@ impl Device { create_info: &vk::BufferViewCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut buffer_view = mem::zeroed(); + let mut buffer_view = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_buffer_view)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut buffer_view, + buffer_view.as_mut_ptr(), ) - .result_with_success(buffer_view) + .assume_init_on_success(buffer_view) } /// @@ -2503,14 +2511,14 @@ impl Device { create_info: &vk::ImageViewCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut image_view = mem::zeroed(); + let mut image_view = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_image_view)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut image_view, + image_view.as_mut_ptr(), ) - .result_with_success(image_view) + .assume_init_on_success(image_view) } /// @@ -2525,9 +2533,7 @@ impl Device { allocate_info, buffers.as_mut_ptr(), ) - .result()?; - buffers.set_len(allocate_info.command_buffer_count as usize); - Ok(buffers) + .set_vec_len_on_success(buffers, allocate_info.command_buffer_count as usize) } /// @@ -2537,14 +2543,14 @@ impl Device { create_info: &vk::CommandPoolCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut pool = mem::zeroed(); + let mut pool = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_command_pool)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut pool, + pool.as_mut_ptr(), ) - .result_with_success(pool) + .assume_init_on_success(pool) } /// @@ -2554,14 +2560,14 @@ impl Device { create_info: &vk::QueryPoolCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut pool = mem::zeroed(); + let mut pool = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_query_pool)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut pool, + pool.as_mut_ptr(), ) - .result_with_success(pool) + .assume_init_on_success(pool) } /// @@ -2571,14 +2577,14 @@ impl Device { create_info: &vk::ImageCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut image = mem::zeroed(); + let mut image = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_image)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut image, + image.as_mut_ptr(), ) - .result_with_success(image) + .assume_init_on_success(image) } /// @@ -2588,22 +2594,26 @@ impl Device { image: vk::Image, subresource: vk::ImageSubresource, ) -> vk::SubresourceLayout { - let mut layout = mem::zeroed(); + let mut layout = mem::MaybeUninit::uninit(); (self.device_fn_1_0.get_image_subresource_layout)( self.handle(), image, &subresource, - &mut layout, + layout.as_mut_ptr(), ); - layout + layout.assume_init() } /// #[inline] pub unsafe fn get_image_memory_requirements(&self, image: vk::Image) -> vk::MemoryRequirements { - let mut mem_req = mem::zeroed(); - (self.device_fn_1_0.get_image_memory_requirements)(self.handle(), image, &mut mem_req); - mem_req + let mut mem_req = mem::MaybeUninit::uninit(); + (self.device_fn_1_0.get_image_memory_requirements)( + self.handle(), + image, + mem_req.as_mut_ptr(), + ); + mem_req.assume_init() } /// @@ -2612,9 +2622,13 @@ impl Device { &self, buffer: vk::Buffer, ) -> vk::MemoryRequirements { - let mut mem_req = mem::zeroed(); - (self.device_fn_1_0.get_buffer_memory_requirements)(self.handle(), buffer, &mut mem_req); - mem_req + let mut mem_req = mem::MaybeUninit::uninit(); + (self.device_fn_1_0.get_buffer_memory_requirements)( + self.handle(), + buffer, + mem_req.as_mut_ptr(), + ); + mem_req.assume_init() } /// @@ -2624,14 +2638,14 @@ impl Device { allocate_info: &vk::MemoryAllocateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut memory = mem::zeroed(); + let mut memory = mem::MaybeUninit::uninit(); (self.device_fn_1_0.allocate_memory)( self.handle(), allocate_info, allocation_callbacks.as_raw_ptr(), - &mut memory, + memory.as_mut_ptr(), ) - .result_with_success(memory) + .assume_init_on_success(memory) } /// @@ -2641,14 +2655,14 @@ impl Device { create_info: &vk::ShaderModuleCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut shader = mem::zeroed(); + let mut shader = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_shader_module)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut shader, + shader.as_mut_ptr(), ) - .result_with_success(shader) + .assume_init_on_success(shader) } /// @@ -2658,14 +2672,14 @@ impl Device { create_info: &vk::FenceCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut fence = mem::zeroed(); + let mut fence = mem::MaybeUninit::uninit(); (self.device_fn_1_0.create_fence)( self.handle(), create_info, allocation_callbacks.as_raw_ptr(), - &mut fence, + fence.as_mut_ptr(), ) - .result_with_success(fence) + .assume_init_on_success(fence) } /// @@ -2694,25 +2708,25 @@ impl Device { /// #[inline] pub unsafe fn get_render_area_granularity(&self, render_pass: vk::RenderPass) -> vk::Extent2D { - let mut granularity = mem::zeroed(); + let mut granularity = mem::MaybeUninit::uninit(); (self.device_fn_1_0.get_render_area_granularity)( self.handle(), render_pass, - &mut granularity, + granularity.as_mut_ptr(), ); - granularity + granularity.assume_init() } /// #[inline] pub unsafe fn get_device_memory_commitment(&self, memory: vk::DeviceMemory) -> vk::DeviceSize { - let mut committed_memory_in_bytes = 0; + let mut committed_memory_in_bytes = mem::MaybeUninit::uninit(); (self.device_fn_1_0.get_device_memory_commitment)( self.handle(), memory, - &mut committed_memory_in_bytes, + committed_memory_in_bytes.as_mut_ptr(), ); - committed_memory_in_bytes + committed_memory_in_bytes.assume_init() } /// diff --git a/ash/src/entry.rs b/ash/src/entry.rs index 05620618f..a87cafc91 100644 --- a/ash/src/entry.rs +++ b/ash/src/entry.rs @@ -219,7 +219,6 @@ impl Entry { /// ``` #[inline] pub unsafe fn try_enumerate_instance_version(&self) -> VkResult> { - let mut api_version = 0; let enumerate_instance_version: Option = { let name = CStr::from_bytes_with_nul_unchecked(b"vkEnumerateInstanceVersion\0"); mem::transmute((self.static_fn.get_instance_proc_addr)( @@ -228,7 +227,10 @@ impl Entry { )) }; if let Some(enumerate_instance_version) = enumerate_instance_version { - (enumerate_instance_version)(&mut api_version).result_with_success(Some(api_version)) + let mut api_version = mem::MaybeUninit::uninit(); + (enumerate_instance_version)(api_version.as_mut_ptr()) + .assume_init_on_success(api_version) + .map(Some) } else { Ok(None) } @@ -251,13 +253,13 @@ impl Entry { create_info: &vk::InstanceCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut instance = mem::zeroed(); - (self.entry_fn_1_0.create_instance)( + let mut instance = mem::MaybeUninit::uninit(); + let instance = (self.entry_fn_1_0.create_instance)( create_info, allocation_callbacks.as_raw_ptr(), - &mut instance, + instance.as_mut_ptr(), ) - .result()?; + .assume_init_on_success(instance)?; Ok(Instance::load(&self.static_fn, instance)) } @@ -308,9 +310,9 @@ impl Entry { /// Please use [`try_enumerate_instance_version()`][Self::try_enumerate_instance_version()] instead. #[inline] pub unsafe fn enumerate_instance_version(&self) -> VkResult { - let mut api_version = 0; - (self.entry_fn_1_1.enumerate_instance_version)(&mut api_version) - .result_with_success(api_version) + let mut api_version = mem::MaybeUninit::uninit(); + (self.entry_fn_1_1.enumerate_instance_version)(api_version.as_mut_ptr()) + .assume_init_on_success(api_version) } } diff --git a/ash/src/extensions/amdx/shader_enqueue.rs b/ash/src/extensions/amdx/shader_enqueue.rs index 054aac19c..d034a111c 100644 --- a/ash/src/extensions/amdx/shader_enqueue.rs +++ b/ash/src/extensions/amdx/shader_enqueue.rs @@ -29,7 +29,7 @@ impl ShaderEnqueue { create_infos: &[vk::ExecutionGraphPipelineCreateInfoAMDX<'_>], allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult> { - let mut pipelines = vec![mem::zeroed(); create_infos.len()]; + let mut pipelines = Vec::with_capacity(create_infos.len()); (self.fp.create_execution_graph_pipelines_amdx)( self.handle, pipeline_cache, @@ -38,7 +38,7 @@ impl ShaderEnqueue { allocation_callbacks.as_raw_ptr(), pipelines.as_mut_ptr(), ) - .result_with_success(pipelines) + .set_vec_len_on_success(pipelines, create_infos.len()) } /// @@ -63,14 +63,14 @@ impl ShaderEnqueue { execution_graph: vk::Pipeline, node_info: &vk::PipelineShaderStageNodeCreateInfoAMDX<'_>, ) -> VkResult { - let mut node_index = 0; + let mut node_index = mem::MaybeUninit::uninit(); (self.fp.get_execution_graph_pipeline_node_index_amdx)( self.handle, execution_graph, node_info, - &mut node_index, + node_index.as_mut_ptr(), ) - .result_with_success(node_index) + .assume_init_on_success(node_index) } /// diff --git a/ash/src/extensions/android/external_memory_android_hardware_buffer.rs b/ash/src/extensions/android/external_memory_android_hardware_buffer.rs index be18becbe..fec7ec62f 100644 --- a/ash/src/extensions/android/external_memory_android_hardware_buffer.rs +++ b/ash/src/extensions/android/external_memory_android_hardware_buffer.rs @@ -37,9 +37,9 @@ impl ExternalMemoryAndroidHardwareBuffer { &self, info: &vk::MemoryGetAndroidHardwareBufferInfoANDROID<'_>, ) -> VkResult<*mut vk::AHardwareBuffer> { - let mut buffer = std::ptr::null_mut(); - (self.fp.get_memory_android_hardware_buffer_android)(self.handle, info, &mut buffer) - .result_with_success(buffer) + let mut buffer = mem::MaybeUninit::uninit(); + (self.fp.get_memory_android_hardware_buffer_android)(self.handle, info, buffer.as_mut_ptr()) + .assume_init_on_success(buffer) } pub const NAME: &'static CStr = vk::AndroidExternalMemoryAndroidHardwareBufferFn::NAME; diff --git a/ash/src/extensions/ext/calibrated_timestamps.rs b/ash/src/extensions/ext/calibrated_timestamps.rs index d2d527f3f..b5880c13b 100644 --- a/ash/src/extensions/ext/calibrated_timestamps.rs +++ b/ash/src/extensions/ext/calibrated_timestamps.rs @@ -43,16 +43,18 @@ impl CalibratedTimestamps { device: vk::Device, info: &[vk::CalibratedTimestampInfoEXT<'_>], ) -> VkResult<(Vec, u64)> { - let mut timestamps = vec![0u64; info.len()]; - let mut max_deviation = 0u64; - (self.fp.get_calibrated_timestamps_ext)( + let mut timestamps = Vec::with_capacity(info.len()); + let mut max_deviation = mem::MaybeUninit::uninit(); + let max_deviation = (self.fp.get_calibrated_timestamps_ext)( device, info.len() as u32, info.as_ptr(), timestamps.as_mut_ptr(), - &mut max_deviation, + max_deviation.as_mut_ptr(), ) - .result_with_success((timestamps, max_deviation)) + .assume_init_on_success(max_deviation)?; + timestamps.set_len(info.len()); + Ok((timestamps, max_deviation)) } pub const NAME: &'static CStr = vk::ExtCalibratedTimestampsFn::NAME; diff --git a/ash/src/extensions/ext/debug_report.rs b/ash/src/extensions/ext/debug_report.rs index 0443894bc..695100238 100755 --- a/ash/src/extensions/ext/debug_report.rs +++ b/ash/src/extensions/ext/debug_report.rs @@ -41,14 +41,14 @@ impl DebugReport { create_info: &vk::DebugReportCallbackCreateInfoEXT<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut debug_cb = mem::zeroed(); + let mut debug_cb = mem::MaybeUninit::uninit(); (self.fp.create_debug_report_callback_ext)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut debug_cb, + debug_cb.as_mut_ptr(), ) - .result_with_success(debug_cb) + .assume_init_on_success(debug_cb) } pub const NAME: &'static CStr = vk::ExtDebugReportFn::NAME; diff --git a/ash/src/extensions/ext/debug_utils.rs b/ash/src/extensions/ext/debug_utils.rs index 5ba5dd2d2..7dad5c2f5 100755 --- a/ash/src/extensions/ext/debug_utils.rs +++ b/ash/src/extensions/ext/debug_utils.rs @@ -98,14 +98,14 @@ impl DebugUtils { create_info: &vk::DebugUtilsMessengerCreateInfoEXT<'_>, allocator: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut messenger = mem::zeroed(); + let mut messenger = mem::MaybeUninit::uninit(); (self.fp.create_debug_utils_messenger_ext)( self.handle, create_info, allocator.as_raw_ptr(), - &mut messenger, + messenger.as_mut_ptr(), ) - .result_with_success(messenger) + .assume_init_on_success(messenger) } /// diff --git a/ash/src/extensions/ext/descriptor_buffer.rs b/ash/src/extensions/ext/descriptor_buffer.rs index 341537de2..d7cf6d039 100644 --- a/ash/src/extensions/ext/descriptor_buffer.rs +++ b/ash/src/extensions/ext/descriptor_buffer.rs @@ -26,9 +26,9 @@ impl DescriptorBuffer { &self, layout: vk::DescriptorSetLayout, ) -> vk::DeviceSize { - let mut count = 0; - (self.fp.get_descriptor_set_layout_size_ext)(self.handle, layout, &mut count); - count + let mut count = mem::MaybeUninit::uninit(); + (self.fp.get_descriptor_set_layout_size_ext)(self.handle, layout, count.as_mut_ptr()); + count.assume_init() } /// @@ -38,14 +38,14 @@ impl DescriptorBuffer { layout: vk::DescriptorSetLayout, binding: u32, ) -> vk::DeviceSize { - let mut offset = 0; + let mut offset = mem::MaybeUninit::uninit(); (self.fp.get_descriptor_set_layout_binding_offset_ext)( self.handle, layout, binding, - &mut offset, + offset.as_mut_ptr(), ); - offset + offset.assume_init() } /// diff --git a/ash/src/extensions/ext/full_screen_exclusive.rs b/ash/src/extensions/ext/full_screen_exclusive.rs index 8d3a7dcb8..5c9d10cb5 100644 --- a/ash/src/extensions/ext/full_screen_exclusive.rs +++ b/ash/src/extensions/ext/full_screen_exclusive.rs @@ -60,13 +60,13 @@ impl FullScreenExclusive { &self, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>, ) -> VkResult { - let mut present_modes = mem::zeroed(); + let mut present_modes = mem::MaybeUninit::uninit(); (self.fp.get_device_group_surface_present_modes2_ext)( self.handle, surface_info, - &mut present_modes, + present_modes.as_mut_ptr(), ) - .result_with_success(present_modes) + .assume_init_on_success(present_modes) } pub const NAME: &'static CStr = vk::ExtFullScreenExclusiveFn::NAME; diff --git a/ash/src/extensions/ext/headless_surface.rs b/ash/src/extensions/ext/headless_surface.rs index 1b0f249ed..a0cd4906c 100644 --- a/ash/src/extensions/ext/headless_surface.rs +++ b/ash/src/extensions/ext/headless_surface.rs @@ -28,14 +28,14 @@ impl HeadlessSurface { create_info: &vk::HeadlessSurfaceCreateInfoEXT<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_headless_surface_ext)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::ExtHeadlessSurfaceFn::NAME; diff --git a/ash/src/extensions/ext/metal_surface.rs b/ash/src/extensions/ext/metal_surface.rs index ca971fec7..0c069d28d 100644 --- a/ash/src/extensions/ext/metal_surface.rs +++ b/ash/src/extensions/ext/metal_surface.rs @@ -27,14 +27,14 @@ impl MetalSurface { create_info: &vk::MetalSurfaceCreateInfoEXT<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_metal_surface_ext)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::ExtMetalSurfaceFn::NAME; diff --git a/ash/src/extensions/ext/private_data.rs b/ash/src/extensions/ext/private_data.rs index 44d467fb8..8e54ec796 100644 --- a/ash/src/extensions/ext/private_data.rs +++ b/ash/src/extensions/ext/private_data.rs @@ -28,14 +28,14 @@ impl PrivateData { create_info: &vk::PrivateDataSlotCreateInfoEXT<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut private_data_slot = mem::zeroed(); + let mut private_data_slot = mem::MaybeUninit::uninit(); (self.fp.create_private_data_slot_ext)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut private_data_slot, + private_data_slot.as_mut_ptr(), ) - .result_with_success(private_data_slot) + .assume_init_on_success(private_data_slot) } /// @@ -77,15 +77,15 @@ impl PrivateData { object: T, private_data_slot: vk::PrivateDataSlotEXT, ) -> u64 { - let mut data = mem::zeroed(); + let mut data = mem::MaybeUninit::uninit(); (self.fp.get_private_data_ext)( self.handle, T::TYPE, object.as_raw(), private_data_slot, - &mut data, + data.as_mut_ptr(), ); - data + data.assume_init() } pub const NAME: &'static CStr = vk::ExtPrivateDataFn::NAME; diff --git a/ash/src/extensions/ext/shader_object.rs b/ash/src/extensions/ext/shader_object.rs index 358ade481..baaad721a 100644 --- a/ash/src/extensions/ext/shader_object.rs +++ b/ash/src/extensions/ext/shader_object.rs @@ -37,9 +37,7 @@ impl ShaderObject { allocator.as_raw_ptr(), shaders.as_mut_ptr(), ) - .result()?; - shaders.set_len(create_infos.len()); - Ok(shaders) + .set_vec_len_on_success(shaders, create_infos.len()) } /// diff --git a/ash/src/extensions/google/display_timing.rs b/ash/src/extensions/google/display_timing.rs index 6b912cf0e..1ea45fbe2 100644 --- a/ash/src/extensions/google/display_timing.rs +++ b/ash/src/extensions/google/display_timing.rs @@ -37,9 +37,9 @@ impl DisplayTiming { &self, swapchain: vk::SwapchainKHR, ) -> VkResult { - let mut properties = mem::zeroed(); - (self.fp.get_refresh_cycle_duration_google)(self.handle, swapchain, &mut properties) - .result_with_success(properties) + let mut properties = mem::MaybeUninit::uninit(); + (self.fp.get_refresh_cycle_duration_google)(self.handle, swapchain, properties.as_mut_ptr()) + .assume_init_on_success(properties) } pub const NAME: &'static CStr = vk::GoogleDisplayTimingFn::NAME; diff --git a/ash/src/extensions/khr/acceleration_structure.rs b/ash/src/extensions/khr/acceleration_structure.rs index 0a52e9952..043ab2061 100644 --- a/ash/src/extensions/khr/acceleration_structure.rs +++ b/ash/src/extensions/khr/acceleration_structure.rs @@ -28,14 +28,14 @@ impl AccelerationStructure { create_info: &vk::AccelerationStructureCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut accel_struct = mem::zeroed(); + let mut accel_struct = mem::MaybeUninit::uninit(); (self.fp.create_acceleration_structure_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut accel_struct, + accel_struct.as_mut_ptr(), ) - .result_with_success(accel_struct) + .assume_init_on_success(accel_struct) } /// @@ -259,15 +259,13 @@ impl AccelerationStructure { &self, version: &vk::AccelerationStructureVersionInfoKHR<'_>, ) -> vk::AccelerationStructureCompatibilityKHR { - let mut compatibility = mem::zeroed(); - + let mut compatibility = mem::MaybeUninit::uninit(); (self.fp.get_device_acceleration_structure_compatibility_khr)( self.handle, version, - &mut compatibility, + compatibility.as_mut_ptr(), ); - - compatibility + compatibility.assume_init() } /// diff --git a/ash/src/extensions/khr/android_surface.rs b/ash/src/extensions/khr/android_surface.rs index f870bfa5a..d40527373 100755 --- a/ash/src/extensions/khr/android_surface.rs +++ b/ash/src/extensions/khr/android_surface.rs @@ -27,14 +27,14 @@ impl AndroidSurface { create_info: &vk::AndroidSurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_android_surface_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::KhrAndroidSurfaceFn::NAME; diff --git a/ash/src/extensions/khr/create_render_pass2.rs b/ash/src/extensions/khr/create_render_pass2.rs index 5062e4dc0..55db38758 100644 --- a/ash/src/extensions/khr/create_render_pass2.rs +++ b/ash/src/extensions/khr/create_render_pass2.rs @@ -27,14 +27,14 @@ impl CreateRenderPass2 { create_info: &vk::RenderPassCreateInfo2<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut renderpass = mem::zeroed(); + let mut renderpass = mem::MaybeUninit::uninit(); (self.fp.create_render_pass2_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut renderpass, + renderpass.as_mut_ptr(), ) - .result_with_success(renderpass) + .assume_init_on_success(renderpass) } /// diff --git a/ash/src/extensions/khr/deferred_host_operations.rs b/ash/src/extensions/khr/deferred_host_operations.rs index 61cbcf494..bf62488c1 100644 --- a/ash/src/extensions/khr/deferred_host_operations.rs +++ b/ash/src/extensions/khr/deferred_host_operations.rs @@ -26,13 +26,13 @@ impl DeferredHostOperations { &self, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut operation = mem::zeroed(); + let mut operation = mem::MaybeUninit::uninit(); (self.fp.create_deferred_operation_khr)( self.handle, allocation_callbacks.as_raw_ptr(), - &mut operation, + operation.as_mut_ptr(), ) - .result_with_success(operation) + .assume_init_on_success(operation) } /// diff --git a/ash/src/extensions/khr/device_group.rs b/ash/src/extensions/khr/device_group.rs index df86dd1ba..d030e519a 100644 --- a/ash/src/extensions/khr/device_group.rs +++ b/ash/src/extensions/khr/device_group.rs @@ -30,15 +30,15 @@ impl DeviceGroup { local_device_index: u32, remote_device_index: u32, ) -> vk::PeerMemoryFeatureFlags { - let mut peer_memory_features = mem::zeroed(); + let mut peer_memory_features = mem::MaybeUninit::uninit(); (self.fp.get_device_group_peer_memory_features_khr)( self.handle, heap_index, local_device_index, remote_device_index, - &mut peer_memory_features, + peer_memory_features.as_mut_ptr(), ); - peer_memory_features + peer_memory_features.assume_init() } /// @@ -99,9 +99,13 @@ impl DeviceGroup { &self, surface: vk::SurfaceKHR, ) -> VkResult { - let mut modes = mem::zeroed(); - (self.fp.get_device_group_surface_present_modes_khr)(self.handle, surface, &mut modes) - .result_with_success(modes) + let mut modes = mem::MaybeUninit::uninit(); + (self.fp.get_device_group_surface_present_modes_khr)( + self.handle, + surface, + modes.as_mut_ptr(), + ) + .assume_init_on_success(modes) } /// Requires [`VK_KHR_surface`] to be enabled. @@ -143,11 +147,12 @@ impl DeviceGroup { &self, acquire_info: &vk::AcquireNextImageInfoKHR<'_>, ) -> VkResult<(u32, bool)> { - let mut index = 0; - let err_code = (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, &mut index); + let mut index = mem::MaybeUninit::uninit(); + let err_code = + (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, index.as_mut_ptr()); match err_code { - vk::Result::SUCCESS => Ok((index, false)), - vk::Result::SUBOPTIMAL_KHR => Ok((index, true)), + vk::Result::SUCCESS => Ok((index.assume_init(), false)), + vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)), _ => Err(err_code), } } diff --git a/ash/src/extensions/khr/device_group_creation.rs b/ash/src/extensions/khr/device_group_creation.rs index 683276552..3b5c9bdc3 100644 --- a/ash/src/extensions/khr/device_group_creation.rs +++ b/ash/src/extensions/khr/device_group_creation.rs @@ -24,13 +24,14 @@ impl DeviceGroupCreation { /// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()] #[inline] pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult { - let mut group_count = 0; + let mut group_count = mem::MaybeUninit::uninit(); (self.fp.enumerate_physical_device_groups_khr)( self.handle, - &mut group_count, + group_count.as_mut_ptr(), ptr::null_mut(), ) - .result_with_success(group_count as usize) + .assume_init_on_success(group_count) + .map(|c| c as usize) } /// diff --git a/ash/src/extensions/khr/display.rs b/ash/src/extensions/khr/display.rs index f393f498e..8025d5a93 100755 --- a/ash/src/extensions/khr/display.rs +++ b/ash/src/extensions/khr/display.rs @@ -80,7 +80,7 @@ impl Display { create_info: &vk::DisplayModeCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut display_mode = mem::MaybeUninit::zeroed(); + let mut display_mode = mem::MaybeUninit::uninit(); (self.fp.create_display_mode_khr)( physical_device, display, @@ -99,7 +99,7 @@ impl Display { mode: vk::DisplayModeKHR, plane_index: u32, ) -> VkResult { - let mut display_plane_capabilities = mem::MaybeUninit::zeroed(); + let mut display_plane_capabilities = mem::MaybeUninit::uninit(); (self.fp.get_display_plane_capabilities_khr)( physical_device, mode, @@ -116,7 +116,7 @@ impl Display { create_info: &vk::DisplaySurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::MaybeUninit::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_display_plane_surface_khr)( self.handle, create_info, diff --git a/ash/src/extensions/khr/display_swapchain.rs b/ash/src/extensions/khr/display_swapchain.rs index cdc89c030..ff7cac4ac 100755 --- a/ash/src/extensions/khr/display_swapchain.rs +++ b/ash/src/extensions/khr/display_swapchain.rs @@ -35,9 +35,7 @@ impl DisplaySwapchain { allocation_callbacks.as_raw_ptr(), swapchains.as_mut_ptr(), ) - .result()?; - swapchains.set_len(create_infos.len()); - Ok(swapchains) + .set_vec_len_on_success(swapchains, create_infos.len()) } pub const NAME: &'static CStr = vk::KhrDisplaySwapchainFn::NAME; diff --git a/ash/src/extensions/khr/external_fence_fd.rs b/ash/src/extensions/khr/external_fence_fd.rs index ff703e973..4e387b428 100644 --- a/ash/src/extensions/khr/external_fence_fd.rs +++ b/ash/src/extensions/khr/external_fence_fd.rs @@ -31,8 +31,9 @@ impl ExternalFenceFd { /// #[inline] pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR<'_>) -> VkResult { - let mut fd = -1; - (self.fp.get_fence_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd) + let mut fd = mem::MaybeUninit::uninit(); + (self.fp.get_fence_fd_khr)(self.handle, get_info, fd.as_mut_ptr()) + .assume_init_on_success(fd) } pub const NAME: &'static CStr = vk::KhrExternalFenceFdFn::NAME; diff --git a/ash/src/extensions/khr/external_fence_win32.rs b/ash/src/extensions/khr/external_fence_win32.rs index ec3c722b4..92ce2caec 100644 --- a/ash/src/extensions/khr/external_fence_win32.rs +++ b/ash/src/extensions/khr/external_fence_win32.rs @@ -3,7 +3,6 @@ use crate::vk; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; -use std::mem::MaybeUninit; /// #[derive(Clone)] @@ -36,7 +35,7 @@ impl ExternalFenceWin32 { &self, get_info: &vk::FenceGetWin32HandleInfoKHR<'_>, ) -> VkResult { - let mut handle = MaybeUninit::uninit(); + let mut handle = mem::MaybeUninit::uninit(); (self.fp.get_fence_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr()) .assume_init_on_success(handle) } diff --git a/ash/src/extensions/khr/external_memory_fd.rs b/ash/src/extensions/khr/external_memory_fd.rs index 7e280369b..9e260428c 100644 --- a/ash/src/extensions/khr/external_memory_fd.rs +++ b/ash/src/extensions/khr/external_memory_fd.rs @@ -23,8 +23,9 @@ impl ExternalMemoryFd { /// #[inline] pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR<'_>) -> VkResult { - let mut fd = -1; - (self.fp.get_memory_fd_khr)(self.handle, get_fd_info, &mut fd).result_with_success(fd) + let mut fd = mem::MaybeUninit::uninit(); + (self.fp.get_memory_fd_khr)(self.handle, get_fd_info, fd.as_mut_ptr()) + .assume_init_on_success(fd) } /// diff --git a/ash/src/extensions/khr/external_memory_win32.rs b/ash/src/extensions/khr/external_memory_win32.rs index 7ac2039de..388710905 100644 --- a/ash/src/extensions/khr/external_memory_win32.rs +++ b/ash/src/extensions/khr/external_memory_win32.rs @@ -3,7 +3,6 @@ use crate::vk; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; -use std::mem::MaybeUninit; /// #[derive(Clone)] @@ -27,7 +26,7 @@ impl ExternalMemoryWin32 { &self, create_info: &vk::MemoryGetWin32HandleInfoKHR<'_>, ) -> VkResult { - let mut handle = MaybeUninit::uninit(); + let mut handle = mem::MaybeUninit::uninit(); (self.fp.get_memory_win32_handle_khr)(self.handle, create_info, handle.as_mut_ptr()) .assume_init_on_success(handle) } diff --git a/ash/src/extensions/khr/external_semaphore_fd.rs b/ash/src/extensions/khr/external_semaphore_fd.rs index 5c8383f3f..09d8bbafa 100644 --- a/ash/src/extensions/khr/external_semaphore_fd.rs +++ b/ash/src/extensions/khr/external_semaphore_fd.rs @@ -34,8 +34,9 @@ impl ExternalSemaphoreFd { &self, get_info: &vk::SemaphoreGetFdInfoKHR<'_>, ) -> VkResult { - let mut fd = -1; - (self.fp.get_semaphore_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd) + let mut fd = mem::MaybeUninit::uninit(); + (self.fp.get_semaphore_fd_khr)(self.handle, get_info, fd.as_mut_ptr()) + .assume_init_on_success(fd) } pub const NAME: &'static CStr = vk::KhrExternalSemaphoreFdFn::NAME; diff --git a/ash/src/extensions/khr/external_semaphore_win32.rs b/ash/src/extensions/khr/external_semaphore_win32.rs index 6b0714c55..0c69bcbaa 100644 --- a/ash/src/extensions/khr/external_semaphore_win32.rs +++ b/ash/src/extensions/khr/external_semaphore_win32.rs @@ -3,7 +3,6 @@ use crate::vk; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; -use std::mem::MaybeUninit; /// #[derive(Clone)] @@ -36,7 +35,7 @@ impl ExternalSemaphoreWin32 { &self, get_info: &vk::SemaphoreGetWin32HandleInfoKHR<'_>, ) -> VkResult { - let mut handle = MaybeUninit::uninit(); + let mut handle = mem::MaybeUninit::uninit(); (self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr()) .assume_init_on_success(handle) } diff --git a/ash/src/extensions/khr/get_memory_requirements2.rs b/ash/src/extensions/khr/get_memory_requirements2.rs index 4fd7f84d3..a29ebd75c 100644 --- a/ash/src/extensions/khr/get_memory_requirements2.rs +++ b/ash/src/extensions/khr/get_memory_requirements2.rs @@ -45,14 +45,14 @@ impl GetMemoryRequirements2 { &self, info: &vk::ImageSparseMemoryRequirementsInfo2KHR<'_>, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self.fp.get_image_sparse_memory_requirements2_khr)( self.handle, info, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// diff --git a/ash/src/extensions/khr/get_physical_device_properties2.rs b/ash/src/extensions/khr/get_physical_device_properties2.rs index 16fe4e67e..1bb507c4e 100644 --- a/ash/src/extensions/khr/get_physical_device_properties2.rs +++ b/ash/src/extensions/khr/get_physical_device_properties2.rs @@ -85,13 +85,13 @@ impl GetPhysicalDeviceProperties2 { &self, physical_device: vk::PhysicalDevice, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self.fp.get_physical_device_queue_family_properties2_khr)( physical_device, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// @@ -120,16 +120,16 @@ impl GetPhysicalDeviceProperties2 { physical_device: vk::PhysicalDevice, format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self .fp .get_physical_device_sparse_image_format_properties2_khr)( physical_device, format_info, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// diff --git a/ash/src/extensions/khr/get_surface_capabilities2.rs b/ash/src/extensions/khr/get_surface_capabilities2.rs index 878c33761..23762b32b 100644 --- a/ash/src/extensions/khr/get_surface_capabilities2.rs +++ b/ash/src/extensions/khr/get_surface_capabilities2.rs @@ -41,14 +41,14 @@ impl GetSurfaceCapabilities2 { physical_device: vk::PhysicalDevice, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>, ) -> VkResult { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); let err_code = (self.fp.get_physical_device_surface_formats2_khr)( physical_device, surface_info, - &mut count, + count.as_mut_ptr(), std::ptr::null_mut(), ); - err_code.result_with_success(count as usize) + err_code.assume_init_on_success(count).map(|c| c as usize) } /// diff --git a/ash/src/extensions/khr/maintenance4.rs b/ash/src/extensions/khr/maintenance4.rs index aaf5f5745..db7a07588 100644 --- a/ash/src/extensions/khr/maintenance4.rs +++ b/ash/src/extensions/khr/maintenance4.rs @@ -45,14 +45,14 @@ impl Maintenance4 { &self, memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>, ) -> usize { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self.fp.get_device_image_sparse_memory_requirements_khr)( self.handle, memory_requirements, - &mut count, + count.as_mut_ptr(), std::ptr::null_mut(), ); - count as usize + count.assume_init() as usize } /// diff --git a/ash/src/extensions/khr/maintenance5.rs b/ash/src/extensions/khr/maintenance5.rs index 3ed878733..f54a99a19 100644 --- a/ash/src/extensions/khr/maintenance5.rs +++ b/ash/src/extensions/khr/maintenance5.rs @@ -40,13 +40,13 @@ impl Maintenance5 { &self, rendering_area_info: &vk::RenderingAreaInfoKHR<'_>, ) -> vk::Extent2D { - let mut granularity = mem::zeroed(); + let mut granularity = mem::MaybeUninit::uninit(); (self.fp.get_rendering_area_granularity_khr)( self.handle, rendering_area_info, - &mut granularity, + granularity.as_mut_ptr(), ); - granularity + granularity.assume_init() } /// diff --git a/ash/src/extensions/khr/performance_query.rs b/ash/src/extensions/khr/performance_query.rs index dc47019b4..868378b8f 100644 --- a/ash/src/extensions/khr/performance_query.rs +++ b/ash/src/extensions/khr/performance_query.rs @@ -28,17 +28,18 @@ impl PerformanceQuery { physical_device: vk::PhysicalDevice, queue_family_index: u32, ) -> VkResult { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self .fp .enumerate_physical_device_queue_family_performance_query_counters_khr)( physical_device, queue_family_index, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ptr::null_mut(), ) - .result_with_success(count as usize) + .assume_init_on_success(count) + .map(|c| c as usize) } /// @@ -77,15 +78,15 @@ impl PerformanceQuery { physical_device: vk::PhysicalDevice, performance_query_create_info: &vk::QueryPoolPerformanceCreateInfoKHR<'_>, ) -> u32 { - let mut num_passes = 0; + let mut num_passes = mem::MaybeUninit::uninit(); (self .fp .get_physical_device_queue_family_performance_query_passes_khr)( physical_device, performance_query_create_info, - &mut num_passes, + num_passes.as_mut_ptr(), ); - num_passes + num_passes.assume_init() } /// diff --git a/ash/src/extensions/khr/ray_tracing_pipeline.rs b/ash/src/extensions/khr/ray_tracing_pipeline.rs index ed397cd7b..e29cde482 100644 --- a/ash/src/extensions/khr/ray_tracing_pipeline.rs +++ b/ash/src/extensions/khr/ray_tracing_pipeline.rs @@ -54,7 +54,7 @@ impl RayTracingPipeline { create_info: &[vk::RayTracingPipelineCreateInfoKHR<'_>], allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult> { - let mut pipelines = vec![mem::zeroed(); create_info.len()]; + let mut pipelines = Vec::with_capacity(create_info.len()); (self.fp.create_ray_tracing_pipelines_khr)( self.handle, deferred_operation, @@ -64,7 +64,7 @@ impl RayTracingPipeline { allocation_callbacks.as_raw_ptr(), pipelines.as_mut_ptr(), ) - .result_with_success(pipelines) + .set_vec_len_on_success(pipelines, create_info.len()) } /// @@ -85,9 +85,7 @@ impl RayTracingPipeline { data_size, data.as_mut_ptr().cast(), ) - .result()?; - data.set_len(data_size); - Ok(data) + .set_vec_len_on_success(data, data_size) } /// @@ -110,9 +108,7 @@ impl RayTracingPipeline { data_size, data.as_mut_ptr().cast(), ) - .result()?; - data.set_len(data_size); - Ok(data) + .set_vec_len_on_success(data, data_size) } /// diff --git a/ash/src/extensions/khr/sampler_ycbcr_conversion.rs b/ash/src/extensions/khr/sampler_ycbcr_conversion.rs index 56876e142..ade7fd5b4 100644 --- a/ash/src/extensions/khr/sampler_ycbcr_conversion.rs +++ b/ash/src/extensions/khr/sampler_ycbcr_conversion.rs @@ -28,14 +28,14 @@ impl SamplerYcbcrConversion { create_info: &vk::SamplerYcbcrConversionCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut ycbcr_conversion = mem::zeroed(); + let mut ycbcr_conversion = mem::MaybeUninit::uninit(); (self.fp.create_sampler_ycbcr_conversion_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut ycbcr_conversion, + ycbcr_conversion.as_mut_ptr(), ) - .result_with_success(ycbcr_conversion) + .assume_init_on_success(ycbcr_conversion) } /// diff --git a/ash/src/extensions/khr/surface.rs b/ash/src/extensions/khr/surface.rs index 1ba4756eb..5245884ea 100755 --- a/ash/src/extensions/khr/surface.rs +++ b/ash/src/extensions/khr/surface.rs @@ -28,14 +28,15 @@ impl Surface { queue_family_index: u32, surface: vk::SurfaceKHR, ) -> VkResult { - let mut b = 0; + let mut b = mem::MaybeUninit::uninit(); (self.fp.get_physical_device_surface_support_khr)( physical_device, queue_family_index, surface, - &mut b, + b.as_mut_ptr(), ) - .result_with_success(b > 0) + .result()?; + Ok(b.assume_init() > 0) } /// @@ -62,13 +63,13 @@ impl Surface { physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, ) -> VkResult { - let mut surface_capabilities = mem::zeroed(); + let mut surface_capabilities = mem::MaybeUninit::uninit(); (self.fp.get_physical_device_surface_capabilities_khr)( physical_device, surface, - &mut surface_capabilities, + surface_capabilities.as_mut_ptr(), ) - .result_with_success(surface_capabilities) + .assume_init_on_success(surface_capabilities) } /// diff --git a/ash/src/extensions/khr/swapchain.rs b/ash/src/extensions/khr/swapchain.rs index 03b970230..cfc10acd8 100755 --- a/ash/src/extensions/khr/swapchain.rs +++ b/ash/src/extensions/khr/swapchain.rs @@ -29,14 +29,14 @@ impl Swapchain { create_info: &vk::SwapchainCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut swapchain = mem::zeroed(); + let mut swapchain = mem::MaybeUninit::uninit(); (self.fp.create_swapchain_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut swapchain, + swapchain.as_mut_ptr(), ) - .result_with_success(swapchain) + .assume_init_on_success(swapchain) } /// @@ -71,18 +71,18 @@ impl Swapchain { semaphore: vk::Semaphore, fence: vk::Fence, ) -> VkResult<(u32, bool)> { - let mut index = 0; + let mut index = mem::MaybeUninit::uninit(); let err_code = (self.fp.acquire_next_image_khr)( self.handle, swapchain, timeout, semaphore, fence, - &mut index, + index.as_mut_ptr(), ); match err_code { - vk::Result::SUCCESS => Ok((index, false)), - vk::Result::SUBOPTIMAL_KHR => Ok((index, true)), + vk::Result::SUCCESS => Ok((index.assume_init(), false)), + vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)), _ => Err(err_code), } } @@ -139,9 +139,13 @@ impl Swapchain { &self, surface: vk::SurfaceKHR, ) -> VkResult { - let mut modes = mem::zeroed(); - (self.fp.get_device_group_surface_present_modes_khr)(self.handle, surface, &mut modes) - .result_with_success(modes) + let mut modes = mem::MaybeUninit::uninit(); + (self.fp.get_device_group_surface_present_modes_khr)( + self.handle, + surface, + modes.as_mut_ptr(), + ) + .assume_init_on_success(modes) } /// Only available since [Vulkan 1.1]. @@ -185,11 +189,12 @@ impl Swapchain { &self, acquire_info: &vk::AcquireNextImageInfoKHR<'_>, ) -> VkResult<(u32, bool)> { - let mut index = 0; - let err_code = (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, &mut index); + let mut index = mem::MaybeUninit::uninit(); + let err_code = + (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, index.as_mut_ptr()); match err_code { - vk::Result::SUCCESS => Ok((index, false)), - vk::Result::SUBOPTIMAL_KHR => Ok((index, true)), + vk::Result::SUCCESS => Ok((index.assume_init(), false)), + vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)), _ => Err(err_code), } } diff --git a/ash/src/extensions/khr/timeline_semaphore.rs b/ash/src/extensions/khr/timeline_semaphore.rs index 2cb96a3d5..afd5f864f 100644 --- a/ash/src/extensions/khr/timeline_semaphore.rs +++ b/ash/src/extensions/khr/timeline_semaphore.rs @@ -22,9 +22,9 @@ impl TimelineSemaphore { /// #[inline] pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { - let mut value = 0; - (self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, &mut value) - .result_with_success(value) + let mut value = mem::MaybeUninit::uninit(); + (self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, value.as_mut_ptr()) + .assume_init_on_success(value) } /// diff --git a/ash/src/extensions/khr/wayland_surface.rs b/ash/src/extensions/khr/wayland_surface.rs index 1dd4a370d..d7f382d7d 100755 --- a/ash/src/extensions/khr/wayland_surface.rs +++ b/ash/src/extensions/khr/wayland_surface.rs @@ -27,14 +27,14 @@ impl WaylandSurface { create_info: &vk::WaylandSurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_wayland_surface_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } /// diff --git a/ash/src/extensions/khr/win32_surface.rs b/ash/src/extensions/khr/win32_surface.rs index 98b81258b..e72752d1d 100755 --- a/ash/src/extensions/khr/win32_surface.rs +++ b/ash/src/extensions/khr/win32_surface.rs @@ -27,14 +27,14 @@ impl Win32Surface { create_info: &vk::Win32SurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_win32_surface_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } /// diff --git a/ash/src/extensions/khr/xcb_surface.rs b/ash/src/extensions/khr/xcb_surface.rs index d9f79c335..70a400e91 100755 --- a/ash/src/extensions/khr/xcb_surface.rs +++ b/ash/src/extensions/khr/xcb_surface.rs @@ -27,14 +27,14 @@ impl XcbSurface { create_info: &vk::XcbSurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_xcb_surface_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } /// diff --git a/ash/src/extensions/khr/xlib_surface.rs b/ash/src/extensions/khr/xlib_surface.rs index db4f87ac9..a0cf78254 100755 --- a/ash/src/extensions/khr/xlib_surface.rs +++ b/ash/src/extensions/khr/xlib_surface.rs @@ -27,14 +27,14 @@ impl XlibSurface { create_info: &vk::XlibSurfaceCreateInfoKHR<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_xlib_surface_khr)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } /// diff --git a/ash/src/extensions/mvk/ios_surface.rs b/ash/src/extensions/mvk/ios_surface.rs index 005ee88de..cf33f1b8f 100755 --- a/ash/src/extensions/mvk/ios_surface.rs +++ b/ash/src/extensions/mvk/ios_surface.rs @@ -27,14 +27,14 @@ impl IOSSurface { create_info: &vk::IOSSurfaceCreateInfoMVK<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_ios_surface_mvk)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::MvkIosSurfaceFn::NAME; diff --git a/ash/src/extensions/mvk/macos_surface.rs b/ash/src/extensions/mvk/macos_surface.rs index 5d2feefcb..9d68d49ba 100755 --- a/ash/src/extensions/mvk/macos_surface.rs +++ b/ash/src/extensions/mvk/macos_surface.rs @@ -27,14 +27,14 @@ impl MacOSSurface { create_info: &vk::MacOSSurfaceCreateInfoMVK<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_mac_os_surface_mvk)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::MvkMacosSurfaceFn::NAME; diff --git a/ash/src/extensions/nn/vi_surface.rs b/ash/src/extensions/nn/vi_surface.rs index 07fec1259..3b6c29670 100644 --- a/ash/src/extensions/nn/vi_surface.rs +++ b/ash/src/extensions/nn/vi_surface.rs @@ -27,14 +27,14 @@ impl ViSurface { create_info: &vk::ViSurfaceCreateInfoNN<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut surface = mem::zeroed(); + let mut surface = mem::MaybeUninit::uninit(); (self.fp.create_vi_surface_nn)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut surface, + surface.as_mut_ptr(), ) - .result_with_success(surface) + .assume_init_on_success(surface) } pub const NAME: &'static CStr = vk::NnViSurfaceFn::NAME; diff --git a/ash/src/extensions/nv/coverage_reduction_mode.rs b/ash/src/extensions/nv/coverage_reduction_mode.rs index 972849d1b..94c789211 100644 --- a/ash/src/extensions/nv/coverage_reduction_mode.rs +++ b/ash/src/extensions/nv/coverage_reduction_mode.rs @@ -24,15 +24,16 @@ impl CoverageReductionMode { &self, physical_device: vk::PhysicalDevice, ) -> VkResult { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self .fp .get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)( physical_device, - &mut count, + count.as_mut_ptr(), std::ptr::null_mut(), ) - .result_with_success(count as usize) + .assume_init_on_success(count) + .map(|c| c as usize) } /// diff --git a/ash/src/extensions/nv/device_diagnostic_checkpoints.rs b/ash/src/extensions/nv/device_diagnostic_checkpoints.rs index d665c2c82..03c801119 100644 --- a/ash/src/extensions/nv/device_diagnostic_checkpoints.rs +++ b/ash/src/extensions/nv/device_diagnostic_checkpoints.rs @@ -31,9 +31,9 @@ impl DeviceDiagnosticCheckpoints { /// Retrieve the number of elements to pass to [`get_queue_checkpoint_data()`][Self::get_queue_checkpoint_data()] #[inline] pub unsafe fn get_queue_checkpoint_data_len(&self, queue: vk::Queue) -> usize { - let mut count = 0; - (self.fp.get_queue_checkpoint_data_nv)(queue, &mut count, std::ptr::null_mut()); - count as usize + let mut count = mem::MaybeUninit::uninit(); + (self.fp.get_queue_checkpoint_data_nv)(queue, count.as_mut_ptr(), std::ptr::null_mut()); + count.assume_init() as usize } /// diff --git a/ash/src/extensions/nv/ray_tracing.rs b/ash/src/extensions/nv/ray_tracing.rs index 75d718724..d09a70959 100755 --- a/ash/src/extensions/nv/ray_tracing.rs +++ b/ash/src/extensions/nv/ray_tracing.rs @@ -27,14 +27,14 @@ impl RayTracing { create_info: &vk::AccelerationStructureCreateInfoNV<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut accel_struct = mem::zeroed(); + let mut accel_struct = mem::MaybeUninit::uninit(); (self.fp.create_acceleration_structure_nv)( self.handle, create_info, allocation_callbacks.as_raw_ptr(), - &mut accel_struct, + accel_struct.as_mut_ptr(), ) - .result_with_success(accel_struct) + .assume_init_on_success(accel_struct) } /// @@ -166,7 +166,7 @@ impl RayTracing { create_info: &[vk::RayTracingPipelineCreateInfoNV<'_>], allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult> { - let mut pipelines = vec![mem::zeroed(); create_info.len()]; + let mut pipelines = Vec::with_capacity(create_info.len()); (self.fp.create_ray_tracing_pipelines_nv)( self.handle, pipeline_cache, @@ -175,7 +175,7 @@ impl RayTracing { allocation_callbacks.as_raw_ptr(), pipelines.as_mut_ptr(), ) - .result_with_success(pipelines) + .set_vec_len_on_success(pipelines, create_info.len()) } /// @@ -204,15 +204,14 @@ impl RayTracing { &self, accel_struct: vk::AccelerationStructureNV, ) -> VkResult { - let mut handle: u64 = 0; - let handle_ptr: *mut u64 = &mut handle; + let mut handle = mem::MaybeUninit::::uninit(); (self.fp.get_acceleration_structure_handle_nv)( self.handle, accel_struct, - std::mem::size_of::(), - handle_ptr.cast(), + std::mem::size_of_val(&handle), + handle.as_mut_ptr().cast(), ) - .result_with_success(handle) + .assume_init_on_success(handle) } /// diff --git a/ash/src/instance.rs b/ash/src/instance.rs index 97576fe0c..898722472 100644 --- a/ash/src/instance.rs +++ b/ash/src/instance.rs @@ -67,13 +67,14 @@ impl Instance { &self, physical_device: vk::PhysicalDevice, ) -> VkResult { - let mut count = 0; + let mut count = mem::MaybeUninit::uninit(); (self.instance_fn_1_3.get_physical_device_tool_properties)( physical_device, - &mut count, + count.as_mut_ptr(), ptr::null_mut(), ) - .result_with_success(count as usize) + .assume_init_on_success(count) + .map(|c| c as usize) } /// @@ -108,13 +109,14 @@ impl Instance { /// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()] #[inline] pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult { - let mut group_count = 0; + let mut group_count = mem::MaybeUninit::uninit(); (self.instance_fn_1_1.enumerate_physical_device_groups)( self.handle(), - &mut group_count, + group_count.as_mut_ptr(), ptr::null_mut(), ) - .result_with_success(group_count as usize) + .assume_init_on_success(group_count) + .map(|c| c as usize) } /// @@ -192,15 +194,15 @@ impl Instance { &self, physical_device: vk::PhysicalDevice, ) -> usize { - let mut queue_count = 0; + let mut queue_count = mem::MaybeUninit::uninit(); (self .instance_fn_1_1 .get_physical_device_queue_family_properties2)( physical_device, - &mut queue_count, + queue_count.as_mut_ptr(), ptr::null_mut(), ); - queue_count as usize + queue_count.assume_init() as usize } /// @@ -241,16 +243,16 @@ impl Instance { physical_device: vk::PhysicalDevice, format_info: &vk::PhysicalDeviceSparseImageFormatInfo2<'_>, ) -> usize { - let mut format_count = 0; + let mut format_count = mem::MaybeUninit::uninit(); (self .instance_fn_1_1 .get_physical_device_sparse_image_format_properties2)( physical_device, format_info, - &mut format_count, + format_count.as_mut_ptr(), ptr::null_mut(), ); - format_count as usize + format_count.assume_init() as usize } /// @@ -356,14 +358,14 @@ impl Instance { create_info: &vk::DeviceCreateInfo<'_>, allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, ) -> VkResult { - let mut device = mem::zeroed(); - (self.instance_fn_1_0.create_device)( + let mut device = mem::MaybeUninit::uninit(); + let device = (self.instance_fn_1_0.create_device)( physical_device, create_info, allocation_callbacks.as_raw_ptr(), - &mut device, + device.as_mut_ptr(), ) - .result()?; + .assume_init_on_success(device)?; Ok(Device::load(&self.instance_fn_1_0, device)) } @@ -393,13 +395,13 @@ impl Instance { physical_device: vk::PhysicalDevice, format: vk::Format, ) -> vk::FormatProperties { - let mut format_prop = mem::zeroed(); + let mut format_prop = mem::MaybeUninit::uninit(); (self.instance_fn_1_0.get_physical_device_format_properties)( physical_device, format, - &mut format_prop, + format_prop.as_mut_ptr(), ); - format_prop + format_prop.assume_init() } /// @@ -413,7 +415,7 @@ impl Instance { usage: vk::ImageUsageFlags, flags: vk::ImageCreateFlags, ) -> VkResult { - let mut image_format_prop = mem::zeroed(); + let mut image_format_prop = mem::MaybeUninit::uninit(); (self .instance_fn_1_0 .get_physical_device_image_format_properties)( @@ -423,9 +425,9 @@ impl Instance { tiling, usage, flags, - &mut image_format_prop, + image_format_prop.as_mut_ptr(), ) - .result_with_success(image_format_prop) + .assume_init_on_success(image_format_prop) } /// @@ -434,12 +436,12 @@ impl Instance { &self, physical_device: vk::PhysicalDevice, ) -> vk::PhysicalDeviceMemoryProperties { - let mut memory_prop = mem::zeroed(); + let mut memory_prop = mem::MaybeUninit::uninit(); (self.instance_fn_1_0.get_physical_device_memory_properties)( physical_device, - &mut memory_prop, + memory_prop.as_mut_ptr(), ); - memory_prop + memory_prop.assume_init() } /// @@ -448,9 +450,9 @@ impl Instance { &self, physical_device: vk::PhysicalDevice, ) -> vk::PhysicalDeviceProperties { - let mut prop = mem::zeroed(); - (self.instance_fn_1_0.get_physical_device_properties)(physical_device, &mut prop); - prop + let mut prop = mem::MaybeUninit::uninit(); + (self.instance_fn_1_0.get_physical_device_properties)(physical_device, prop.as_mut_ptr()); + prop.assume_init() } /// @@ -477,9 +479,9 @@ impl Instance { &self, physical_device: vk::PhysicalDevice, ) -> vk::PhysicalDeviceFeatures { - let mut prop = mem::zeroed(); - (self.instance_fn_1_0.get_physical_device_features)(physical_device, &mut prop); - prop + let mut prop = mem::MaybeUninit::uninit(); + (self.instance_fn_1_0.get_physical_device_features)(physical_device, prop.as_mut_ptr()); + prop.assume_init() } /// diff --git a/ash/src/prelude.rs b/ash/src/prelude.rs index 8f79494c1..d73e53de0 100644 --- a/ash/src/prelude.rs +++ b/ash/src/prelude.rs @@ -24,6 +24,14 @@ impl vk::Result { pub unsafe fn assume_init_on_success(self, v: mem::MaybeUninit) -> VkResult { self.result().map(move |()| v.assume_init()) } + + #[inline] + pub unsafe fn set_vec_len_on_success(self, mut v: Vec, len: usize) -> VkResult> { + self.result().map(move |()| { + v.set_len(len); + v + }) + } } /// Repeatedly calls `f` until it does not return [`vk::Result::INCOMPLETE`] anymore, ensuring all @@ -48,9 +56,10 @@ where let err_code = f(&mut count, data.as_mut_ptr()); if err_code != vk::Result::INCOMPLETE { - err_code.result()?; - data.set_len(count.try_into().expect("`N` failed to convert to `usize`")); - break Ok(data); + break err_code.set_vec_len_on_success( + data, + count.try_into().expect("`N` failed to convert to `usize`"), + ); } } } @@ -85,8 +94,10 @@ where let err_code = f(&mut count, data.as_mut_ptr()); if err_code != vk::Result::INCOMPLETE { - data.set_len(count.try_into().expect("`N` failed to convert to `usize`")); - break err_code.result_with_success(data); + break err_code.set_vec_len_on_success( + data, + count.try_into().expect("`N` failed to convert to `usize`"), + ); } } } From e5b08732db837d6205d11de4f09a27aea83d085f Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 2 Dec 2023 19:52:35 +0100 Subject: [PATCH 17/23] generator: Work around invariance for assigning mutable pointer of lifetimed slice (#841) In essence this builder function needs to adhere to two rules: 1. No ref-after-free: the slice must outlive (uses of) the builder object; 2. No aliasing: the slice cannot be (im)mutably used while it is mutably borrowed within a live builder object. These two rules have been tested and are satisfied by the given builder implementation. Without this change `timings` seems to be borrowing itself, hence is not allowed to be used after it has been temporarily mutably borrowed inside the builder, even after that builder was dropped. Thus defeating the purpose of this "getter" API via a struct. Without the `.cast()`, because mutable raw pointers are invariant (i.e. there is no subtyping relationship) the compiler complains about requiring `self` to outlive `timings` instead, which does not satisfy the two rules above. --- ash/src/vk/definitions.rs | 4 ++-- generator/src/lib.rs | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index c0b537d52..dcc9d862f 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -52045,9 +52045,9 @@ unsafe impl<'a> TaggedStructure for GetLatencyMarkerInfoNV<'a> { } impl<'a> GetLatencyMarkerInfoNV<'a> { #[inline] - pub fn timings(mut self, timings: &'a mut [LatencyTimingsFrameReportNV<'a>]) -> Self { + pub fn timings(mut self, timings: &'a mut [LatencyTimingsFrameReportNV<'_>]) -> Self { self.timing_count = timings.len() as _; - self.p_timings = timings.as_mut_ptr(); + self.p_timings = timings.as_mut_ptr().cast(); self } } diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 806c9741a..2b27ed6a4 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1929,7 +1929,7 @@ fn derive_setters( let deprecated = member.deprecated.as_ref().map(|d| quote!(#d #[allow(deprecated)])); let param_ident = field.param_ident(); - let type_lifetime = has_lifetimes + let mut type_lifetime = has_lifetimes .contains(&name_to_tokens(&field.basetype)) .then(|| quote!(<'a>)); let param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); @@ -2018,14 +2018,20 @@ fn derive_setters( // TODO: Improve in future when https://github.com/rust-lang/rust/issues/53667 is merged id:6 if field.reference.is_some() && matches!(field.array, Some(vkxml::ArrayType::Dynamic)) { if let Some(ref array_size) = field.size { - let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); - let mut ptr = if field.is_const { quote!(.as_ptr()) + } else if let Some(tl) = &mut type_lifetime { + // Work around invariance with mutable pointers: + // https://github.com/ash-rs/ash/issues/837 + // https://doc.rust-lang.org/nomicon/subtyping.html#variance + *tl = quote!(<'_>); + quote!(.as_mut_ptr().cast()) } else { quote!(.as_mut_ptr()) }; + let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); + // Interpret void array as byte array if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { slice_param_ty_tokens = quote!([u8]); From befb8cdd36aa30e9c1976f64ef2b727c982fd636 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 2 Dec 2023 20:04:57 +0100 Subject: [PATCH 18/23] 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. --- .github/workflows/ci.yml | 14 +- Changelog.md | 2 +- README.md | 2 +- ash-rewrite/Cargo.toml | 2 +- ash-window/Cargo.toml | 2 +- ash-window/Changelog.md | 2 +- ash-window/README.md | 2 +- ash/Cargo.toml | 2 +- ash/src/vk/definitions.rs | 324 ++++++++++++++++++++++---------------- ash/src/vk/prelude.rs | 12 +- generator/src/lib.rs | 12 +- 11 files changed, 210 insertions(+), 166 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab7db47d3..40d104aa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,20 +11,12 @@ jobs: - run: cargo check --workspace --all-targets --all-features check_msrv: - name: Check ash MSRV (1.60.0) + name: Check ash and ash-window MSRV (1.69.0) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.60.0 - - run: cargo check -p ash -p ash-rewrite --all-features - - check_ash_window_msrv: - name: Check ash-window MSRV (1.64.0) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.64.0 - - run: cargo check -p ash-window -p ash-examples --all-features + - uses: dtolnay/rust-toolchain@1.69.0 + - run: cargo check -p ash -p ash-rewrite -p ash-window -p ash-examples --all-features # TODO: add a similar job for the rewrite once that generates code generated: diff --git a/Changelog.md b/Changelog.md index 99b391b69..fe6db4d50 100644 --- a/Changelog.md +++ b/Changelog.md @@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replaced builders with lifetimes/setters directly on Vulkan structs (#602) - Inlined struct setters (#602) -- Bumped MSRV from 1.59 to 1.60 (#709) +- Bumped MSRV from 1.59 to 1.69 (#709, #746) - Replaced `const fn name()` with associated `NAME` constants (#715) - Generic builders now automatically set `objecttype` to `::ObjectType` (#724) - `get_calibrated_timestamps()` now returns a single value for `max_deviation` (#738) diff --git a/README.md b/README.md index 235d48aee..56f3fe936 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A very lightweight wrapper around Vulkan [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT) [![LICENSE](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE-APACHE) [![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![MSRV](https://img.shields.io/badge/rustc-1.60.0+-ab6000.svg)](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html) +[![MSRV](https://img.shields.io/badge/rustc-1.69.0+-ab6000.svg)](https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html) ## Overview diff --git a/ash-rewrite/Cargo.toml b/ash-rewrite/Cargo.toml index 2f1c33ac1..77cdc05e4 100644 --- a/ash-rewrite/Cargo.toml +++ b/ash-rewrite/Cargo.toml @@ -18,7 +18,7 @@ categories = [ documentation = "https://docs.rs/ash" edition = "2021" # TODO: reevaluate, then update in ci.yml -rust-version = "1.60.0" +rust-version = "1.69.0" [dependencies] libloading = { version = "0.8", optional = true } diff --git a/ash-window/Cargo.toml b/ash-window/Cargo.toml index 761bf645a..254c8d05d 100644 --- a/ash-window/Cargo.toml +++ b/ash-window/Cargo.toml @@ -16,7 +16,7 @@ categories = [ "rendering::graphics-api" ] edition = "2021" -rust-version = "1.64.0" +rust-version = "1.69.0" [dependencies] ash = { path = "../ash", version = "0.37", default-features = false } diff --git a/ash-window/Changelog.md b/ash-window/Changelog.md index bf8716f5d..557300eee 100644 --- a/ash-window/Changelog.md +++ b/ash-window/Changelog.md @@ -2,7 +2,7 @@ ## [Unreleased] - ReleaseDate -- Bumped MSRV from 1.59 to 1.64 for `winit 0.28` and `raw-window-handle 0.5.1`. (#709, #716) +- Bumped MSRV from 1.59 to 1.69 for `winit 0.28` and `raw-window-handle 0.5.1`, and `CStr::from_bytes_until_nul`. (#709, #716, #746) ## [0.12.0] - 2022-09-23 diff --git a/ash-window/README.md b/ash-window/README.md index b683999ac..307222874 100644 --- a/ash-window/README.md +++ b/ash-window/README.md @@ -8,7 +8,7 @@ Interoperability between [`ash`](https://github.com/ash-rs/ash) and [`raw-window [![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT) [![LICENSE](https://img.shields.io/badge/license-apache-blue.svg)](LICENSE-APACHE) [![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![MSRV](https://img.shields.io/badge/rustc-1.64.0+-ab6000.svg)](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html) +[![MSRV](https://img.shields.io/badge/rustc-1.69.0+-ab6000.svg)](https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html) ## Usage diff --git a/ash/Cargo.toml b/ash/Cargo.toml index e27f2280a..8832369c9 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -19,7 +19,7 @@ categories = [ "rendering::graphics-api" ] edition = "2021" -rust-version = "1.60.0" +rust-version = "1.69.0" [dependencies] libloading = { version = "0.8", optional = true } diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index dcc9d862f..c422f9bfb 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -817,7 +817,7 @@ impl fmt::Debug for PhysicalDeviceProperties { .field("vendor_id", &self.vendor_id) .field("device_id", &self.device_id) .field("device_type", &self.device_type) - .field("device_name", &unsafe { self.device_name_as_c_str() }) + .field("device_name", &self.device_name_as_c_str()) .field("pipeline_cache_uuid", &self.pipeline_cache_uuid) .field("limits", &self.limits) .field("sparse_properties", &self.sparse_properties) @@ -869,12 +869,14 @@ impl PhysicalDeviceProperties { #[inline] pub fn device_name( mut self, - device_name: &std::ffi::CStr, - ) -> std::result::Result { + device_name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.device_name, device_name).map(|()| self) } #[inline] - pub unsafe fn device_name_as_c_str(&self) -> &std::ffi::CStr { + pub fn device_name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.device_name) } #[inline] @@ -904,7 +906,7 @@ pub struct ExtensionProperties { impl fmt::Debug for ExtensionProperties { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("ExtensionProperties") - .field("extension_name", &unsafe { self.extension_name_as_c_str() }) + .field("extension_name", &self.extension_name_as_c_str()) .field("spec_version", &self.spec_version) .finish() } @@ -922,12 +924,14 @@ impl ExtensionProperties { #[inline] pub fn extension_name( mut self, - extension_name: &std::ffi::CStr, - ) -> std::result::Result { + extension_name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.extension_name, extension_name).map(|()| self) } #[inline] - pub unsafe fn extension_name_as_c_str(&self) -> &std::ffi::CStr { + pub fn extension_name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.extension_name) } #[inline] @@ -949,10 +953,10 @@ pub struct LayerProperties { impl fmt::Debug for LayerProperties { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("LayerProperties") - .field("layer_name", &unsafe { self.layer_name_as_c_str() }) + .field("layer_name", &self.layer_name_as_c_str()) .field("spec_version", &self.spec_version) .field("implementation_version", &self.implementation_version) - .field("description", &unsafe { self.description_as_c_str() }) + .field("description", &self.description_as_c_str()) .finish() } } @@ -971,12 +975,14 @@ impl LayerProperties { #[inline] pub fn layer_name( mut self, - layer_name: &std::ffi::CStr, - ) -> std::result::Result { + layer_name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.layer_name, layer_name).map(|()| self) } #[inline] - pub unsafe fn layer_name_as_c_str(&self) -> &std::ffi::CStr { + pub fn layer_name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.layer_name) } #[inline] @@ -992,12 +998,14 @@ impl LayerProperties { #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } } @@ -1035,13 +1043,13 @@ unsafe impl<'a> TaggedStructure for ApplicationInfo<'a> { } impl<'a> ApplicationInfo<'a> { #[inline] - pub fn application_name(mut self, application_name: &'a std::ffi::CStr) -> Self { + pub fn application_name(mut self, application_name: &'a core::ffi::CStr) -> Self { self.p_application_name = application_name.as_ptr(); self } #[inline] - pub unsafe fn application_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_application_name) + pub unsafe fn application_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_application_name) } #[inline] pub fn application_version(mut self, application_version: u32) -> Self { @@ -1049,13 +1057,13 @@ impl<'a> ApplicationInfo<'a> { self } #[inline] - pub fn engine_name(mut self, engine_name: &'a std::ffi::CStr) -> Self { + pub fn engine_name(mut self, engine_name: &'a core::ffi::CStr) -> Self { self.p_engine_name = engine_name.as_ptr(); self } #[inline] - pub unsafe fn engine_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_engine_name) + pub unsafe fn engine_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_engine_name) } #[inline] pub fn engine_version(mut self, engine_version: u32) -> Self { @@ -3675,13 +3683,13 @@ impl<'a> PipelineShaderStageCreateInfo<'a> { self } #[inline] - pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a core::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_name) } #[inline] pub fn specialization_info(mut self, specialization_info: &'a SpecializationInfo<'a>) -> Self { @@ -7740,13 +7748,13 @@ impl<'a> DisplayPropertiesKHR<'a> { self } #[inline] - pub fn display_name(mut self, display_name: &'a std::ffi::CStr) -> Self { + pub fn display_name(mut self, display_name: &'a core::ffi::CStr) -> Self { self.display_name = display_name.as_ptr(); self } #[inline] - pub unsafe fn display_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.display_name) + pub unsafe fn display_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.display_name) } #[inline] pub fn physical_dimensions(mut self, physical_dimensions: Extent2D) -> Self { @@ -9017,13 +9025,13 @@ impl<'a> DebugMarkerObjectNameInfoEXT<'a> { self } #[inline] - pub fn object_name(mut self, object_name: &'a std::ffi::CStr) -> Self { + pub fn object_name(mut self, object_name: &'a core::ffi::CStr) -> Self { self.p_object_name = object_name.as_ptr(); self } #[inline] - pub unsafe fn object_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_object_name) + pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_object_name) } } #[repr(C)] @@ -9109,13 +9117,13 @@ unsafe impl<'a> TaggedStructure for DebugMarkerMarkerInfoEXT<'a> { } impl<'a> DebugMarkerMarkerInfoEXT<'a> { #[inline] - pub fn marker_name(mut self, marker_name: &'a std::ffi::CStr) -> Self { + pub fn marker_name(mut self, marker_name: &'a core::ffi::CStr) -> Self { self.p_marker_name = marker_name.as_ptr(); self } #[inline] - pub unsafe fn marker_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_marker_name) + pub unsafe fn marker_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_marker_name) } #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { @@ -10948,8 +10956,8 @@ impl fmt::Debug for PhysicalDeviceDriverProperties<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) - .field("driver_name", &unsafe { self.driver_name_as_c_str() }) - .field("driver_info", &unsafe { self.driver_info_as_c_str() }) + .field("driver_name", &self.driver_name_as_c_str()) + .field("driver_info", &self.driver_info_as_c_str()) .field("conformance_version", &self.conformance_version) .finish() } @@ -10981,23 +10989,27 @@ impl<'a> PhysicalDeviceDriverProperties<'a> { #[inline] pub fn driver_name( mut self, - driver_name: &std::ffi::CStr, - ) -> std::result::Result { + driver_name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.driver_name, driver_name).map(|()| self) } #[inline] - pub unsafe fn driver_name_as_c_str(&self) -> &std::ffi::CStr { + pub fn driver_name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.driver_name) } #[inline] pub fn driver_info( mut self, - driver_info: &std::ffi::CStr, - ) -> std::result::Result { + driver_info: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) } #[inline] - pub unsafe fn driver_info_as_c_str(&self) -> &std::ffi::CStr { + pub fn driver_info_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.driver_info) } #[inline] @@ -18350,13 +18362,13 @@ impl<'a> DebugUtilsObjectNameInfoEXT<'a> { self } #[inline] - pub fn object_name(mut self, object_name: &'a std::ffi::CStr) -> Self { + pub fn object_name(mut self, object_name: &'a core::ffi::CStr) -> Self { self.p_object_name = object_name.as_ptr(); self } #[inline] - pub unsafe fn object_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_object_name) + pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_object_name) } } #[repr(C)] @@ -18438,13 +18450,13 @@ unsafe impl<'a> TaggedStructure for DebugUtilsLabelEXT<'a> { } impl<'a> DebugUtilsLabelEXT<'a> { #[inline] - pub fn label_name(mut self, label_name: &'a std::ffi::CStr) -> Self { + pub fn label_name(mut self, label_name: &'a core::ffi::CStr) -> Self { self.p_label_name = label_name.as_ptr(); self } #[inline] - pub unsafe fn label_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_label_name) + pub unsafe fn label_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_label_name) } #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { @@ -18581,13 +18593,13 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { self } #[inline] - pub fn message_id_name(mut self, message_id_name: &'a std::ffi::CStr) -> Self { + pub fn message_id_name(mut self, message_id_name: &'a core::ffi::CStr) -> Self { self.p_message_id_name = message_id_name.as_ptr(); self } #[inline] - pub unsafe fn message_id_name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_message_id_name) + pub unsafe fn message_id_name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_message_id_name) } #[inline] pub fn message_id_number(mut self, message_id_number: i32) -> Self { @@ -18595,13 +18607,13 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { self } #[inline] - pub fn message(mut self, message: &'a std::ffi::CStr) -> Self { + pub fn message(mut self, message: &'a core::ffi::CStr) -> Self { self.p_message = message.as_ptr(); self } #[inline] - pub unsafe fn message_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_message) + pub unsafe fn message_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_message) } #[inline] pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self { @@ -27128,9 +27140,9 @@ impl fmt::Debug for PerformanceCounterDescriptionKHR<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("flags", &self.flags) - .field("name", &unsafe { self.name_as_c_str() }) - .field("category", &unsafe { self.category_as_c_str() }) - .field("description", &unsafe { self.description_as_c_str() }) + .field("name", &self.name_as_c_str()) + .field("category", &self.category_as_c_str()) + .field("description", &self.description_as_c_str()) .finish() } } @@ -27160,34 +27172,40 @@ impl<'a> PerformanceCounterDescriptionKHR<'a> { #[inline] pub fn name( mut self, - name: &std::ffi::CStr, - ) -> std::result::Result { + name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + pub fn name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.name) } #[inline] pub fn category( mut self, - category: &std::ffi::CStr, - ) -> std::result::Result { + category: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.category, category).map(|()| self) } #[inline] - pub unsafe fn category_as_c_str(&self) -> &std::ffi::CStr { + pub fn category_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.category) } #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } } @@ -28227,8 +28245,8 @@ impl fmt::Debug for PipelineExecutablePropertiesKHR<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("stages", &self.stages) - .field("name", &unsafe { self.name_as_c_str() }) - .field("description", &unsafe { self.description_as_c_str() }) + .field("name", &self.name_as_c_str()) + .field("description", &self.description_as_c_str()) .field("subgroup_size", &self.subgroup_size) .finish() } @@ -28259,23 +28277,27 @@ impl<'a> PipelineExecutablePropertiesKHR<'a> { #[inline] pub fn name( mut self, - name: &std::ffi::CStr, - ) -> std::result::Result { + name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + pub fn name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.name) } #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -28355,8 +28377,8 @@ impl fmt::Debug for PipelineExecutableStatisticKHR<'_> { fmt.debug_struct("PipelineExecutableStatisticKHR") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { self.name_as_c_str() }) - .field("description", &unsafe { self.description_as_c_str() }) + .field("name", &self.name_as_c_str()) + .field("description", &self.description_as_c_str()) .field("format", &self.format) .field("value", &"union") .finish() @@ -28383,23 +28405,27 @@ impl<'a> PipelineExecutableStatisticKHR<'a> { #[inline] pub fn name( mut self, - name: &std::ffi::CStr, - ) -> std::result::Result { + name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + pub fn name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.name) } #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -28432,8 +28458,8 @@ impl fmt::Debug for PipelineExecutableInternalRepresentationKHR<'_> { fmt.debug_struct("PipelineExecutableInternalRepresentationKHR") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { self.name_as_c_str() }) - .field("description", &unsafe { self.description_as_c_str() }) + .field("name", &self.name_as_c_str()) + .field("description", &self.description_as_c_str()) .field("is_text", &self.is_text) .field("data_size", &self.data_size) .field("p_data", &self.p_data) @@ -28463,23 +28489,27 @@ impl<'a> PipelineExecutableInternalRepresentationKHR<'a> { #[inline] pub fn name( mut self, - name: &std::ffi::CStr, - ) -> std::result::Result { + name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + pub fn name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.name) } #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -29948,8 +29978,8 @@ impl fmt::Debug for PhysicalDeviceVulkan12Properties<'_> { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) - .field("driver_name", &unsafe { self.driver_name_as_c_str() }) - .field("driver_info", &unsafe { self.driver_info_as_c_str() }) + .field("driver_name", &self.driver_name_as_c_str()) + .field("driver_info", &self.driver_info_as_c_str()) .field("conformance_version", &self.conformance_version) .field( "denorm_behavior_independence", @@ -30215,23 +30245,27 @@ impl<'a> PhysicalDeviceVulkan12Properties<'a> { #[inline] pub fn driver_name( mut self, - driver_name: &std::ffi::CStr, - ) -> std::result::Result { + driver_name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.driver_name, driver_name).map(|()| self) } #[inline] - pub unsafe fn driver_name_as_c_str(&self) -> &std::ffi::CStr { + pub fn driver_name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.driver_name) } #[inline] pub fn driver_info( mut self, - driver_info: &std::ffi::CStr, - ) -> std::result::Result { + driver_info: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) } #[inline] - pub unsafe fn driver_info_as_c_str(&self) -> &std::ffi::CStr { + pub fn driver_info_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.driver_info) } #[inline] @@ -31312,11 +31346,11 @@ impl fmt::Debug for PhysicalDeviceToolProperties<'_> { fmt.debug_struct("PhysicalDeviceToolProperties") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("name", &unsafe { self.name_as_c_str() }) - .field("version", &unsafe { self.version_as_c_str() }) + .field("name", &self.name_as_c_str()) + .field("version", &self.version_as_c_str()) .field("purposes", &self.purposes) - .field("description", &unsafe { self.description_as_c_str() }) - .field("layer", &unsafe { self.layer_as_c_str() }) + .field("description", &self.description_as_c_str()) + .field("layer", &self.layer_as_c_str()) .finish() } } @@ -31342,23 +31376,27 @@ impl<'a> PhysicalDeviceToolProperties<'a> { #[inline] pub fn name( mut self, - name: &std::ffi::CStr, - ) -> std::result::Result { + name: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.name, name).map(|()| self) } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { + pub fn name_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.name) } #[inline] pub fn version( mut self, - version: &std::ffi::CStr, - ) -> std::result::Result { + version: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.version, version).map(|()| self) } #[inline] - pub unsafe fn version_as_c_str(&self) -> &std::ffi::CStr { + pub fn version_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.version) } #[inline] @@ -31369,23 +31407,27 @@ impl<'a> PhysicalDeviceToolProperties<'a> { #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] pub fn layer( mut self, - layer: &std::ffi::CStr, - ) -> std::result::Result { + layer: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.layer, layer).map(|()| self) } #[inline] - pub unsafe fn layer_as_c_str(&self) -> &std::ffi::CStr { + pub fn layer_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.layer) } } @@ -41521,13 +41563,13 @@ impl<'a> CuFunctionCreateInfoNVX<'a> { self } #[inline] - pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a core::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_name) } } #[repr(C)] @@ -43940,13 +43982,13 @@ impl<'a> CudaFunctionCreateInfoNV<'a> { self } #[inline] - pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a core::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_name) } } #[repr(C)] @@ -45817,7 +45859,7 @@ impl fmt::Debug for RenderPassSubpassFeedbackInfoEXT { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("RenderPassSubpassFeedbackInfoEXT") .field("subpass_merge_status", &self.subpass_merge_status) - .field("description", &unsafe { self.description_as_c_str() }) + .field("description", &self.description_as_c_str()) .field("post_merge_index", &self.post_merge_index) .finish() } @@ -45841,12 +45883,14 @@ impl RenderPassSubpassFeedbackInfoEXT { #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -48592,7 +48636,7 @@ pub struct DeviceFaultVendorInfoEXT { impl fmt::Debug for DeviceFaultVendorInfoEXT { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("DeviceFaultVendorInfoEXT") - .field("description", &unsafe { self.description_as_c_str() }) + .field("description", &self.description_as_c_str()) .field("vendor_fault_code", &self.vendor_fault_code) .field("vendor_fault_data", &self.vendor_fault_data) .finish() @@ -48612,12 +48656,14 @@ impl DeviceFaultVendorInfoEXT { #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -48694,7 +48740,7 @@ impl fmt::Debug for DeviceFaultInfoEXT<'_> { fmt.debug_struct("DeviceFaultInfoEXT") .field("s_type", &self.s_type) .field("p_next", &self.p_next) - .field("description", &unsafe { self.description_as_c_str() }) + .field("description", &self.description_as_c_str()) .field("p_address_infos", &self.p_address_infos) .field("p_vendor_infos", &self.p_vendor_infos) .field("p_vendor_binary_data", &self.p_vendor_binary_data) @@ -48722,12 +48768,14 @@ impl<'a> DeviceFaultInfoEXT<'a> { #[inline] pub fn description( mut self, - description: &std::ffi::CStr, - ) -> std::result::Result { + description: &core::ffi::CStr, + ) -> core::result::Result { write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) } #[inline] - pub unsafe fn description_as_c_str(&self) -> &std::ffi::CStr { + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.description) } #[inline] @@ -50455,13 +50503,13 @@ impl<'a> ShaderCreateInfoEXT<'a> { self } #[inline] - pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a core::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_name) } #[inline] pub fn set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self { @@ -51253,13 +51301,13 @@ unsafe impl<'a> TaggedStructure for PipelineShaderStageNodeCreateInfoAMDX<'a> { unsafe impl ExtendsPipelineShaderStageCreateInfo for PipelineShaderStageNodeCreateInfoAMDX<'_> {} impl<'a> PipelineShaderStageNodeCreateInfoAMDX<'a> { #[inline] - pub fn name(mut self, name: &'a std::ffi::CStr) -> Self { + pub fn name(mut self, name: &'a core::ffi::CStr) -> Self { self.p_name = name.as_ptr(); self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.p_name) } #[inline] pub fn index(mut self, index: u32) -> Self { diff --git a/ash/src/vk/prelude.rs b/ash/src/vk/prelude.rs index c91892f7f..626cd7888 100644 --- a/ash/src/vk/prelude.rs +++ b/ash/src/vk/prelude.rs @@ -64,8 +64,12 @@ pub unsafe trait TaggedStructure { } #[inline] -pub(crate) unsafe fn wrap_c_str_slice_until_nul(str: &[c_char]) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(str.as_ptr()) +pub(crate) fn wrap_c_str_slice_until_nul( + str: &[core::ffi::c_char], +) -> Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { + // SAFETY: The cast from c_char to u8 is ok because a c_char is always one byte. + let bytes = unsafe { core::slice::from_raw_parts(str.as_ptr().cast(), str.len()) }; + core::ffi::CStr::from_bytes_until_nul(bytes) } #[derive(Debug)] @@ -87,11 +91,11 @@ impl fmt::Display for CStrTooLargeForStaticArray { #[inline] pub(crate) fn write_c_str_slice_with_nul( target: &mut [c_char], - str: &std::ffi::CStr, + str: &core::ffi::CStr, ) -> Result<(), CStrTooLargeForStaticArray> { let bytes = str.to_bytes_with_nul(); // SAFETY: The cast from c_char to u8 is ok because a c_char is always one byte. - let bytes = unsafe { std::slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; + let bytes = unsafe { core::slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; let static_array_size = target.len(); target .get_mut(..bytes.len()) diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 2b27ed6a4..de9a36782 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1823,7 +1823,7 @@ fn derive_debug( let param_str = param_ident.to_string(); let debug_value = if is_static_array(field) && field.basetype == "char" { let param_ident = format_ident!("{}_as_c_str", param_ident); - quote!(&unsafe { self.#param_ident() }) + quote!(&self.#param_ident()) } else if param_str.contains("pfn") { quote!(&(self.#param_ident.map(|x| x as *const ()))) } else if union_types.contains(field.basetype.as_str()) { @@ -1988,14 +1988,14 @@ fn derive_setters( return Some(quote! { #[inline] #deprecated - pub fn #param_ident_short(mut self, #param_ident_short: &'a std::ffi::CStr) -> Self { + pub fn #param_ident_short(mut self, #param_ident_short: &'a core::ffi::CStr) -> Self { self.#param_ident = #param_ident_short.as_ptr(); self } #[inline] #deprecated - pub unsafe fn #param_ident_as_c_str(&self) -> &std::ffi::CStr { - std::ffi::CStr::from_ptr(self.#param_ident) + pub unsafe fn #param_ident_as_c_str(&self) -> &core::ffi::CStr { + core::ffi::CStr::from_ptr(self.#param_ident) } }); } else if is_static_array(field) { @@ -2003,12 +2003,12 @@ fn derive_setters( return Some(quote! { #[inline] #deprecated - pub fn #param_ident_short(mut self, #param_ident_short: &std::ffi::CStr) -> std::result::Result { + pub fn #param_ident_short(mut self, #param_ident_short: &core::ffi::CStr) -> core::result::Result { write_c_str_slice_with_nul(&mut self.#param_ident, #param_ident_short).map(|()| self) } #[inline] #deprecated - pub unsafe fn #param_ident_as_c_str(&self) -> &std::ffi::CStr { + pub fn #param_ident_as_c_str(&self) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.#param_ident) } }); From e6d80badc389d94e2a747f442e5ed4189b66d7d3 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 5 Dec 2023 22:09:44 +0100 Subject: [PATCH 19/23] generator: Apply `must_use` attributes to all Vulkan structs (#845) All structs are marked as `Copy`, and builders move `self` for a convenient builder pattern directly on `default()` (using `&mut` requires requires first keeping the instance alive in a `let` binding). This however leads to builder functions accidentally moving a copy of `self`, mutating it, and dropping the result directly when the caller did not consume the returned value in ad-hoc field updates, in turn leaving the author confused why their code compiles without warnings while the struct was not updated. Annotating all Vulkan structs with `#[must_use]` should at least give them an idea why. --- Changelog.md | 1 + ash/src/vk/definitions.rs | 990 +++++++++++++++++++++++++++++++++++++- generator/src/lib.rs | 17 +- 3 files changed, 999 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index fe6db4d50..91c554707 100644 --- a/Changelog.md +++ b/Changelog.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `VK_NV_cuda_kernel_launch` device extension (#805) - Added `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (#809) - Added `*_as_c_str()` getters for `c_char` pointers and `c_char` arrays (#831) +- Added `#[must_use]` to Vulkan structs to make it more clear that they are moved by the builder pattern (#845) ### Changed diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index c422f9bfb..04df6f53a 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -546,6 +546,7 @@ pub type PFN_vkGetInstanceProcAddrLUNARG = Option< #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BaseOutStructure<'a> { pub s_type: StructureType, pub p_next: *mut Self, @@ -565,6 +566,7 @@ impl ::std::default::Default for BaseOutStructure<'_> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BaseInStructure<'a> { pub s_type: StructureType, pub p_next: *const Self, @@ -584,6 +586,7 @@ impl ::std::default::Default for BaseInStructure<'_> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct Offset2D { pub x: i32, pub y: i32, @@ -604,6 +607,7 @@ impl Offset2D { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct Offset3D { pub x: i32, pub y: i32, @@ -630,6 +634,7 @@ impl Offset3D { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct Extent2D { pub width: u32, pub height: u32, @@ -650,6 +655,7 @@ impl Extent2D { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct Extent3D { pub width: u32, pub height: u32, @@ -676,6 +682,7 @@ impl Extent3D { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct Viewport { pub x: f32, pub y: f32, @@ -720,6 +727,7 @@ impl Viewport { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct Rect2D { pub offset: Offset2D, pub extent: Extent2D, @@ -740,6 +748,7 @@ impl Rect2D { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct ClearRect { pub rect: Rect2D, pub base_array_layer: u32, @@ -766,6 +775,7 @@ impl ClearRect { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ComponentMapping { pub r: ComponentSwizzle, pub g: ComponentSwizzle, @@ -797,6 +807,7 @@ impl ComponentMapping { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProperties { pub api_version: u32, pub driver_version: u32, @@ -898,6 +909,7 @@ impl PhysicalDeviceProperties { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExtensionProperties { pub extension_name: [c_char; MAX_EXTENSION_NAME_SIZE], pub spec_version: u32, @@ -943,6 +955,7 @@ impl ExtensionProperties { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LayerProperties { pub layer_name: [c_char; MAX_EXTENSION_NAME_SIZE], pub spec_version: u32, @@ -1013,6 +1026,7 @@ impl LayerProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ApplicationInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1079,6 +1093,7 @@ impl<'a> ApplicationInfo<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AllocationCallbacks<'a> { pub p_user_data: *mut c_void, pub pfn_allocation: PFN_vkAllocationFunction, @@ -1166,6 +1181,7 @@ impl<'a> AllocationCallbacks<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceQueueCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1229,6 +1245,7 @@ impl<'a> DeviceQueueCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1282,9 +1299,9 @@ impl<'a> DeviceCreateInfo<'a> { self.p_queue_create_infos = queue_create_infos.as_ptr(); self } - #[inline] #[deprecated = "functionality described by this member no longer operates"] #[allow(deprecated)] + #[inline] pub fn enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self { self.enabled_layer_count = enabled_layer_names.len() as _; self.pp_enabled_layer_names = enabled_layer_names.as_ptr(); @@ -1320,6 +1337,7 @@ impl<'a> DeviceCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct InstanceCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1393,6 +1411,7 @@ impl<'a> InstanceCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct QueueFamilyProperties { pub queue_flags: QueueFlags, pub queue_count: u32, @@ -1428,6 +1447,7 @@ impl QueueFamilyProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryProperties { pub memory_type_count: u32, pub memory_types: [MemoryType; MAX_MEMORY_TYPES], @@ -1471,6 +1491,7 @@ impl PhysicalDeviceMemoryProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1524,6 +1545,7 @@ impl<'a> MemoryAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MemoryRequirements { pub size: DeviceSize, pub alignment: DeviceSize, @@ -1550,6 +1572,7 @@ impl MemoryRequirements { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SparseImageFormatProperties { pub aspect_mask: ImageAspectFlags, pub image_granularity: Extent3D, @@ -1576,6 +1599,7 @@ impl SparseImageFormatProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SparseImageMemoryRequirements { pub format_properties: SparseImageFormatProperties, pub image_mip_tail_first_lod: u32, @@ -1614,6 +1638,7 @@ impl SparseImageMemoryRequirements { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MemoryType { pub property_flags: MemoryPropertyFlags, pub heap_index: u32, @@ -1634,6 +1659,7 @@ impl MemoryType { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MemoryHeap { pub size: DeviceSize, pub flags: MemoryHeapFlags, @@ -1654,6 +1680,7 @@ impl MemoryHeap { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MappedMemoryRange<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1699,6 +1726,7 @@ impl<'a> MappedMemoryRange<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct FormatProperties { pub linear_tiling_features: FormatFeatureFlags, pub optimal_tiling_features: FormatFeatureFlags, @@ -1725,6 +1753,7 @@ impl FormatProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageFormatProperties { pub max_extent: Extent3D, pub max_mip_levels: u32, @@ -1763,6 +1792,7 @@ impl ImageFormatProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DescriptorBufferInfo { pub buffer: Buffer, pub offset: DeviceSize, @@ -1789,6 +1819,7 @@ impl DescriptorBufferInfo { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DescriptorImageInfo { pub sampler: Sampler, pub image_view: ImageView, @@ -1815,6 +1846,7 @@ impl DescriptorImageInfo { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct WriteDescriptorSet<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1913,6 +1945,7 @@ impl<'a> WriteDescriptorSet<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyDescriptorSet<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -1986,6 +2019,7 @@ impl<'a> CopyDescriptorSet<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferUsageFlags2CreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2021,6 +2055,7 @@ impl<'a> BufferUsageFlags2CreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2098,6 +2133,7 @@ impl<'a> BufferCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferViewCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2172,6 +2208,7 @@ impl<'a> BufferViewCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageSubresource { pub aspect_mask: ImageAspectFlags, pub mip_level: u32, @@ -2198,6 +2235,7 @@ impl ImageSubresource { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageSubresourceLayers { pub aspect_mask: ImageAspectFlags, pub mip_level: u32, @@ -2230,6 +2268,7 @@ impl ImageSubresourceLayers { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageSubresourceRange { pub aspect_mask: ImageAspectFlags, pub base_mip_level: u32, @@ -2268,6 +2307,7 @@ impl ImageSubresourceRange { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryBarrier<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2306,6 +2346,7 @@ impl<'a> MemoryBarrier<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferMemoryBarrier<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2394,6 +2435,7 @@ impl<'a> BufferMemoryBarrier<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageMemoryBarrier<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2489,6 +2531,7 @@ impl<'a> ImageMemoryBarrier<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2615,6 +2658,7 @@ impl<'a> ImageCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SubresourceLayout { pub offset: DeviceSize, pub size: DeviceSize, @@ -2653,6 +2697,7 @@ impl SubresourceLayout { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -2734,6 +2779,7 @@ impl<'a> ImageViewCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BufferCopy { pub src_offset: DeviceSize, pub dst_offset: DeviceSize, @@ -2760,6 +2806,7 @@ impl BufferCopy { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SparseMemoryBind { pub resource_offset: DeviceSize, pub size: DeviceSize, @@ -2798,6 +2845,7 @@ impl SparseMemoryBind { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SparseImageMemoryBind { pub subresource: ImageSubresource, pub offset: Offset3D, @@ -2842,6 +2890,7 @@ impl SparseImageMemoryBind { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SparseBufferMemoryBindInfo<'a> { pub buffer: Buffer, pub bind_count: u32, @@ -2876,6 +2925,7 @@ impl<'a> SparseBufferMemoryBindInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SparseImageOpaqueMemoryBindInfo<'a> { pub image: Image, pub bind_count: u32, @@ -2910,6 +2960,7 @@ impl<'a> SparseImageOpaqueMemoryBindInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SparseImageMemoryBindInfo<'a> { pub image: Image, pub bind_count: u32, @@ -2944,6 +2995,7 @@ impl<'a> SparseImageMemoryBindInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindSparseInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3036,6 +3088,7 @@ impl<'a> BindSparseInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageCopy { pub src_subresource: ImageSubresourceLayers, pub src_offset: Offset3D, @@ -3074,6 +3127,7 @@ impl ImageCopy { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageBlit { pub src_subresource: ImageSubresourceLayers, pub src_offsets: [Offset3D; 2], @@ -3117,6 +3171,7 @@ impl ImageBlit { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BufferImageCopy { pub buffer_offset: DeviceSize, pub buffer_row_length: u32, @@ -3161,6 +3216,7 @@ impl BufferImageCopy { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct CopyMemoryIndirectCommandNV { pub src_address: DeviceAddress, pub dst_address: DeviceAddress, @@ -3187,6 +3243,7 @@ impl CopyMemoryIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct CopyMemoryToImageIndirectCommandNV { pub src_address: DeviceAddress, pub buffer_row_length: u32, @@ -3231,6 +3288,7 @@ impl CopyMemoryToImageIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ImageResolve { pub src_subresource: ImageSubresourceLayers, pub src_offset: Offset3D, @@ -3269,6 +3327,7 @@ impl ImageResolve { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShaderModuleCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3326,6 +3385,7 @@ impl<'a> ShaderModuleCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetLayoutBinding<'a> { pub binding: u32, pub descriptor_type: DescriptorType, @@ -3379,6 +3439,7 @@ impl<'a> DescriptorSetLayoutBinding<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetLayoutCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3435,6 +3496,7 @@ impl<'a> DescriptorSetLayoutCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DescriptorPoolSize { pub ty: DescriptorType, pub descriptor_count: u32, @@ -3455,6 +3517,7 @@ impl DescriptorPoolSize { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorPoolCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3518,6 +3581,7 @@ impl<'a> DescriptorPoolCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3574,6 +3638,7 @@ impl<'a> DescriptorSetAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SpecializationMapEntry { pub constant_id: u32, pub offset: u32, @@ -3600,6 +3665,7 @@ impl SpecializationMapEntry { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SpecializationInfo<'a> { pub map_entry_count: u32, pub p_map_entries: *const SpecializationMapEntry, @@ -3637,6 +3703,7 @@ impl<'a> SpecializationInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineShaderStageCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3715,6 +3782,7 @@ impl<'a> PipelineShaderStageCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ComputePipelineCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3789,6 +3857,7 @@ impl<'a> ComputePipelineCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ComputePipelineIndirectBufferInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3837,6 +3906,7 @@ impl<'a> ComputePipelineIndirectBufferInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCreateFlags2CreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -3872,6 +3942,7 @@ impl<'a> PipelineCreateFlags2CreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VertexInputBindingDescription { pub binding: u32, pub stride: u32, @@ -3898,6 +3969,7 @@ impl VertexInputBindingDescription { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VertexInputAttributeDescription { pub location: u32, pub binding: u32, @@ -3930,6 +4002,7 @@ impl VertexInputAttributeDescription { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineVertexInputStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4005,6 +4078,7 @@ impl<'a> PipelineVertexInputStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineInputAssemblyStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4050,6 +4124,7 @@ impl<'a> PipelineInputAssemblyStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineTessellationStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4106,6 +4181,7 @@ impl<'a> PipelineTessellationStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4182,6 +4258,7 @@ impl<'a> PipelineViewportStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4301,6 +4378,7 @@ impl<'a> PipelineRasterizationStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineMultisampleStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4401,6 +4479,7 @@ impl<'a> PipelineMultisampleStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PipelineColorBlendAttachmentState { pub blend_enable: Bool32, pub src_color_blend_factor: BlendFactor, @@ -4457,6 +4536,7 @@ impl PipelineColorBlendAttachmentState { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineColorBlendStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4537,6 +4617,7 @@ impl<'a> PipelineColorBlendStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineDynamicStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4578,6 +4659,7 @@ impl<'a> PipelineDynamicStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct StencilOpState { pub fail_op: StencilOp, pub pass_op: StencilOp, @@ -4628,6 +4710,7 @@ impl StencilOpState { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineDepthStencilStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4722,6 +4805,7 @@ impl<'a> PipelineDepthStencilStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GraphicsPipelineCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4900,6 +4984,7 @@ impl<'a> GraphicsPipelineCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCacheCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -4941,6 +5026,7 @@ impl<'a> PipelineCacheCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCacheHeaderVersionOne { pub header_size: u32, pub header_version: PipelineCacheHeaderVersion, @@ -4991,6 +5077,7 @@ impl PipelineCacheHeaderVersionOne { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PushConstantRange { pub stage_flags: ShaderStageFlags, pub offset: u32, @@ -5017,6 +5104,7 @@ impl PushConstantRange { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineLayoutCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5068,6 +5156,7 @@ impl<'a> PipelineLayoutCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5219,6 +5308,7 @@ impl<'a> SamplerCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandPoolCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5257,6 +5347,7 @@ impl<'a> CommandPoolCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5302,6 +5393,7 @@ impl<'a> CommandBufferAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferInheritanceInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5383,6 +5475,7 @@ impl<'a> CommandBufferInheritanceInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5438,6 +5531,7 @@ impl<'a> CommandBufferBeginInfo<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5536,6 +5630,7 @@ impl ::std::default::Default for ClearColorValue { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ClearDepthStencilValue { pub depth: f32, pub stencil: u32, @@ -5568,6 +5663,7 @@ impl ::std::default::Default for ClearValue { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ClearAttachment { pub aspect_mask: ImageAspectFlags, pub color_attachment: u32, @@ -5604,6 +5700,7 @@ impl ClearAttachment { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AttachmentDescription { pub flags: AttachmentDescriptionFlags, pub format: Format, @@ -5666,6 +5763,7 @@ impl AttachmentDescription { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AttachmentReference { pub attachment: u32, pub layout: ImageLayout, @@ -5686,6 +5784,7 @@ impl AttachmentReference { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassDescription<'a> { pub flags: SubpassDescriptionFlags, pub pipeline_bind_point: PipelineBindPoint, @@ -5765,6 +5864,7 @@ impl<'a> SubpassDescription<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SubpassDependency { pub src_subpass: u32, pub dst_subpass: u32, @@ -5815,6 +5915,7 @@ impl SubpassDependency { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5891,6 +5992,7 @@ impl<'a> RenderPassCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct EventCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5937,6 +6039,7 @@ impl<'a> EventCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FenceCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -5983,6 +6086,7 @@ impl<'a> FenceCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFeatures { pub robust_buffer_access: Bool32, pub full_draw_index_uint32: Bool32, @@ -6358,6 +6462,7 @@ impl PhysicalDeviceFeatures { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSparseProperties { pub residency_standard2_d_block_shape: Bool32, pub residency_standard2_d_multisample_block_shape: Bool32, @@ -6406,6 +6511,7 @@ impl PhysicalDeviceSparseProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLimits { pub max_image_dimension1_d: u32, pub max_image_dimension2_d: u32, @@ -7295,6 +7401,7 @@ impl PhysicalDeviceLimits { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -7341,6 +7448,7 @@ impl<'a> SemaphoreCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueryPoolCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -7408,6 +7516,7 @@ impl<'a> QueryPoolCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FramebufferCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -7497,6 +7606,7 @@ impl<'a> FramebufferCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrawIndirectCommand { pub vertex_count: u32, pub instance_count: u32, @@ -7529,6 +7639,7 @@ impl DrawIndirectCommand { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrawIndexedIndirectCommand { pub index_count: u32, pub instance_count: u32, @@ -7567,6 +7678,7 @@ impl DrawIndexedIndirectCommand { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DispatchIndirectCommand { pub x: u32, pub y: u32, @@ -7593,6 +7705,7 @@ impl DispatchIndirectCommand { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MultiDrawInfoEXT { pub first_vertex: u32, pub vertex_count: u32, @@ -7613,6 +7726,7 @@ impl MultiDrawInfoEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MultiDrawIndexedInfoEXT { pub first_index: u32, pub index_count: u32, @@ -7639,6 +7753,7 @@ impl MultiDrawIndexedInfoEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -7716,6 +7831,7 @@ impl<'a> SubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPropertiesKHR<'a> { pub display: DisplayKHR, pub display_name: *const c_char, @@ -7786,6 +7902,7 @@ impl<'a> DisplayPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DisplayPlanePropertiesKHR { pub current_display: DisplayKHR, pub current_stack_index: u32, @@ -7806,6 +7923,7 @@ impl DisplayPlanePropertiesKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DisplayModeParametersKHR { pub visible_region: Extent2D, pub refresh_rate: u32, @@ -7826,6 +7944,7 @@ impl DisplayModeParametersKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DisplayModePropertiesKHR { pub display_mode: DisplayModeKHR, pub parameters: DisplayModeParametersKHR, @@ -7846,6 +7965,7 @@ impl DisplayModePropertiesKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayModeCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -7884,6 +8004,7 @@ impl<'a> DisplayModeCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DisplayPlaneCapabilitiesKHR { pub supported_alpha: DisplayPlaneAlphaFlagsKHR, pub min_src_position: Offset2D, @@ -7946,6 +8067,7 @@ impl DisplayPlaneCapabilitiesKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplaySurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8026,6 +8148,7 @@ impl<'a> DisplaySurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPresentInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8072,6 +8195,7 @@ impl<'a> DisplayPresentInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SurfaceCapabilitiesKHR { pub min_image_count: u32, pub max_image_count: u32, @@ -8143,6 +8267,7 @@ impl SurfaceCapabilitiesKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidSurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8181,6 +8306,7 @@ impl<'a> AndroidSurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ViSurfaceCreateInfoNN<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8219,6 +8345,7 @@ impl<'a> ViSurfaceCreateInfoNN<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct WaylandSurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8264,6 +8391,7 @@ impl<'a> WaylandSurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct Win32SurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8309,6 +8437,7 @@ impl<'a> Win32SurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct XlibSurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8354,6 +8483,7 @@ impl<'a> XlibSurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct XcbSurfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8399,6 +8529,7 @@ impl<'a> XcbSurfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DirectFBSurfaceCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8444,6 +8575,7 @@ impl<'a> DirectFBSurfaceCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImagePipeSurfaceCreateInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8482,6 +8614,7 @@ impl<'a> ImagePipeSurfaceCreateInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct StreamDescriptorSurfaceCreateInfoGGP<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8520,6 +8653,7 @@ impl<'a> StreamDescriptorSurfaceCreateInfoGGP<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ScreenSurfaceCreateInfoQNX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8565,6 +8699,7 @@ impl<'a> ScreenSurfaceCreateInfoQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[doc = ""] +#[must_use] pub struct SurfaceFormatKHR { pub format: Format, pub color_space: ColorSpaceKHR, @@ -8585,6 +8720,7 @@ impl SurfaceFormatKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8732,6 +8868,7 @@ impl<'a> SwapchainCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8806,6 +8943,7 @@ impl<'a> PresentInfoKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugReportCallbackCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8864,6 +9002,7 @@ impl<'a> DebugReportCallbackCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ValidationFlagsEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8902,6 +9041,7 @@ impl<'a> ValidationFlagsEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ValidationFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8953,6 +9093,7 @@ impl<'a> ValidationFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationStateRasterizationOrderAMD<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -8989,6 +9130,7 @@ impl<'a> PipelineRasterizationStateRasterizationOrderAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugMarkerObjectNameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9038,6 +9180,7 @@ impl<'a> DebugMarkerObjectNameInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugMarkerObjectTagInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9093,6 +9236,7 @@ impl<'a> DebugMarkerObjectTagInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugMarkerMarkerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9135,6 +9279,7 @@ impl<'a> DebugMarkerMarkerInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DedicatedAllocationImageCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9167,6 +9312,7 @@ impl<'a> DedicatedAllocationImageCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DedicatedAllocationBufferCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9199,6 +9345,7 @@ impl<'a> DedicatedAllocationBufferCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DedicatedAllocationMemoryAllocateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9239,6 +9386,7 @@ impl<'a> DedicatedAllocationMemoryAllocateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ExternalImageFormatPropertiesNV { pub image_format_properties: ImageFormatProperties, pub external_memory_features: ExternalMemoryFeatureFlagsNV, @@ -9283,6 +9431,7 @@ impl ExternalImageFormatPropertiesNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalMemoryImageCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9315,6 +9464,7 @@ impl<'a> ExternalMemoryImageCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMemoryAllocateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9347,6 +9497,7 @@ impl<'a> ExportMemoryAllocateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryWin32HandleInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9386,6 +9537,7 @@ impl<'a> ImportMemoryWin32HandleInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMemoryWin32HandleInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9425,6 +9577,7 @@ impl<'a> ExportMemoryWin32HandleInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct Win32KeyedMutexAcquireReleaseInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9495,6 +9648,7 @@ impl<'a> Win32KeyedMutexAcquireReleaseInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -9529,6 +9683,7 @@ impl<'a> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -9587,6 +9742,7 @@ impl<'a> PhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DevicePrivateDataCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9619,6 +9775,7 @@ impl<'a> DevicePrivateDataCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PrivateDataSlotCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9650,6 +9807,7 @@ impl<'a> PrivateDataSlotCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePrivateDataFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -9683,6 +9841,7 @@ impl<'a> PhysicalDevicePrivateDataFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -9799,6 +9958,7 @@ impl<'a> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiDrawPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -9831,6 +9991,7 @@ impl<'a> PhysicalDeviceMultiDrawPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GraphicsShaderGroupCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9885,6 +10046,7 @@ impl<'a> GraphicsShaderGroupCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GraphicsPipelineShaderGroupsCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -9931,6 +10093,7 @@ impl<'a> GraphicsPipelineShaderGroupsCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BindShaderGroupIndirectCommandNV { pub group_index: u32, } @@ -9945,6 +10108,7 @@ impl BindShaderGroupIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BindIndexBufferIndirectCommandNV { pub buffer_address: DeviceAddress, pub size: u32, @@ -9971,6 +10135,7 @@ impl BindIndexBufferIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BindVertexBufferIndirectCommandNV { pub buffer_address: DeviceAddress, pub size: u32, @@ -9997,6 +10162,7 @@ impl BindVertexBufferIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SetStateFlagsIndirectCommandNV { pub data: u32, } @@ -10011,6 +10177,7 @@ impl SetStateFlagsIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct IndirectCommandsStreamNV { pub buffer: Buffer, pub offset: DeviceSize, @@ -10031,6 +10198,7 @@ impl IndirectCommandsStreamNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct IndirectCommandsLayoutTokenNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10149,6 +10317,7 @@ impl<'a> IndirectCommandsLayoutTokenNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct IndirectCommandsLayoutCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10207,6 +10376,7 @@ impl<'a> IndirectCommandsLayoutCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GeneratedCommandsInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10321,6 +10491,7 @@ impl<'a> GeneratedCommandsInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GeneratedCommandsMemoryRequirementsInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10377,6 +10548,7 @@ impl<'a> GeneratedCommandsMemoryRequirementsInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineIndirectDeviceAddressInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10415,6 +10587,7 @@ impl<'a> PipelineIndirectDeviceAddressInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct BindPipelineIndirectCommandNV { pub pipeline_address: DeviceAddress, } @@ -10429,6 +10602,7 @@ impl BindPipelineIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFeatures2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10476,6 +10650,7 @@ impl<'a> PhysicalDeviceFeatures2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10522,6 +10697,7 @@ impl<'a> PhysicalDeviceProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FormatProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10568,6 +10744,7 @@ impl<'a> FormatProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageFormatProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10617,6 +10794,7 @@ impl<'a> ImageFormatProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageFormatInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10691,6 +10869,7 @@ impl<'a> PhysicalDeviceImageFormatInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10740,6 +10919,7 @@ impl<'a> QueueFamilyProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10786,6 +10966,7 @@ impl<'a> PhysicalDeviceMemoryProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SparseImageFormatProperties2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10817,6 +10998,7 @@ impl<'a> SparseImageFormatProperties2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSparseImageFormatInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -10876,6 +11058,7 @@ impl<'a> PhysicalDeviceSparseImageFormatInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePushDescriptorPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -10909,6 +11092,7 @@ impl<'a> PhysicalDevicePushDescriptorPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ConformanceVersion { pub major: u8, pub minor: u8, @@ -10940,6 +11124,7 @@ impl ConformanceVersion { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDriverProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11022,6 +11207,7 @@ impl<'a> PhysicalDeviceDriverProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentRegionsKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11057,6 +11243,7 @@ impl<'a> PresentRegionsKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentRegionKHR<'a> { pub rectangle_count: u32, pub p_rectangles: *const RectLayerKHR, @@ -11084,6 +11271,7 @@ impl<'a> PresentRegionKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct RectLayerKHR { pub offset: Offset2D, pub extent: Extent2D, @@ -11110,6 +11298,7 @@ impl RectLayerKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVariablePointersFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11153,6 +11342,7 @@ impl<'a> PhysicalDeviceVariablePointersFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ExternalMemoryProperties { pub external_memory_features: ExternalMemoryFeatureFlags, pub export_from_imported_handle_types: ExternalMemoryHandleTypeFlags, @@ -11188,6 +11378,7 @@ impl ExternalMemoryProperties { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalImageFormatInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11220,6 +11411,7 @@ impl<'a> PhysicalDeviceExternalImageFormatInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalImageFormatProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11255,6 +11447,7 @@ impl<'a> ExternalImageFormatProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalBufferInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11318,6 +11511,7 @@ impl<'a> PhysicalDeviceExternalBufferInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalBufferProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11352,6 +11546,7 @@ impl<'a> ExternalBufferProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceIDProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11412,6 +11607,7 @@ impl<'a> PhysicalDeviceIDProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalMemoryImageCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11444,6 +11640,7 @@ impl<'a> ExternalMemoryImageCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalMemoryBufferCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11476,6 +11673,7 @@ impl<'a> ExternalMemoryBufferCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMemoryAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11508,6 +11706,7 @@ impl<'a> ExportMemoryAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11554,6 +11753,7 @@ impl<'a> ImportMemoryWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMemoryWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11600,6 +11800,7 @@ impl<'a> ExportMemoryWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryZirconHandleInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11639,6 +11840,7 @@ impl<'a> ImportMemoryZirconHandleInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryZirconHandlePropertiesFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11670,6 +11872,7 @@ impl<'a> MemoryZirconHandlePropertiesFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryGetZirconHandleInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11708,6 +11911,7 @@ impl<'a> MemoryGetZirconHandleInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryWin32HandlePropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11739,6 +11943,7 @@ impl<'a> MemoryWin32HandlePropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryGetWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11777,6 +11982,7 @@ impl<'a> MemoryGetWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11816,6 +12022,7 @@ impl<'a> ImportMemoryFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryFdPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -11847,6 +12054,7 @@ impl<'a> MemoryFdPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryGetFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11885,6 +12093,7 @@ impl<'a> MemoryGetFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct Win32KeyedMutexAcquireReleaseInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -11955,6 +12164,7 @@ impl<'a> Win32KeyedMutexAcquireReleaseInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalSemaphoreInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12004,6 +12214,7 @@ impl<'a> PhysicalDeviceExternalSemaphoreInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalSemaphoreProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12058,6 +12269,7 @@ impl<'a> ExternalSemaphoreProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportSemaphoreCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12090,6 +12302,7 @@ impl<'a> ExportSemaphoreCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportSemaphoreWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12149,6 +12362,7 @@ impl<'a> ImportSemaphoreWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportSemaphoreWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12195,6 +12409,7 @@ impl<'a> ExportSemaphoreWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct D3D12FenceSubmitInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12240,6 +12455,7 @@ impl<'a> D3D12FenceSubmitInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreGetWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12278,6 +12494,7 @@ impl<'a> SemaphoreGetWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportSemaphoreFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12330,6 +12547,7 @@ impl<'a> ImportSemaphoreFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreGetFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12368,6 +12586,7 @@ impl<'a> SemaphoreGetFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportSemaphoreZirconHandleInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12421,6 +12640,7 @@ impl<'a> ImportSemaphoreZirconHandleInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreGetZirconHandleInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12459,6 +12679,7 @@ impl<'a> SemaphoreGetZirconHandleInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalFenceInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12490,6 +12711,7 @@ impl<'a> PhysicalDeviceExternalFenceInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalFenceProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12544,6 +12766,7 @@ impl<'a> ExternalFenceProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportFenceCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12576,6 +12799,7 @@ impl<'a> ExportFenceCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportFenceWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12635,6 +12859,7 @@ impl<'a> ImportFenceWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportFenceWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12681,6 +12906,7 @@ impl<'a> ExportFenceWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FenceGetWin32HandleInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12719,6 +12945,7 @@ impl<'a> FenceGetWin32HandleInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportFenceFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12771,6 +12998,7 @@ impl<'a> ImportFenceFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FenceGetFdInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12809,6 +13037,7 @@ impl<'a> FenceGetFdInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiviewFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12856,6 +13085,7 @@ impl<'a> PhysicalDeviceMultiviewFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiviewProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12895,6 +13125,7 @@ impl<'a> PhysicalDeviceMultiviewProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassMultiviewCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -12950,6 +13181,7 @@ impl<'a> RenderPassMultiviewCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceCapabilities2EXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13057,6 +13289,7 @@ impl<'a> SurfaceCapabilities2EXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPowerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13088,6 +13321,7 @@ impl<'a> DisplayPowerInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceEventInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13119,6 +13353,7 @@ impl<'a> DeviceEventInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayEventInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13150,6 +13385,7 @@ impl<'a> DisplayEventInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainCounterCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13182,6 +13418,7 @@ impl<'a> SwapchainCounterCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceGroupProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13230,6 +13467,7 @@ impl<'a> PhysicalDeviceGroupProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryAllocateFlagsInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13269,6 +13507,7 @@ impl<'a> MemoryAllocateFlagsInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindBufferMemoryInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13329,6 +13568,7 @@ impl<'a> BindBufferMemoryInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindBufferMemoryDeviceGroupInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13364,6 +13604,7 @@ impl<'a> BindBufferMemoryDeviceGroupInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindImageMemoryInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13424,6 +13665,7 @@ impl<'a> BindImageMemoryInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindImageMemoryDeviceGroupInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13472,6 +13714,7 @@ impl<'a> BindImageMemoryDeviceGroupInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupRenderPassBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13515,6 +13758,7 @@ impl<'a> DeviceGroupRenderPassBeginInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupCommandBufferBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13547,6 +13791,7 @@ impl<'a> DeviceGroupCommandBufferBeginInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupSubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13608,6 +13853,7 @@ impl<'a> DeviceGroupSubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupBindSparseInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13647,6 +13893,7 @@ impl<'a> DeviceGroupBindSparseInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupPresentCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13685,6 +13932,7 @@ impl<'a> DeviceGroupPresentCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageSwapchainCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13717,6 +13965,7 @@ impl<'a> ImageSwapchainCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindImageMemorySwapchainInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13756,6 +14005,7 @@ impl<'a> BindImageMemorySwapchainInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AcquireNextImageInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13815,6 +14065,7 @@ impl<'a> AcquireNextImageInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupPresentInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13857,6 +14108,7 @@ impl<'a> DeviceGroupPresentInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupDeviceCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13892,6 +14144,7 @@ impl<'a> DeviceGroupDeviceCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceGroupSwapchainCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -13924,6 +14177,7 @@ impl<'a> DeviceGroupSwapchainCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DescriptorUpdateTemplateEntry { pub dst_binding: u32, pub dst_array_element: u32, @@ -13968,6 +14222,7 @@ impl DescriptorUpdateTemplateEntry { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorUpdateTemplateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14047,6 +14302,7 @@ impl<'a> DescriptorUpdateTemplateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct XYColorEXT { pub x: f32, pub y: f32, @@ -14067,6 +14323,7 @@ impl XYColorEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePresentIdFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14100,6 +14357,7 @@ impl<'a> PhysicalDevicePresentIdFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentIdKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14135,6 +14393,7 @@ impl<'a> PresentIdKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePresentWaitFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14168,6 +14427,7 @@ impl<'a> PhysicalDevicePresentWaitFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct HdrMetadataEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14248,6 +14508,7 @@ impl<'a> HdrMetadataEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayNativeHdrSurfaceCapabilitiesAMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14281,6 +14542,7 @@ impl<'a> DisplayNativeHdrSurfaceCapabilitiesAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainDisplayNativeHdrCreateInfoAMD<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14314,6 +14576,7 @@ impl<'a> SwapchainDisplayNativeHdrCreateInfoAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct RefreshCycleDurationGOOGLE { pub refresh_duration: u64, } @@ -14328,6 +14591,7 @@ impl RefreshCycleDurationGOOGLE { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PastPresentationTimingGOOGLE { pub present_id: u32, pub desired_present_time: u64, @@ -14366,6 +14630,7 @@ impl PastPresentationTimingGOOGLE { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentTimesInfoGOOGLE<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14401,6 +14666,7 @@ impl<'a> PresentTimesInfoGOOGLE<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PresentTimeGOOGLE { pub present_id: u32, pub desired_present_time: u64, @@ -14421,6 +14687,7 @@ impl PresentTimeGOOGLE { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct IOSSurfaceCreateInfoMVK<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14459,6 +14726,7 @@ impl<'a> IOSSurfaceCreateInfoMVK<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MacOSSurfaceCreateInfoMVK<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14497,6 +14765,7 @@ impl<'a> MacOSSurfaceCreateInfoMVK<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MetalSurfaceCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14535,6 +14804,7 @@ impl<'a> MetalSurfaceCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ViewportWScalingNV { pub xcoeff: f32, pub ycoeff: f32, @@ -14555,6 +14825,7 @@ impl ViewportWScalingNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportWScalingStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14601,6 +14872,7 @@ impl<'a> PipelineViewportWScalingStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ViewportSwizzleNV { pub x: ViewportCoordinateSwizzleNV, pub y: ViewportCoordinateSwizzleNV, @@ -14633,6 +14905,7 @@ impl ViewportSwizzleNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportSwizzleStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14679,6 +14952,7 @@ impl<'a> PipelineViewportSwizzleStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDiscardRectanglePropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14712,6 +14986,7 @@ impl<'a> PhysicalDeviceDiscardRectanglePropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineDiscardRectangleStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14765,6 +15040,7 @@ impl<'a> PipelineDiscardRectangleStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14804,6 +15080,7 @@ impl<'a> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct InputAttachmentAspectReference { pub subpass: u32, pub input_attachment_index: u32, @@ -14830,6 +15107,7 @@ impl InputAttachmentAspectReference { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassInputAttachmentAspectCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14869,6 +15147,7 @@ impl<'a> RenderPassInputAttachmentAspectCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSurfaceInfo2KHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -14915,6 +15194,7 @@ impl<'a> PhysicalDeviceSurfaceInfo2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceCapabilities2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14961,6 +15241,7 @@ impl<'a> SurfaceCapabilities2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceFormat2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15007,6 +15288,7 @@ impl<'a> SurfaceFormat2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayProperties2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15038,6 +15320,7 @@ impl<'a> DisplayProperties2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPlaneProperties2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15072,6 +15355,7 @@ impl<'a> DisplayPlaneProperties2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayModeProperties2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15106,6 +15390,7 @@ impl<'a> DisplayModeProperties2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPlaneInfo2KHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15144,6 +15429,7 @@ impl<'a> DisplayPlaneInfo2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DisplayPlaneCapabilities2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15175,6 +15461,7 @@ impl<'a> DisplayPlaneCapabilities2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SharedPresentSurfaceCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15210,6 +15497,7 @@ impl<'a> SharedPresentSurfaceCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevice16BitStorageFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15268,6 +15556,7 @@ impl<'a> PhysicalDevice16BitStorageFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubgroupProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15321,6 +15610,7 @@ impl<'a> PhysicalDeviceSubgroupProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15358,6 +15648,7 @@ impl<'a> PhysicalDeviceShaderSubgroupExtendedTypesFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferMemoryRequirementsInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15389,6 +15680,7 @@ impl<'a> BufferMemoryRequirementsInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceBufferMemoryRequirements<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15420,6 +15712,7 @@ impl<'a> DeviceBufferMemoryRequirements<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageMemoryRequirementsInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15466,6 +15759,7 @@ impl<'a> ImageMemoryRequirementsInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageSparseMemoryRequirementsInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15497,6 +15791,7 @@ impl<'a> ImageSparseMemoryRequirementsInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceImageMemoryRequirements<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15535,6 +15830,7 @@ impl<'a> DeviceImageMemoryRequirements<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryRequirements2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15581,6 +15877,7 @@ impl<'a> MemoryRequirements2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SparseImageMemoryRequirements2<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15615,6 +15912,7 @@ impl<'a> SparseImageMemoryRequirements2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePointClippingProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15650,6 +15948,7 @@ impl<'a> PhysicalDevicePointClippingProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryDedicatedRequirements<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15689,6 +15988,7 @@ impl<'a> MemoryDedicatedRequirements<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryDedicatedAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15728,6 +16028,7 @@ impl<'a> MemoryDedicatedAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewUsageCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15760,6 +16061,7 @@ impl<'a> ImageViewUsageCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewSlicedCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15799,6 +16101,7 @@ impl<'a> ImageViewSlicedCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineTessellationDomainOriginStateCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15835,6 +16138,7 @@ impl<'a> PipelineTessellationDomainOriginStateCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerYcbcrConversionInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15868,6 +16172,7 @@ impl<'a> SamplerYcbcrConversionInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerYcbcrConversionCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15966,6 +16271,7 @@ impl<'a> SamplerYcbcrConversionCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindImagePlaneMemoryInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -15998,6 +16304,7 @@ impl<'a> BindImagePlaneMemoryInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImagePlaneMemoryRequirementsInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16030,6 +16337,7 @@ impl<'a> ImagePlaneMemoryRequirementsInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSamplerYcbcrConversionFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16064,6 +16372,7 @@ impl<'a> PhysicalDeviceSamplerYcbcrConversionFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerYcbcrConversionImageFormatProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16100,6 +16409,7 @@ impl<'a> SamplerYcbcrConversionImageFormatProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct TextureLODGatherFormatPropertiesAMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16135,6 +16445,7 @@ impl<'a> TextureLODGatherFormatPropertiesAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ConditionalRenderingBeginInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16180,6 +16491,7 @@ impl<'a> ConditionalRenderingBeginInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ProtectedSubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16212,6 +16524,7 @@ impl<'a> ProtectedSubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProtectedMemoryFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16245,6 +16558,7 @@ impl<'a> PhysicalDeviceProtectedMemoryFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProtectedMemoryProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16278,6 +16592,7 @@ impl<'a> PhysicalDeviceProtectedMemoryProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceQueueInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16323,6 +16638,7 @@ impl<'a> DeviceQueueInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCoverageToColorStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16373,6 +16689,7 @@ impl<'a> PipelineCoverageToColorStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSamplerFilterMinmaxProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16419,6 +16736,7 @@ impl<'a> PhysicalDeviceSamplerFilterMinmaxProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SampleLocationEXT { pub x: f32, pub y: f32, @@ -16439,6 +16757,7 @@ impl SampleLocationEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SampleLocationsInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16492,6 +16811,7 @@ impl<'a> SampleLocationsInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AttachmentSampleLocationsEXT<'a> { pub attachment_index: u32, pub sample_locations_info: SampleLocationsInfoEXT<'a>, @@ -16516,6 +16836,7 @@ impl<'a> AttachmentSampleLocationsEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SubpassSampleLocationsEXT<'a> { pub subpass_index: u32, pub sample_locations_info: SampleLocationsInfoEXT<'a>, @@ -16540,6 +16861,7 @@ impl<'a> SubpassSampleLocationsEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassSampleLocationsBeginInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16593,6 +16915,7 @@ impl<'a> RenderPassSampleLocationsBeginInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineSampleLocationsStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16639,6 +16962,7 @@ impl<'a> PipelineSampleLocationsStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSampleLocationsPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16709,6 +17033,7 @@ impl<'a> PhysicalDeviceSampleLocationsPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MultisamplePropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16743,6 +17068,7 @@ impl<'a> MultisamplePropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerReductionModeCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16775,6 +17101,7 @@ impl<'a> SamplerReductionModeCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16812,6 +17139,7 @@ impl<'a> PhysicalDeviceBlendOperationAdvancedFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiDrawFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16845,6 +17173,7 @@ impl<'a> PhysicalDeviceMultiDrawFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16933,6 +17262,7 @@ impl<'a> PhysicalDeviceBlendOperationAdvancedPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineColorBlendAdvancedStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -16983,6 +17313,7 @@ impl<'a> PipelineColorBlendAdvancedStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceInlineUniformBlockFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17028,6 +17359,7 @@ impl<'a> PhysicalDeviceInlineUniformBlockFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceInlineUniformBlockProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17104,6 +17436,7 @@ impl<'a> PhysicalDeviceInlineUniformBlockProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct WriteDescriptorSetInlineUniformBlock<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17139,6 +17472,7 @@ impl<'a> WriteDescriptorSetInlineUniformBlock<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorPoolInlineUniformBlockCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17175,6 +17509,7 @@ impl<'a> DescriptorPoolInlineUniformBlockCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCoverageModulationStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17241,6 +17576,7 @@ impl<'a> PipelineCoverageModulationStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageFormatListCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17278,6 +17614,7 @@ impl<'a> ImageFormatListCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ValidationCacheCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17319,6 +17656,7 @@ impl<'a> ValidationCacheCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShaderModuleValidationCacheCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17353,6 +17691,7 @@ impl<'a> ShaderModuleValidationCacheCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMaintenance3Properties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17392,6 +17731,7 @@ impl<'a> PhysicalDeviceMaintenance3Properties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMaintenance4Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17425,6 +17765,7 @@ impl<'a> PhysicalDeviceMaintenance4Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMaintenance4Properties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17457,6 +17798,7 @@ impl<'a> PhysicalDeviceMaintenance4Properties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMaintenance5FeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17490,6 +17832,7 @@ impl<'a> PhysicalDeviceMaintenance5FeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMaintenance5PropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17577,6 +17920,7 @@ impl<'a> PhysicalDeviceMaintenance5PropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderingAreaInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -17632,6 +17976,7 @@ impl<'a> RenderingAreaInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetLayoutSupport<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17678,6 +18023,7 @@ impl<'a> DescriptorSetLayoutSupport<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderDrawParametersFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17712,6 +18058,7 @@ impl<'a> PhysicalDeviceShaderDrawParametersFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderFloat16Int8Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17753,6 +18100,7 @@ impl<'a> PhysicalDeviceShaderFloat16Int8Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFloatControlsProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17942,6 +18290,7 @@ impl<'a> PhysicalDeviceFloatControlsProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceHostQueryResetFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17975,6 +18324,7 @@ impl<'a> PhysicalDeviceHostQueryResetFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct NativeBufferUsage2ANDROID { pub consumer: u64, pub producer: u64, @@ -17995,6 +18345,7 @@ impl NativeBufferUsage2ANDROID { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct NativeBufferANDROID<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18054,6 +18405,7 @@ impl<'a> NativeBufferANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainImageCreateInfoANDROID<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18085,6 +18437,7 @@ impl<'a> SwapchainImageCreateInfoANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePresentationPropertiesANDROID<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18117,6 +18470,7 @@ impl<'a> PhysicalDevicePresentationPropertiesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ShaderResourceUsageAMD { pub num_used_vgprs: u32, pub num_used_sgprs: u32, @@ -18155,6 +18509,7 @@ impl ShaderResourceUsageAMD { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShaderStatisticsInfoAMD { pub shader_stage_mask: ShaderStageFlags, pub resource_usage: ShaderResourceUsageAMD, @@ -18219,6 +18574,7 @@ impl ShaderStatisticsInfoAMD { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceQueueGlobalPriorityCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18252,6 +18608,7 @@ impl<'a> DeviceQueueGlobalPriorityCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceGlobalPriorityQueryFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18286,6 +18643,7 @@ impl<'a> PhysicalDeviceGlobalPriorityQueryFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyGlobalPriorityPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18329,6 +18687,7 @@ impl<'a> QueueFamilyGlobalPriorityPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugUtilsObjectNameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18375,6 +18734,7 @@ impl<'a> DebugUtilsObjectNameInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugUtilsObjectTagInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18426,6 +18786,7 @@ impl<'a> DebugUtilsObjectTagInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugUtilsLabelEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18467,6 +18828,7 @@ impl<'a> DebugUtilsLabelEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugUtilsMessengerCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18547,6 +18909,7 @@ impl<'a> DebugUtilsMessengerCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DebugUtilsMessengerCallbackDataEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18655,6 +19018,7 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDeviceMemoryReportFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18688,6 +19052,7 @@ impl<'a> PhysicalDeviceDeviceMemoryReportFeaturesEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceDeviceMemoryReportCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18753,6 +19118,7 @@ impl<'a> DeviceDeviceMemoryReportCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceMemoryReportCallbackDataEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18822,6 +19188,7 @@ impl<'a> DeviceMemoryReportCallbackDataEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryHostPointerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -18861,6 +19228,7 @@ impl<'a> ImportMemoryHostPointerInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryHostPointerPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18892,6 +19260,7 @@ impl<'a> MemoryHostPointerPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalMemoryHostPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18928,6 +19297,7 @@ impl<'a> PhysicalDeviceExternalMemoryHostPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceConservativeRasterizationPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19042,6 +19412,7 @@ impl<'a> PhysicalDeviceConservativeRasterizationPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CalibratedTimestampInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -19073,6 +19444,7 @@ impl<'a> CalibratedTimestampInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderCorePropertiesAMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19196,6 +19568,7 @@ impl<'a> PhysicalDeviceShaderCorePropertiesAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderCoreProperties2AMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19239,6 +19612,7 @@ impl<'a> PhysicalDeviceShaderCoreProperties2AMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationConservativeStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -19295,6 +19669,7 @@ impl<'a> PipelineRasterizationConservativeStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorIndexingFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19537,6 +19912,7 @@ impl<'a> PhysicalDeviceDescriptorIndexingFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorIndexingProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19810,6 +20186,7 @@ impl<'a> PhysicalDeviceDescriptorIndexingProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetLayoutBindingFlagsCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -19846,6 +20223,7 @@ impl<'a> DescriptorSetLayoutBindingFlagsCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetVariableDescriptorCountAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -19885,6 +20263,7 @@ impl<'a> DescriptorSetVariableDescriptorCountAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetVariableDescriptorCountLayoutSupport<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19921,6 +20300,7 @@ impl<'a> DescriptorSetVariableDescriptorCountLayoutSupport<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AttachmentDescription2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20023,6 +20403,7 @@ impl<'a> AttachmentDescription2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AttachmentReference2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20083,6 +20464,7 @@ impl<'a> AttachmentReference2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassDescription2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20194,6 +20576,7 @@ impl<'a> SubpassDescription2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassDependency2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20289,6 +20672,7 @@ impl<'a> SubpassDependency2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassCreateInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20375,6 +20759,7 @@ impl<'a> RenderPassCreateInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20406,6 +20791,7 @@ impl<'a> SubpassBeginInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassEndInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20445,6 +20831,7 @@ impl<'a> SubpassEndInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTimelineSemaphoreFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20479,6 +20866,7 @@ impl<'a> PhysicalDeviceTimelineSemaphoreFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTimelineSemaphoreProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20515,6 +20903,7 @@ impl<'a> PhysicalDeviceTimelineSemaphoreProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreTypeCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20555,6 +20944,7 @@ impl<'a> SemaphoreTypeCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct TimelineSemaphoreSubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20601,6 +20991,7 @@ impl<'a> TimelineSemaphoreSubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreWaitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20650,6 +21041,7 @@ impl<'a> SemaphoreWaitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreSignalInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20688,6 +21080,7 @@ impl<'a> SemaphoreSignalInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VertexInputBindingDivisorDescriptionEXT { pub binding: u32, pub divisor: u32, @@ -20708,6 +21101,7 @@ impl VertexInputBindingDivisorDescriptionEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineVertexInputDivisorStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20750,6 +21144,7 @@ impl<'a> PipelineVertexInputDivisorStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20786,6 +21181,7 @@ impl<'a> PhysicalDeviceVertexAttributeDivisorPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePCIBusInfoPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20840,6 +21236,7 @@ impl<'a> PhysicalDevicePCIBusInfoPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportAndroidHardwareBufferInfoANDROID<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20873,6 +21270,7 @@ impl<'a> ImportAndroidHardwareBufferInfoANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidHardwareBufferUsageANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20905,6 +21303,7 @@ impl<'a> AndroidHardwareBufferUsageANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidHardwareBufferPropertiesANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20961,6 +21360,7 @@ impl<'a> AndroidHardwareBufferPropertiesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryGetAndroidHardwareBufferInfoANDROID<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -20993,6 +21393,7 @@ impl<'a> MemoryGetAndroidHardwareBufferInfoANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidHardwareBufferFormatPropertiesANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21084,6 +21485,7 @@ impl<'a> AndroidHardwareBufferFormatPropertiesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferInheritanceConditionalRenderingInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -21120,6 +21522,7 @@ impl<'a> CommandBufferInheritanceConditionalRenderingInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalFormatANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21156,6 +21559,7 @@ impl<'a> ExternalFormatANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevice8BitStorageFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21206,6 +21610,7 @@ impl<'a> PhysicalDevice8BitStorageFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceConditionalRenderingFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21250,6 +21655,7 @@ impl<'a> PhysicalDeviceConditionalRenderingFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkanMemoryModelFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21305,6 +21711,7 @@ impl<'a> PhysicalDeviceVulkanMemoryModelFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderAtomicInt64Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21346,6 +21753,7 @@ impl<'a> PhysicalDeviceShaderAtomicInt64Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderAtomicFloatFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21475,6 +21883,7 @@ impl<'a> PhysicalDeviceShaderAtomicFloatFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21616,6 +22025,7 @@ impl<'a> PhysicalDeviceShaderAtomicFloat2FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21664,6 +22074,7 @@ impl<'a> PhysicalDeviceVertexAttributeDivisorFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyCheckpointPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21699,6 +22110,7 @@ impl<'a> QueueFamilyCheckpointPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CheckpointDataNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21737,6 +22149,7 @@ impl<'a> CheckpointDataNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDepthStencilResolveProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21797,6 +22210,7 @@ impl<'a> PhysicalDeviceDepthStencilResolveProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassDescriptionDepthStencilResolve<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -21846,6 +22260,7 @@ impl<'a> SubpassDescriptionDepthStencilResolve<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewASTCDecodeModeEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -21878,6 +22293,7 @@ impl<'a> ImageViewASTCDecodeModeEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceASTCDecodeFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21911,6 +22327,7 @@ impl<'a> PhysicalDeviceASTCDecodeFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTransformFeedbackFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21952,6 +22369,7 @@ impl<'a> PhysicalDeviceTransformFeedbackFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTransformFeedbackPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22068,6 +22486,7 @@ impl<'a> PhysicalDeviceTransformFeedbackPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationStateStreamCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -22111,6 +22530,7 @@ impl<'a> PipelineRasterizationStateStreamCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22148,6 +22568,7 @@ impl<'a> PhysicalDeviceRepresentativeFragmentTestFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRepresentativeFragmentTestStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -22187,6 +22608,7 @@ impl<'a> PipelineRepresentativeFragmentTestStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExclusiveScissorFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22221,6 +22643,7 @@ impl<'a> PhysicalDeviceExclusiveScissorFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportExclusiveScissorStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -22260,6 +22683,7 @@ impl<'a> PipelineViewportExclusiveScissorStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCornerSampledImageFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22294,6 +22718,7 @@ impl<'a> PhysicalDeviceCornerSampledImageFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceComputeShaderDerivativesFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22341,6 +22766,7 @@ impl<'a> PhysicalDeviceComputeShaderDerivativesFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderImageFootprintFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22375,6 +22801,7 @@ impl<'a> PhysicalDeviceShaderImageFootprintFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22418,6 +22845,7 @@ impl<'a> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCopyMemoryIndirectFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22452,6 +22880,7 @@ impl<'a> PhysicalDeviceCopyMemoryIndirectFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCopyMemoryIndirectPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22485,6 +22914,7 @@ impl<'a> PhysicalDeviceCopyMemoryIndirectPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryDecompressionFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22519,6 +22949,7 @@ impl<'a> PhysicalDeviceMemoryDecompressionFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryDecompressionPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22565,6 +22996,7 @@ impl<'a> PhysicalDeviceMemoryDecompressionPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShadingRatePaletteNV<'a> { pub shading_rate_palette_entry_count: u32, pub p_shading_rate_palette_entries: *const ShadingRatePaletteEntryNV, @@ -22595,6 +23027,7 @@ impl<'a> ShadingRatePaletteNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportShadingRateImageStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -22644,6 +23077,7 @@ impl<'a> PipelineViewportShadingRateImageStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShadingRateImageFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22688,6 +23122,7 @@ impl<'a> PhysicalDeviceShadingRateImageFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShadingRateImagePropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22735,6 +23170,7 @@ impl<'a> PhysicalDeviceShadingRateImagePropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceInvocationMaskFeaturesHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22769,6 +23205,7 @@ impl<'a> PhysicalDeviceInvocationMaskFeaturesHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct CoarseSampleLocationNV { pub pixel_x: u32, pub pixel_y: u32, @@ -22795,6 +23232,7 @@ impl CoarseSampleLocationNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CoarseSampleOrderCustomNV<'a> { pub shading_rate: ShadingRatePaletteEntryNV, pub sample_count: u32, @@ -22836,6 +23274,7 @@ impl<'a> CoarseSampleOrderCustomNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportCoarseSampleOrderStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -22885,6 +23324,7 @@ impl<'a> PipelineViewportCoarseSampleOrderStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMeshShaderFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22925,6 +23365,7 @@ impl<'a> PhysicalDeviceMeshShaderFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMeshShaderPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23047,6 +23488,7 @@ impl<'a> PhysicalDeviceMeshShaderPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrawMeshTasksIndirectCommandNV { pub task_count: u32, pub first_task: u32, @@ -23067,6 +23509,7 @@ impl DrawMeshTasksIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMeshShaderFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23132,6 +23575,7 @@ impl<'a> PhysicalDeviceMeshShaderFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMeshShaderPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23384,6 +23828,7 @@ impl<'a> PhysicalDeviceMeshShaderPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrawMeshTasksIndirectCommandEXT { pub group_count_x: u32, pub group_count_y: u32, @@ -23410,6 +23855,7 @@ impl DrawMeshTasksIndirectCommandEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RayTracingShaderGroupCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23469,6 +23915,7 @@ impl<'a> RayTracingShaderGroupCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RayTracingShaderGroupCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23538,6 +23985,7 @@ impl<'a> RayTracingShaderGroupCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RayTracingPipelineCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23632,6 +24080,7 @@ impl<'a> RayTracingPipelineCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RayTracingPipelineCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23753,6 +24202,7 @@ impl<'a> RayTracingPipelineCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GeometryTrianglesNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23854,6 +24304,7 @@ impl<'a> GeometryTrianglesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GeometryAABBNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23906,6 +24357,7 @@ impl<'a> GeometryAABBNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct GeometryDataNV<'a> { pub triangles: GeometryTrianglesNV<'a>, pub aabbs: GeometryAABBNV<'a>, @@ -23927,6 +24379,7 @@ impl<'a> GeometryDataNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GeometryNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -23972,6 +24425,7 @@ impl<'a> GeometryNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24027,6 +24481,7 @@ impl<'a> AccelerationStructureInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24083,6 +24538,7 @@ impl<'a> AccelerationStructureCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindAccelerationStructureMemoryInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24141,6 +24597,7 @@ impl<'a> BindAccelerationStructureMemoryInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct WriteDescriptorSetAccelerationStructureKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24180,6 +24637,7 @@ impl<'a> WriteDescriptorSetAccelerationStructureKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct WriteDescriptorSetAccelerationStructureNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24219,6 +24677,7 @@ impl<'a> WriteDescriptorSetAccelerationStructureNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureMemoryRequirementsInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -24261,6 +24720,7 @@ impl<'a> AccelerationStructureMemoryRequirementsInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAccelerationStructureFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24336,6 +24796,7 @@ impl<'a> PhysicalDeviceAccelerationStructureFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingPipelineFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24413,6 +24874,7 @@ impl<'a> PhysicalDeviceRayTracingPipelineFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayQueryFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24446,6 +24908,7 @@ impl<'a> PhysicalDeviceRayQueryFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAccelerationStructurePropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24551,6 +25014,7 @@ impl<'a> PhysicalDeviceAccelerationStructurePropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingPipelinePropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24639,6 +25103,7 @@ impl<'a> PhysicalDeviceRayTracingPipelinePropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24724,6 +25189,7 @@ impl<'a> PhysicalDeviceRayTracingPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct StridedDeviceAddressRegionKHR { pub device_address: DeviceAddress, pub stride: DeviceSize, @@ -24750,6 +25216,7 @@ impl StridedDeviceAddressRegionKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct TraceRaysIndirectCommandKHR { pub width: u32, pub height: u32, @@ -24776,6 +25243,7 @@ impl TraceRaysIndirectCommandKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct TraceRaysIndirectCommand2KHR { pub raygen_shader_record_address: DeviceAddress, pub raygen_shader_record_size: DeviceSize, @@ -24898,6 +25366,7 @@ impl TraceRaysIndirectCommand2KHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingMaintenance1FeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24943,6 +25412,7 @@ impl<'a> PhysicalDeviceRayTracingMaintenance1FeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DrmFormatModifierPropertiesListEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24981,6 +25451,7 @@ impl<'a> DrmFormatModifierPropertiesListEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrmFormatModifierPropertiesEXT { pub drm_format_modifier: u64, pub drm_format_modifier_plane_count: u32, @@ -25010,6 +25481,7 @@ impl DrmFormatModifierPropertiesEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageDrmFormatModifierInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25063,6 +25535,7 @@ impl<'a> PhysicalDeviceImageDrmFormatModifierInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageDrmFormatModifierListCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25099,6 +25572,7 @@ impl<'a> ImageDrmFormatModifierListCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageDrmFormatModifierExplicitCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25142,6 +25616,7 @@ impl<'a> ImageDrmFormatModifierExplicitCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageDrmFormatModifierPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25173,6 +25648,7 @@ impl<'a> ImageDrmFormatModifierPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageStencilUsageCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25206,6 +25682,7 @@ impl<'a> ImageStencilUsageCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceMemoryOverallocationCreateInfoAMD<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25242,6 +25719,7 @@ impl<'a> DeviceMemoryOverallocationCreateInfoAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMapFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25294,6 +25772,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMap2FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25328,6 +25807,7 @@ impl<'a> PhysicalDeviceFragmentDensityMap2FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25365,6 +25845,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMapPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25418,6 +25899,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMap2PropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25482,6 +25964,7 @@ impl<'a> PhysicalDeviceFragmentDensityMap2PropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25521,6 +26004,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassFragmentDensityMapCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25558,6 +26042,7 @@ impl<'a> RenderPassFragmentDensityMapCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassFragmentDensityMapOffsetEndInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25594,6 +26079,7 @@ impl<'a> SubpassFragmentDensityMapOffsetEndInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceScalarBlockLayoutFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25628,6 +26114,7 @@ impl<'a> PhysicalDeviceScalarBlockLayoutFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceProtectedCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25660,6 +26147,7 @@ impl<'a> SurfaceProtectedCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceUniformBufferStandardLayoutFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25697,6 +26185,7 @@ impl<'a> PhysicalDeviceUniformBufferStandardLayoutFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDepthClipEnableFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25731,6 +26220,7 @@ impl<'a> PhysicalDeviceDepthClipEnableFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationDepthClipStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25774,6 +26264,7 @@ impl<'a> PipelineRasterizationDepthClipStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryBudgetPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25814,6 +26305,7 @@ impl<'a> PhysicalDeviceMemoryBudgetPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMemoryPriorityFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25848,6 +26340,7 @@ impl<'a> PhysicalDeviceMemoryPriorityFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryPriorityAllocateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -25880,6 +26373,7 @@ impl<'a> MemoryPriorityAllocateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25917,6 +26411,7 @@ impl<'a> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceBufferDeviceAddressFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25971,6 +26466,7 @@ impl<'a> PhysicalDeviceBufferDeviceAddressFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceBufferDeviceAddressFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26025,6 +26521,7 @@ impl<'a> PhysicalDeviceBufferDeviceAddressFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferDeviceAddressInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26056,6 +26553,7 @@ impl<'a> BufferDeviceAddressInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferOpaqueCaptureAddressCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26088,6 +26586,7 @@ impl<'a> BufferOpaqueCaptureAddressCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferDeviceAddressCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26120,6 +26619,7 @@ impl<'a> BufferDeviceAddressCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageViewImageFormatInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26156,6 +26656,7 @@ impl<'a> PhysicalDeviceImageViewImageFormatInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FilterCubicImageViewImageFormatPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26196,6 +26697,7 @@ impl<'a> FilterCubicImageViewImageFormatPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImagelessFramebufferFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26230,6 +26732,7 @@ impl<'a> PhysicalDeviceImagelessFramebufferFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FramebufferAttachmentsCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26268,6 +26771,7 @@ impl<'a> FramebufferAttachmentsCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FramebufferAttachmentImageInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26337,6 +26841,7 @@ impl<'a> FramebufferAttachmentImageInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassAttachmentBeginInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26372,6 +26877,7 @@ impl<'a> RenderPassAttachmentBeginInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTextureCompressionASTCHDRFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26406,6 +26912,7 @@ impl<'a> PhysicalDeviceTextureCompressionASTCHDRFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCooperativeMatrixFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26451,6 +26958,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCooperativeMatrixPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26487,6 +26995,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CooperativeMatrixPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26567,6 +27076,7 @@ impl<'a> CooperativeMatrixPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceYcbcrImageArraysFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26601,6 +27111,7 @@ impl<'a> PhysicalDeviceYcbcrImageArraysFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewHandleInfoNVX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26646,6 +27157,7 @@ impl<'a> ImageViewHandleInfoNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewAddressPropertiesNVX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26684,6 +27196,7 @@ impl<'a> ImageViewAddressPropertiesNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PresentFrameTokenGGP<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26716,6 +27229,7 @@ impl<'a> PresentFrameTokenGGP<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PipelineCreationFeedback { pub flags: PipelineCreationFeedbackFlags, pub duration: u64, @@ -26736,6 +27250,7 @@ impl PipelineCreationFeedback { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCreationFeedbackCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26788,6 +27303,7 @@ impl<'a> PipelineCreationFeedbackCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceFullScreenExclusiveInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26821,6 +27337,7 @@ impl<'a> SurfaceFullScreenExclusiveInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceFullScreenExclusiveWin32InfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -26855,6 +27372,7 @@ impl<'a> SurfaceFullScreenExclusiveWin32InfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceCapabilitiesFullScreenExclusiveEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26891,6 +27409,7 @@ impl<'a> SurfaceCapabilitiesFullScreenExclusiveEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePresentBarrierFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26925,6 +27444,7 @@ impl<'a> PhysicalDevicePresentBarrierFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfaceCapabilitiesPresentBarrierNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26957,6 +27477,7 @@ impl<'a> SurfaceCapabilitiesPresentBarrierNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainPresentBarrierCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26989,6 +27510,7 @@ impl<'a> SwapchainPresentBarrierCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePerformanceQueryFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27037,6 +27559,7 @@ impl<'a> PhysicalDevicePerformanceQueryFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePerformanceQueryPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27073,6 +27596,7 @@ impl<'a> PhysicalDevicePerformanceQueryPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceCounterKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27124,6 +27648,7 @@ impl<'a> PerformanceCounterKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceCounterDescriptionKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27213,6 +27738,7 @@ impl<'a> PerformanceCounterDescriptionKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueryPoolPerformanceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27272,6 +27798,7 @@ impl ::std::default::Default for PerformanceCounterResultKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AcquireProfilingLockInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27310,6 +27837,7 @@ impl<'a> AcquireProfilingLockInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceQuerySubmitInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27343,6 +27871,7 @@ impl<'a> PerformanceQuerySubmitInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct HeadlessSurfaceCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27374,6 +27903,7 @@ impl<'a> HeadlessSurfaceCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCoverageReductionModeFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27408,6 +27938,7 @@ impl<'a> PhysicalDeviceCoverageReductionModeFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCoverageReductionStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27454,6 +27985,7 @@ impl<'a> PipelineCoverageReductionStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FramebufferMixedSamplesCombinationNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27509,6 +28041,7 @@ impl<'a> FramebufferMixedSamplesCombinationNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27561,6 +28094,7 @@ impl ::std::default::Default for PerformanceValueDataINTEL { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct PerformanceValueINTEL { pub ty: PerformanceValueTypeINTEL, pub data: PerformanceValueDataINTEL, @@ -27590,6 +28124,7 @@ impl PerformanceValueINTEL { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct InitializePerformanceApiInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27621,6 +28156,7 @@ impl<'a> InitializePerformanceApiInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueryPoolPerformanceQueryCreateInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27657,6 +28193,7 @@ impl<'a> QueryPoolPerformanceQueryCreateInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceMarkerInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27688,6 +28225,7 @@ impl<'a> PerformanceMarkerInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceStreamMarkerInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27719,6 +28257,7 @@ impl<'a> PerformanceStreamMarkerInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceOverrideInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27764,6 +28303,7 @@ impl<'a> PerformanceOverrideInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PerformanceConfigurationAcquireInfoINTEL<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -27796,6 +28336,7 @@ impl<'a> PerformanceConfigurationAcquireInfoINTEL<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderClockFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27836,6 +28377,7 @@ impl<'a> PhysicalDeviceShaderClockFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceIndexTypeUint8FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27870,6 +28412,7 @@ impl<'a> PhysicalDeviceIndexTypeUint8FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderSMBuiltinsPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27910,6 +28453,7 @@ impl<'a> PhysicalDeviceShaderSMBuiltinsPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderSMBuiltinsFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27944,6 +28488,7 @@ impl<'a> PhysicalDeviceShaderSMBuiltinsFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28004,6 +28549,7 @@ impl<'a> PhysicalDeviceFragmentShaderInterlockFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28041,6 +28587,7 @@ impl<'a> PhysicalDeviceSeparateDepthStencilLayoutsFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AttachmentReferenceStencilLayout<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28073,6 +28620,7 @@ impl<'a> AttachmentReferenceStencilLayout<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28123,6 +28671,7 @@ impl<'a> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AttachmentDescriptionStencilLayout<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28162,6 +28711,7 @@ impl<'a> AttachmentDescriptionStencilLayout<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28199,6 +28749,7 @@ impl<'a> PhysicalDevicePipelineExecutablePropertiesFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -28229,6 +28780,7 @@ impl<'a> PipelineInfoKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineExecutablePropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28310,6 +28862,7 @@ impl<'a> PipelineExecutablePropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineExecutableInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -28362,6 +28915,7 @@ impl ::std::default::Default for PipelineExecutableStatisticValueKHR { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineExecutableStatisticKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28442,6 +28996,7 @@ impl<'a> PipelineExecutableStatisticKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineExecutableInternalRepresentationKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28528,6 +29083,7 @@ impl<'a> PipelineExecutableInternalRepresentationKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderDemoteToHelperInvocationFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28568,6 +29124,7 @@ impl<'a> PhysicalDeviceShaderDemoteToHelperInvocationFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28602,6 +29159,7 @@ impl<'a> PhysicalDeviceTexelBufferAlignmentFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTexelBufferAlignmentProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28672,6 +29230,7 @@ impl<'a> PhysicalDeviceTexelBufferAlignmentProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubgroupSizeControlFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28713,6 +29272,7 @@ impl<'a> PhysicalDeviceSubgroupSizeControlFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubgroupSizeControlProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28770,6 +29330,7 @@ impl<'a> PhysicalDeviceSubgroupSizeControlProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineShaderStageRequiredSubgroupSizeCreateInfo<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28807,6 +29368,7 @@ impl<'a> PipelineShaderStageRequiredSubgroupSizeCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassShadingPipelineCreateInfoHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28847,6 +29409,7 @@ impl<'a> SubpassShadingPipelineCreateInfoHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubpassShadingPropertiesHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28884,6 +29447,7 @@ impl<'a> PhysicalDeviceSubpassShadingPropertiesHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28944,6 +29508,7 @@ impl<'a> PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryOpaqueCaptureAddressAllocateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -28977,6 +29542,7 @@ impl<'a> MemoryOpaqueCaptureAddressAllocateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceMemoryOpaqueCaptureAddressInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -29008,6 +29574,7 @@ impl<'a> DeviceMemoryOpaqueCaptureAddressInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLineRasterizationFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29077,6 +29644,7 @@ impl<'a> PhysicalDeviceLineRasterizationFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLineRasterizationPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29110,6 +29678,7 @@ impl<'a> PhysicalDeviceLineRasterizationPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationLineStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -29170,6 +29739,7 @@ impl<'a> PipelineRasterizationLineStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineCreationCacheControlFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29210,6 +29780,7 @@ impl<'a> PhysicalDevicePipelineCreationCacheControlFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan11Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29327,6 +29898,7 @@ impl<'a> PhysicalDeviceVulkan11Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan11Properties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29469,6 +30041,7 @@ impl<'a> PhysicalDeviceVulkan11Properties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan12Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29914,6 +30487,7 @@ impl<'a> PhysicalDeviceVulkan12Features<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan12Properties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30667,6 +31241,7 @@ impl<'a> PhysicalDeviceVulkan12Properties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan13Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30812,6 +31387,7 @@ impl<'a> PhysicalDeviceVulkan13Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVulkan13Properties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31257,6 +31833,7 @@ impl<'a> PhysicalDeviceVulkan13Properties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineCompilerControlCreateInfoAMD<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31297,6 +31874,7 @@ impl<'a> PipelineCompilerControlCreateInfoAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCoherentMemoryFeaturesAMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31330,6 +31908,7 @@ impl<'a> PhysicalDeviceCoherentMemoryFeaturesAMD<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceToolProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31434,6 +32013,7 @@ impl<'a> PhysicalDeviceToolProperties<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerCustomBorderColorCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31485,6 +32065,7 @@ impl<'a> SamplerCustomBorderColorCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCustomBorderColorPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31521,6 +32102,7 @@ impl<'a> PhysicalDeviceCustomBorderColorPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCustomBorderColorFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31565,6 +32147,7 @@ impl<'a> PhysicalDeviceCustomBorderColorFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerBorderColorComponentMappingCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31605,6 +32188,7 @@ impl<'a> SamplerBorderColorComponentMappingCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceBorderColorSwizzleFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31687,6 +32271,7 @@ impl ::std::default::Default for DeviceOrHostAddressConstAMDX { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureGeometryTrianglesDataKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31794,6 +32379,7 @@ impl<'a> AccelerationStructureGeometryTrianglesDataKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureGeometryAabbsDataKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31843,6 +32429,7 @@ impl<'a> AccelerationStructureGeometryAabbsDataKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureGeometryInstancesDataKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31906,6 +32493,7 @@ impl<'a> ::std::default::Default for AccelerationStructureGeometryDataKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureGeometryKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31962,6 +32550,7 @@ impl<'a> AccelerationStructureGeometryKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureBuildGeometryInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32080,6 +32669,7 @@ impl<'a> AccelerationStructureBuildGeometryInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AccelerationStructureBuildRangeInfoKHR { pub primitive_count: u32, pub primitive_offset: u32, @@ -32112,6 +32702,7 @@ impl AccelerationStructureBuildRangeInfoKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32196,6 +32787,7 @@ impl<'a> AccelerationStructureCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AabbPositionsKHR { pub min_x: f32, pub min_y: f32, @@ -32262,6 +32854,7 @@ pub struct AccelerationStructureInstanceKHR { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureDeviceAddressInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32297,6 +32890,7 @@ impl<'a> AccelerationStructureDeviceAddressInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureVersionInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32328,6 +32922,7 @@ impl<'a> AccelerationStructureVersionInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyAccelerationStructureInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32372,6 +32967,7 @@ impl<'a> CopyAccelerationStructureInfoKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyAccelerationStructureToMemoryInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32429,6 +33025,7 @@ impl<'a> CopyAccelerationStructureToMemoryInfoKHR<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyMemoryToAccelerationStructureInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32487,6 +33084,7 @@ impl<'a> CopyMemoryToAccelerationStructureInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RayTracingPipelineInterfaceCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32529,6 +33127,7 @@ impl<'a> RayTracingPipelineInterfaceCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineLibraryCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -32564,6 +33163,7 @@ impl<'a> PipelineLibraryCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedDynamicStateFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -32598,6 +33198,7 @@ impl<'a> PhysicalDeviceExtendedDynamicStateFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedDynamicState2FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -32653,6 +33254,7 @@ impl<'a> PhysicalDeviceExtendedDynamicState2FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedDynamicState3FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33019,6 +33621,7 @@ impl<'a> PhysicalDeviceExtendedDynamicState3FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedDynamicState3PropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33059,6 +33662,7 @@ impl<'a> PhysicalDeviceExtendedDynamicState3PropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ColorBlendEquationEXT { pub src_color_blend_factor: BlendFactor, pub dst_color_blend_factor: BlendFactor, @@ -33103,6 +33707,7 @@ impl ColorBlendEquationEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct ColorBlendAdvancedEXT { pub advanced_blend_op: BlendOp, pub src_premultiplied: Bool32, @@ -33141,6 +33746,7 @@ impl ColorBlendAdvancedEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassTransformBeginInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33173,6 +33779,7 @@ impl<'a> RenderPassTransformBeginInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyCommandTransformInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -33206,6 +33813,7 @@ impl<'a> CopyCommandTransformInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferInheritanceRenderPassTransformInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33249,6 +33857,7 @@ impl<'a> CommandBufferInheritanceRenderPassTransformInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDiagnosticsConfigFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33283,6 +33892,7 @@ impl<'a> PhysicalDeviceDiagnosticsConfigFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceDiagnosticsConfigCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -33315,6 +33925,7 @@ impl<'a> DeviceDiagnosticsConfigCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33356,6 +33967,7 @@ impl<'a> PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33399,6 +34011,7 @@ impl<'a> PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRobustness2FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33446,6 +34059,7 @@ impl<'a> PhysicalDeviceRobustness2FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRobustness2PropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33494,6 +34108,7 @@ impl<'a> PhysicalDeviceRobustness2PropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageRobustnessFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33527,6 +34142,7 @@ impl<'a> PhysicalDeviceImageRobustnessFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33600,6 +34216,7 @@ impl<'a> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePortabilitySubsetFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33745,6 +34362,7 @@ impl<'a> PhysicalDevicePortabilitySubsetFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePortabilitySubsetPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33781,6 +34399,7 @@ impl<'a> PhysicalDevicePortabilitySubsetPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevice4444FormatsFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33821,6 +34440,7 @@ impl<'a> PhysicalDevice4444FormatsFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubpassShadingFeaturesHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33855,6 +34475,7 @@ impl<'a> PhysicalDeviceSubpassShadingFeaturesHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33902,6 +34523,7 @@ impl<'a> PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCopy2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -33947,6 +34569,7 @@ impl<'a> BufferCopy2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageCopy2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34006,6 +34629,7 @@ impl<'a> ImageCopy2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageBlit2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34073,6 +34697,7 @@ impl<'a> ImageBlit2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferImageCopy2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34154,6 +34779,7 @@ impl<'a> BufferImageCopy2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageResolve2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34213,6 +34839,7 @@ impl<'a> ImageResolve2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyBufferInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34261,6 +34888,7 @@ impl<'a> CopyBufferInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyImageInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34323,6 +34951,7 @@ impl<'a> CopyImageInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BlitImageInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34407,6 +35036,7 @@ impl<'a> BlitImageInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyBufferToImageInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34462,6 +35092,7 @@ impl<'a> CopyBufferToImageInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyImageToBufferInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34517,6 +35148,7 @@ impl<'a> CopyImageToBufferInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ResolveImageInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34579,6 +35211,7 @@ impl<'a> ResolveImageInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34620,6 +35253,7 @@ impl<'a> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FragmentShadingRateAttachmentInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34665,6 +35299,7 @@ impl<'a> FragmentShadingRateAttachmentInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineFragmentShadingRateStateCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -34708,6 +35343,7 @@ impl<'a> PipelineFragmentShadingRateStateCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShadingRateFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34762,6 +35398,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShadingRatePropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34968,6 +35605,7 @@ impl<'a> PhysicalDeviceFragmentShadingRatePropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShadingRateKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35006,6 +35644,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderTerminateInvocationFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35040,6 +35679,7 @@ impl<'a> PhysicalDeviceShaderTerminateInvocationFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35097,6 +35737,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateEnumsFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35137,6 +35778,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateEnumsPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineFragmentShadingRateEnumStateCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35187,6 +35829,7 @@ impl<'a> PipelineFragmentShadingRateEnumStateCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureBuildSizesInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35233,6 +35876,7 @@ impl<'a> AccelerationStructureBuildSizesInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImage2DViewOf3DFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35274,6 +35918,7 @@ impl<'a> PhysicalDeviceImage2DViewOf3DFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35308,6 +35953,7 @@ impl<'a> PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35353,6 +35999,7 @@ impl<'a> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMutableDescriptorTypeFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35387,6 +36034,7 @@ impl<'a> PhysicalDeviceMutableDescriptorTypeFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MutableDescriptorTypeListEXT<'a> { pub descriptor_type_count: u32, pub p_descriptor_types: *const DescriptorType, @@ -35414,6 +36062,7 @@ impl<'a> MutableDescriptorTypeListEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MutableDescriptorTypeCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35453,6 +36102,7 @@ impl<'a> MutableDescriptorTypeCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDepthClipControlFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35487,6 +36137,7 @@ impl<'a> PhysicalDeviceDepthClipControlFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineViewportDepthClipControlCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35523,6 +36174,7 @@ impl<'a> PipelineViewportDepthClipControlCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35560,6 +36212,7 @@ impl<'a> PhysicalDeviceVertexInputDynamicStateFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalMemoryRDMAFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35594,6 +36247,7 @@ impl<'a> PhysicalDeviceExternalMemoryRDMAFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VertexInputBindingDescription2EXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35646,6 +36300,7 @@ impl<'a> VertexInputBindingDescription2EXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VertexInputAttributeDescription2EXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35698,6 +36353,7 @@ impl<'a> VertexInputAttributeDescription2EXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceColorWriteEnableFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35732,6 +36388,7 @@ impl<'a> PhysicalDeviceColorWriteEnableFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineColorWriteCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35767,6 +36424,7 @@ impl<'a> PipelineColorWriteCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryBarrier2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35820,6 +36478,7 @@ impl<'a> MemoryBarrier2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageMemoryBarrier2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -35929,6 +36588,7 @@ impl<'a> ImageMemoryBarrier2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferMemoryBarrier2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36031,6 +36691,7 @@ impl<'a> BufferMemoryBarrier2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DependencyInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36098,6 +36759,7 @@ impl<'a> DependencyInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SemaphoreSubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36150,6 +36812,7 @@ impl<'a> SemaphoreSubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferSubmitInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36188,6 +36851,7 @@ impl<'a> CommandBufferSubmitInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubmitInfo2<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36273,6 +36937,7 @@ impl<'a> SubmitInfo2<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyCheckpointProperties2NV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36308,6 +36973,7 @@ impl<'a> QueueFamilyCheckpointProperties2NV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CheckpointData2NV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36346,6 +37012,7 @@ impl<'a> CheckpointData2NV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSynchronization2Features<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36379,6 +37046,7 @@ impl<'a> PhysicalDeviceSynchronization2Features<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceHostImageCopyFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36413,6 +37081,7 @@ impl<'a> PhysicalDeviceHostImageCopyFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceHostImageCopyPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36479,6 +37148,7 @@ impl<'a> PhysicalDeviceHostImageCopyPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryToImageCopyEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36545,6 +37215,7 @@ impl<'a> MemoryToImageCopyEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageToMemoryCopyEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36611,6 +37282,7 @@ impl<'a> ImageToMemoryCopyEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyMemoryToImageInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36666,6 +37338,7 @@ impl<'a> CopyMemoryToImageInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyImageToMemoryInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36721,6 +37394,7 @@ impl<'a> CopyImageToMemoryInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyImageToImageInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36790,6 +37464,7 @@ impl<'a> CopyImageToImageInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct HostImageLayoutTransitionInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -36842,6 +37517,7 @@ impl<'a> HostImageLayoutTransitionInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubresourceHostMemcpySizeEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36874,6 +37550,7 @@ impl<'a> SubresourceHostMemcpySizeEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct HostImageCopyDevicePerformanceQueryEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36914,6 +37591,7 @@ impl<'a> HostImageCopyDevicePerformanceQueryEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36973,6 +37651,7 @@ impl<'a> PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLegacyDitheringFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37007,6 +37686,7 @@ impl<'a> PhysicalDeviceLegacyDitheringFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37050,6 +37730,7 @@ impl<'a> PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubpassResolvePerformanceQueryEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37082,6 +37763,7 @@ impl<'a> SubpassResolvePerformanceQueryEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MultisampledRenderToSingleSampledInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37127,6 +37809,7 @@ impl<'a> MultisampledRenderToSingleSampledInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineProtectedAccessFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37164,6 +37847,7 @@ impl<'a> PhysicalDevicePipelineProtectedAccessFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyVideoPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37199,6 +37883,7 @@ impl<'a> QueueFamilyVideoPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueueFamilyQueryResultStatusPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37232,6 +37917,7 @@ impl<'a> QueueFamilyQueryResultStatusPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoProfileListInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37270,6 +37956,7 @@ impl<'a> VideoProfileListInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVideoFormatInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37319,6 +38006,7 @@ impl<'a> PhysicalDeviceVideoFormatInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoFormatPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37385,6 +38073,7 @@ impl<'a> VideoFormatPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoProfileInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37459,6 +38148,7 @@ impl<'a> VideoProfileInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37567,6 +38257,7 @@ impl<'a> VideoCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoSessionMemoryRequirementsKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37605,6 +38296,7 @@ impl<'a> VideoSessionMemoryRequirementsKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BindVideoSessionMemoryInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37657,6 +38349,7 @@ impl<'a> BindVideoSessionMemoryInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoPictureResourceInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37709,6 +38402,7 @@ impl<'a> VideoPictureResourceInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoReferenceSlotInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37765,6 +38459,7 @@ impl<'a> VideoReferenceSlotInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37797,6 +38492,7 @@ impl<'a> VideoDecodeCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeUsageInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37830,6 +38526,7 @@ impl<'a> VideoDecodeUsageInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37927,6 +38624,7 @@ impl<'a> VideoDecodeInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264ProfileInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -37967,6 +38665,7 @@ impl<'a> VideoDecodeH264ProfileInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264CapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38006,6 +38705,7 @@ impl<'a> VideoDecodeH264CapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264SessionParametersAddInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38055,6 +38755,7 @@ impl<'a> VideoDecodeH264SessionParametersAddInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264SessionParametersCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38108,6 +38809,7 @@ impl<'a> VideoDecodeH264SessionParametersCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264PictureInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38150,6 +38852,7 @@ impl<'a> VideoDecodeH264PictureInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH264DpbSlotInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38185,6 +38888,7 @@ impl<'a> VideoDecodeH264DpbSlotInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265ProfileInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38218,6 +38922,7 @@ impl<'a> VideoDecodeH265ProfileInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265CapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38250,6 +38955,7 @@ impl<'a> VideoDecodeH265CapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265SessionParametersAddInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38309,6 +39015,7 @@ impl<'a> VideoDecodeH265SessionParametersAddInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265SessionParametersCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38369,6 +39076,7 @@ impl<'a> VideoDecodeH265SessionParametersCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265PictureInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38411,6 +39119,7 @@ impl<'a> VideoDecodeH265PictureInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoDecodeH265DpbSlotInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38446,6 +39155,7 @@ impl<'a> VideoDecodeH265DpbSlotInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoSessionCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38548,6 +39258,7 @@ impl<'a> VideoSessionCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoSessionParametersCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38614,6 +39325,7 @@ impl<'a> VideoSessionParametersCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoSessionParametersUpdateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38663,6 +39375,7 @@ impl<'a> VideoSessionParametersUpdateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeSessionParametersGetInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38716,6 +39429,7 @@ impl<'a> VideoEncodeSessionParametersGetInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeSessionParametersFeedbackInfoKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38766,6 +39480,7 @@ impl<'a> VideoEncodeSessionParametersFeedbackInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoBeginCodingInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38839,6 +39554,7 @@ impl<'a> VideoBeginCodingInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEndCodingInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38870,6 +39586,7 @@ impl<'a> VideoEndCodingInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoCodingControlInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38916,6 +39633,7 @@ impl<'a> VideoCodingControlInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeUsageInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -38963,6 +39681,7 @@ impl<'a> VideoEncodeUsageInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39070,6 +39789,7 @@ impl<'a> VideoEncodeInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueryPoolVideoEncodeFeedbackCreateInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39106,6 +39826,7 @@ impl<'a> QueryPoolVideoEncodeFeedbackCreateInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeQualityLevelInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39139,6 +39860,7 @@ impl<'a> VideoEncodeQualityLevelInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceVideoEncodeQualityLevelInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39178,6 +39900,7 @@ impl<'a> PhysicalDeviceVideoEncodeQualityLevelInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeQualityLevelPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39240,6 +39963,7 @@ impl<'a> VideoEncodeQualityLevelPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeRateControlInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39310,6 +40034,7 @@ impl<'a> VideoEncodeRateControlInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeRateControlLayerInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39380,6 +40105,7 @@ impl<'a> VideoEncodeRateControlLayerInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeCapabilitiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39463,6 +40189,7 @@ impl<'a> VideoEncodeCapabilitiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264CapabilitiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39588,6 +40315,7 @@ impl<'a> VideoEncodeH264CapabilitiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264QualityLevelPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39695,6 +40423,7 @@ impl<'a> VideoEncodeH264QualityLevelPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264SessionCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39734,6 +40463,7 @@ impl<'a> VideoEncodeH264SessionCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264SessionParametersAddInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39783,6 +40513,7 @@ impl<'a> VideoEncodeH264SessionParametersAddInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264SessionParametersCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39836,6 +40567,7 @@ impl<'a> VideoEncodeH264SessionParametersCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264SessionParametersGetInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39893,6 +40625,7 @@ impl<'a> VideoEncodeH264SessionParametersGetInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264SessionParametersFeedbackInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39936,6 +40669,7 @@ impl<'a> VideoEncodeH264SessionParametersFeedbackInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264DpbSlotInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -39971,6 +40705,7 @@ impl<'a> VideoEncodeH264DpbSlotInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264PictureInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40023,6 +40758,7 @@ impl<'a> VideoEncodeH264PictureInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264ProfileInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40056,6 +40792,7 @@ impl<'a> VideoEncodeH264ProfileInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264NaluSliceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40094,6 +40831,7 @@ impl<'a> VideoEncodeH264NaluSliceInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264RateControlInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40155,6 +40893,7 @@ impl<'a> VideoEncodeH264RateControlInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264QpEXT { pub qp_i: i32, pub qp_p: i32, @@ -40181,6 +40920,7 @@ impl VideoEncodeH264QpEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264FrameSizeEXT { pub frame_i_size: u32, pub frame_p_size: u32, @@ -40207,6 +40947,7 @@ impl VideoEncodeH264FrameSizeEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264GopRemainingFrameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40261,6 +41002,7 @@ impl<'a> VideoEncodeH264GopRemainingFrameInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH264RateControlLayerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40332,6 +41074,7 @@ impl<'a> VideoEncodeH264RateControlLayerInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265CapabilitiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40482,6 +41225,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265QualityLevelPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40579,6 +41323,7 @@ impl<'a> VideoEncodeH265QualityLevelPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265SessionCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40618,6 +41363,7 @@ impl<'a> VideoEncodeH265SessionCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265SessionParametersAddInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40677,6 +41423,7 @@ impl<'a> VideoEncodeH265SessionParametersAddInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265SessionParametersCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40737,6 +41484,7 @@ impl<'a> VideoEncodeH265SessionParametersCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265SessionParametersGetInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40808,6 +41556,7 @@ impl<'a> VideoEncodeH265SessionParametersGetInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265SessionParametersFeedbackInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40858,6 +41607,7 @@ impl<'a> VideoEncodeH265SessionParametersFeedbackInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265PictureInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40903,6 +41653,7 @@ impl<'a> VideoEncodeH265PictureInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265NaluSliceSegmentInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -40945,6 +41696,7 @@ impl<'a> VideoEncodeH265NaluSliceSegmentInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265RateControlInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41006,6 +41758,7 @@ impl<'a> VideoEncodeH265RateControlInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265QpEXT { pub qp_i: i32, pub qp_p: i32, @@ -41032,6 +41785,7 @@ impl VideoEncodeH265QpEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265FrameSizeEXT { pub frame_i_size: u32, pub frame_p_size: u32, @@ -41058,6 +41812,7 @@ impl VideoEncodeH265FrameSizeEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265GopRemainingFrameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41112,6 +41867,7 @@ impl<'a> VideoEncodeH265GopRemainingFrameInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265RateControlLayerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41183,6 +41939,7 @@ impl<'a> VideoEncodeH265RateControlLayerInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265ProfileInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41216,6 +41973,7 @@ impl<'a> VideoEncodeH265ProfileInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct VideoEncodeH265DpbSlotInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41251,6 +42009,7 @@ impl<'a> VideoEncodeH265DpbSlotInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceInheritedViewportScissorFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41288,6 +42047,7 @@ impl<'a> PhysicalDeviceInheritedViewportScissorFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferInheritanceViewportScissorInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41338,6 +42098,7 @@ impl<'a> CommandBufferInheritanceViewportScissorInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41372,6 +42133,7 @@ impl<'a> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProvokingVertexFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41417,6 +42179,7 @@ impl<'a> PhysicalDeviceProvokingVertexFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceProvokingVertexPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41464,6 +42227,7 @@ impl<'a> PhysicalDeviceProvokingVertexPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRasterizationProvokingVertexStateCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41500,6 +42264,7 @@ impl<'a> PipelineRasterizationProvokingVertexStateCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CuModuleCreateInfoNVX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41534,6 +42299,7 @@ impl<'a> CuModuleCreateInfoNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CuFunctionCreateInfoNVX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41576,6 +42342,7 @@ impl<'a> CuFunctionCreateInfoNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CuLaunchInfoNVX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -41676,6 +42443,7 @@ impl<'a> CuLaunchInfoNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorBufferFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41740,6 +42508,7 @@ impl<'a> PhysicalDeviceDescriptorBufferFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorBufferPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42082,6 +42851,7 @@ impl<'a> PhysicalDeviceDescriptorBufferPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorBufferDensityMapPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42122,6 +42892,7 @@ impl<'a> PhysicalDeviceDescriptorBufferDensityMapPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorAddressInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42167,6 +42938,7 @@ impl<'a> DescriptorAddressInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorBufferBindingInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42220,6 +42992,7 @@ impl<'a> DescriptorBufferBindingInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorBufferBindingPushDescriptorBufferHandleEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42276,6 +43049,7 @@ impl<'a> ::std::default::Default for DescriptorDataEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorGetInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42325,6 +43099,7 @@ impl<'a> DescriptorGetInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCaptureDescriptorDataInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42356,6 +43131,7 @@ impl<'a> BufferCaptureDescriptorDataInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageCaptureDescriptorDataInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42387,6 +43163,7 @@ impl<'a> ImageCaptureDescriptorDataInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewCaptureDescriptorDataInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42419,6 +43196,7 @@ impl<'a> ImageViewCaptureDescriptorDataInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerCaptureDescriptorDataInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42450,6 +43228,7 @@ impl<'a> SamplerCaptureDescriptorDataInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureCaptureDescriptorDataInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42495,6 +43274,7 @@ impl<'a> AccelerationStructureCaptureDescriptorDataInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpaqueCaptureDescriptorDataCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -42542,6 +43322,7 @@ impl<'a> OpaqueCaptureDescriptorDataCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderIntegerDotProductFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42576,6 +43357,7 @@ impl<'a> PhysicalDeviceShaderIntegerDotProductFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderIntegerDotProductProperties<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42901,6 +43683,7 @@ impl<'a> PhysicalDeviceShaderIntegerDotProductProperties<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDrmPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42968,6 +43751,7 @@ impl<'a> PhysicalDeviceDrmPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShaderBarycentricFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43005,6 +43789,7 @@ impl<'a> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFragmentShaderBarycentricPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43045,6 +43830,7 @@ impl<'a> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingMotionBlurFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43089,6 +43875,7 @@ impl<'a> PhysicalDeviceRayTracingMotionBlurFeaturesNV<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureGeometryMotionTrianglesDataNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43135,6 +43922,7 @@ impl<'a> AccelerationStructureGeometryMotionTrianglesDataNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureMotionInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43174,6 +43962,7 @@ impl<'a> AccelerationStructureMotionInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SRTDataNV { pub sx: f32, pub a: f32, @@ -43315,6 +44104,7 @@ impl ::std::default::Default for AccelerationStructureMotionInstanceDataNV { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct AccelerationStructureMotionInstanceNV { pub ty: AccelerationStructureMotionInstanceTypeNV, pub flags: AccelerationStructureMotionInstanceFlagsNV, @@ -43353,6 +44143,7 @@ pub type RemoteAddressNV = c_void; #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryGetRemoteAddressInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43391,6 +44182,7 @@ impl<'a> MemoryGetRemoteAddressInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMemoryBufferCollectionFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43430,6 +44222,7 @@ impl<'a> ImportMemoryBufferCollectionFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCollectionImageCreateInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43470,6 +44263,7 @@ impl<'a> BufferCollectionImageCreateInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCollectionBufferCreateInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43510,6 +44304,7 @@ impl<'a> BufferCollectionBufferCreateInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCollectionCreateInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43541,6 +44336,7 @@ impl<'a> BufferCollectionCreateInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCollectionPropertiesFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43651,6 +44447,7 @@ impl<'a> BufferCollectionPropertiesFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferConstraintsInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43702,6 +44499,7 @@ impl<'a> BufferConstraintsInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SysmemColorSpaceFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43733,6 +44531,7 @@ impl<'a> SysmemColorSpaceFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageFormatConstraintsInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43798,6 +44597,7 @@ impl<'a> ImageFormatConstraintsInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageConstraintsInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43852,6 +44652,7 @@ impl<'a> ImageConstraintsInfoFUCHSIA<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BufferCollectionConstraintsInfoFUCHSIA<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43919,6 +44720,7 @@ handle_nondispatchable ! (CudaFunctionNV , CUDA_FUNCTION_NV , doc = " { pub s_type: StructureType, pub p_next: *const c_void, @@ -43953,6 +44755,7 @@ impl<'a> CudaModuleCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CudaFunctionCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -43995,6 +44798,7 @@ impl<'a> CudaFunctionCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CudaLaunchInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44095,6 +44899,7 @@ impl<'a> CudaLaunchInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44133,6 +44938,7 @@ impl<'a> PhysicalDeviceRGBA10X6FormatsFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FormatProperties3<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44179,6 +44985,7 @@ impl<'a> FormatProperties3<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DrmFormatModifierPropertiesList2EXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44217,6 +45024,7 @@ impl<'a> DrmFormatModifierPropertiesList2EXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DrmFormatModifierProperties2EXT { pub drm_format_modifier: u64, pub drm_format_modifier_plane_count: u32, @@ -44246,6 +45054,7 @@ impl DrmFormatModifierProperties2EXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidHardwareBufferFormatProperties2ANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44337,6 +45146,7 @@ impl<'a> AndroidHardwareBufferFormatProperties2ANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRenderingCreateInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44393,6 +45203,7 @@ impl<'a> PipelineRenderingCreateInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderingInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44489,6 +45300,7 @@ impl<'a> RenderingInfo<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderingAttachmentInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44586,6 +45398,7 @@ impl<'a> RenderingAttachmentInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderingFragmentShadingRateAttachmentInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44636,6 +45449,7 @@ impl<'a> RenderingFragmentShadingRateAttachmentInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderingFragmentDensityMapAttachmentInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44676,6 +45490,7 @@ impl<'a> RenderingFragmentDensityMapAttachmentInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDynamicRenderingFeatures<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44709,6 +45524,7 @@ impl<'a> PhysicalDeviceDynamicRenderingFeatures<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CommandBufferInheritanceRenderingInfo<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44779,6 +45595,7 @@ impl<'a> CommandBufferInheritanceRenderingInfo<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AttachmentSampleCountInfoAMD<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44828,6 +45645,7 @@ impl<'a> AttachmentSampleCountInfoAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MultiviewPerViewAttributesInfoNVX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44872,6 +45690,7 @@ impl<'a> MultiviewPerViewAttributesInfoNVX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageViewMinLodFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44906,6 +45725,7 @@ impl<'a> PhysicalDeviceImageViewMinLodFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewMinLodCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -44938,6 +45758,7 @@ impl<'a> ImageViewMinLodCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45006,6 +45827,7 @@ impl<'a> PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLinearColorAttachmentFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45040,6 +45862,7 @@ impl<'a> PhysicalDeviceLinearColorAttachmentFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45077,6 +45900,7 @@ impl<'a> PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45127,6 +45951,7 @@ impl<'a> PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GraphicsPipelineLibraryCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45159,6 +45984,7 @@ impl<'a> GraphicsPipelineLibraryCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45196,6 +46022,7 @@ impl<'a> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetBindingReferenceVALVE<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45234,6 +46061,7 @@ impl<'a> DescriptorSetBindingReferenceVALVE<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DescriptorSetLayoutHostMappingInfoVALVE<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45273,6 +46101,7 @@ impl<'a> DescriptorSetLayoutHostMappingInfoVALVE<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceNestedCommandBufferFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45327,6 +46156,7 @@ impl<'a> PhysicalDeviceNestedCommandBufferFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceNestedCommandBufferPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45366,6 +46196,7 @@ impl<'a> PhysicalDeviceNestedCommandBufferPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderModuleIdentifierFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45400,6 +46231,7 @@ impl<'a> PhysicalDeviceShaderModuleIdentifierFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderModuleIdentifierPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45439,6 +46271,7 @@ impl<'a> PhysicalDeviceShaderModuleIdentifierPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineShaderStageModuleIdentifierCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45478,6 +46311,7 @@ impl<'a> PipelineShaderStageModuleIdentifierCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShaderModuleIdentifierEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45516,6 +46350,7 @@ impl<'a> ShaderModuleIdentifierEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageCompressionControlEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45563,6 +46398,7 @@ impl<'a> ImageCompressionControlEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageCompressionControlFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45600,6 +46436,7 @@ impl<'a> PhysicalDeviceImageCompressionControlFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageCompressionPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45647,6 +46484,7 @@ impl<'a> ImageCompressionPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45690,6 +46528,7 @@ impl<'a> PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageSubresource2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45721,6 +46560,7 @@ impl<'a> ImageSubresource2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SubresourceLayout2KHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45767,6 +46607,7 @@ impl<'a> SubresourceLayout2KHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassCreationControlEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45800,6 +46641,7 @@ impl<'a> RenderPassCreationControlEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct RenderPassCreationFeedbackInfoEXT { pub post_merge_subpass_count: u32, } @@ -45814,6 +46656,7 @@ impl RenderPassCreationFeedbackInfoEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassCreationFeedbackCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45849,6 +46692,7 @@ impl<'a> RenderPassCreationFeedbackCreateInfoEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassSubpassFeedbackInfoEXT { pub subpass_merge_status: SubpassMergeStatusEXT, pub description: [c_char; MAX_DESCRIPTION_SIZE], @@ -45903,6 +46747,7 @@ impl RenderPassSubpassFeedbackInfoEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct RenderPassSubpassFeedbackCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -45939,6 +46784,7 @@ impl<'a> RenderPassSubpassFeedbackCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSubpassMergeFeedbackFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45972,6 +46818,7 @@ impl<'a> PhysicalDeviceSubpassMergeFeedbackFeaturesEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MicromapBuildInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46090,6 +46937,7 @@ impl<'a> MicromapBuildInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MicromapCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46156,6 +47004,7 @@ impl<'a> MicromapCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MicromapVersionInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46187,6 +47036,7 @@ impl<'a> MicromapVersionInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyMicromapInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46231,6 +47081,7 @@ impl<'a> CopyMicromapInfoEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyMicromapToMemoryInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46287,6 +47138,7 @@ impl<'a> CopyMicromapToMemoryInfoEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CopyMemoryToMicromapInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46344,6 +47196,7 @@ impl<'a> CopyMemoryToMicromapInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MicromapBuildSizesInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -46389,6 +47242,7 @@ impl<'a> MicromapBuildSizesInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MicromapUsageEXT { pub count: u32, pub subdivision_level: u32, @@ -46415,6 +47269,7 @@ impl MicromapUsageEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct MicromapTriangleEXT { pub data_offset: u32, pub subdivision_level: u16, @@ -46441,6 +47296,7 @@ impl MicromapTriangleEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceOpacityMicromapFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46489,6 +47345,7 @@ impl<'a> PhysicalDeviceOpacityMicromapFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceOpacityMicromapPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46534,6 +47391,7 @@ impl<'a> PhysicalDeviceOpacityMicromapPropertiesEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureTrianglesOpacityMicromapEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46633,6 +47491,7 @@ impl<'a> AccelerationStructureTrianglesOpacityMicromapEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDisplacementMicromapFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46667,6 +47526,7 @@ impl<'a> PhysicalDeviceDisplacementMicromapFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDisplacementMicromapPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46706,6 +47566,7 @@ impl<'a> PhysicalDeviceDisplacementMicromapPropertiesNV<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AccelerationStructureTrianglesDisplacementMicromapNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46902,6 +47763,7 @@ impl<'a> AccelerationStructureTrianglesDisplacementMicromapNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelinePropertiesIdentifierEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46933,6 +47795,7 @@ impl<'a> PipelinePropertiesIdentifierEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelinePropertiesFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46967,6 +47830,7 @@ impl<'a> PhysicalDevicePipelinePropertiesFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47010,6 +47874,7 @@ impl<'a> PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalMemoryAcquireUnmodifiedEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47045,6 +47910,7 @@ impl<'a> ExternalMemoryAcquireUnmodifiedEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalObjectCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47083,6 +47949,7 @@ impl<'a> ExportMetalObjectCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalObjectsInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47122,6 +47989,7 @@ impl<'a> ExportMetalObjectsInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalDeviceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47154,6 +48022,7 @@ impl<'a> ExportMetalDeviceInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalCommandQueueInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47193,6 +48062,7 @@ impl<'a> ExportMetalCommandQueueInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalBufferInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47232,6 +48102,7 @@ impl<'a> ExportMetalBufferInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMetalBufferInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47264,6 +48135,7 @@ impl<'a> ImportMetalBufferInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalTextureInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47324,6 +48196,7 @@ impl<'a> ExportMetalTextureInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMetalTextureInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47363,6 +48236,7 @@ impl<'a> ImportMetalTextureInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalIOSurfaceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47402,6 +48276,7 @@ impl<'a> ExportMetalIOSurfaceInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMetalIOSurfaceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47434,6 +48309,7 @@ impl<'a> ImportMetalIOSurfaceInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExportMetalSharedEventInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47480,6 +48356,7 @@ impl<'a> ExportMetalSharedEventInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportMetalSharedEventInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47513,6 +48390,7 @@ impl<'a> ImportMetalSharedEventInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceNonSeamlessCubeMapFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47547,6 +48425,7 @@ impl<'a> PhysicalDeviceNonSeamlessCubeMapFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineRobustnessFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47581,6 +48460,7 @@ impl<'a> PhysicalDevicePipelineRobustnessFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineRobustnessCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47637,6 +48517,7 @@ impl<'a> PipelineRobustnessCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineRobustnessPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47703,6 +48584,7 @@ impl<'a> PhysicalDevicePipelineRobustnessPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImageViewSampleWeightCreateInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -47749,6 +48631,7 @@ impl<'a> ImageViewSampleWeightCreateInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageProcessingFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47797,6 +48680,7 @@ impl<'a> PhysicalDeviceImageProcessingFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageProcessingPropertiesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47851,6 +48735,7 @@ impl<'a> PhysicalDeviceImageProcessingPropertiesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceTilePropertiesFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47885,6 +48770,7 @@ impl<'a> PhysicalDeviceTilePropertiesFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct TilePropertiesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47930,6 +48816,7 @@ impl<'a> TilePropertiesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAmigoProfilingFeaturesSEC<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47964,6 +48851,7 @@ impl<'a> PhysicalDeviceAmigoProfilingFeaturesSEC<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AmigoProfilingSubmitInfoSEC<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -48003,6 +48891,7 @@ impl<'a> AmigoProfilingSubmitInfoSEC<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48043,6 +48932,7 @@ impl<'a> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDepthClampZeroOneFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48077,6 +48967,7 @@ impl<'a> PhysicalDeviceDepthClampZeroOneFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceAddressBindingReportFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48111,6 +49002,7 @@ impl<'a> PhysicalDeviceAddressBindingReportFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceAddressBindingCallbackDataEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48164,6 +49056,7 @@ impl<'a> DeviceAddressBindingCallbackDataEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceOpticalFlowFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48197,6 +49090,7 @@ impl<'a> PhysicalDeviceOpticalFlowFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceOpticalFlowPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48305,6 +49199,7 @@ impl<'a> PhysicalDeviceOpticalFlowPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpticalFlowImageFormatInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -48338,6 +49233,7 @@ impl<'a> OpticalFlowImageFormatInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpticalFlowImageFormatPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -48369,6 +49265,7 @@ impl<'a> OpticalFlowImageFormatPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpticalFlowSessionCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48471,6 +49368,7 @@ impl<'a> OpticalFlowSessionCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpticalFlowSessionCreatePrivateDataInfoNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48521,6 +49419,7 @@ impl<'a> OpticalFlowSessionCreatePrivateDataInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OpticalFlowExecuteInfoNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48562,6 +49461,7 @@ impl<'a> OpticalFlowExecuteInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFaultFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48602,6 +49502,7 @@ impl<'a> PhysicalDeviceFaultFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DeviceFaultAddressInfoEXT { pub address_type: DeviceFaultAddressTypeEXT, pub reported_address: DeviceAddress, @@ -48627,6 +49528,7 @@ impl DeviceFaultAddressInfoEXT { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceFaultVendorInfoEXT { pub description: [c_char; MAX_DESCRIPTION_SIZE], pub vendor_fault_code: u64, @@ -48681,6 +49583,7 @@ impl DeviceFaultVendorInfoEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceFaultCountsEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48725,6 +49628,7 @@ impl<'a> DeviceFaultCountsEXT<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceFaultInfoEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48798,6 +49702,7 @@ impl<'a> DeviceFaultInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceFaultVendorBinaryHeaderVersionOneEXT { pub header_size: u32, pub header_version: DeviceFaultVendorBinaryHeaderVersionEXT, @@ -48893,6 +49798,7 @@ impl DeviceFaultVendorBinaryHeaderVersionOneEXT { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48930,6 +49836,7 @@ impl<'a> PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DepthBiasInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -48990,6 +49897,7 @@ impl<'a> DepthBiasInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DepthBiasRepresentationInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49033,6 +49941,7 @@ impl<'a> DepthBiasRepresentationInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DecompressMemoryRegionNV { pub src_address: DeviceAddress, pub dst_address: DeviceAddress, @@ -49074,6 +49983,7 @@ impl DecompressMemoryRegionNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderCoreBuiltinsPropertiesARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49121,6 +50031,7 @@ impl<'a> PhysicalDeviceShaderCoreBuiltinsPropertiesARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderCoreBuiltinsFeaturesARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49155,6 +50066,7 @@ impl<'a> PhysicalDeviceShaderCoreBuiltinsFeaturesARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct FrameBoundaryEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49234,6 +50146,7 @@ impl<'a> FrameBoundaryEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceFrameBoundaryFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49268,6 +50181,7 @@ impl<'a> PhysicalDeviceFrameBoundaryFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49311,6 +50225,7 @@ impl<'a> PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfacePresentModeEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49343,6 +50258,7 @@ impl<'a> SurfacePresentModeEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfacePresentScalingCapabilitiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49412,6 +50328,7 @@ impl<'a> SurfacePresentScalingCapabilitiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SurfacePresentModeCompatibilityEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49447,6 +50364,7 @@ impl<'a> SurfacePresentModeCompatibilityEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSwapchainMaintenance1FeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49481,6 +50399,7 @@ impl<'a> PhysicalDeviceSwapchainMaintenance1FeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainPresentFenceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49516,6 +50435,7 @@ impl<'a> SwapchainPresentFenceInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainPresentModesCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49551,6 +50471,7 @@ impl<'a> SwapchainPresentModesCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainPresentModeInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49586,6 +50507,7 @@ impl<'a> SwapchainPresentModeInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainPresentScalingCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49632,6 +50554,7 @@ impl<'a> SwapchainPresentScalingCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ReleaseSwapchainImagesInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -49673,6 +50596,7 @@ impl<'a> ReleaseSwapchainImagesInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDepthBiasControlFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49732,6 +50656,7 @@ impl<'a> PhysicalDeviceDepthBiasControlFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingInvocationReorderFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49769,6 +50694,7 @@ impl<'a> PhysicalDeviceRayTracingInvocationReorderFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingInvocationReorderPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49810,6 +50736,7 @@ impl<'a> PhysicalDeviceRayTracingInvocationReorderPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49847,6 +50774,7 @@ impl<'a> PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExtendedSparseAddressSpacePropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49905,6 +50833,7 @@ impl<'a> PhysicalDeviceExtendedSparseAddressSpacePropertiesNV<'a> { #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DirectDriverLoadingInfoLUNARG<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -49960,6 +50889,7 @@ impl<'a> DirectDriverLoadingInfoLUNARG<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DirectDriverLoadingListLUNARG<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50002,6 +50932,7 @@ impl<'a> DirectDriverLoadingListLUNARG<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50039,6 +50970,7 @@ impl<'a> PhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRayTracingPositionFetchFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50076,6 +51008,7 @@ impl<'a> PhysicalDeviceRayTracingPositionFetchFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceImageSubresourceInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50114,6 +51047,7 @@ impl<'a> DeviceImageSubresourceInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderCorePropertiesARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50160,6 +51094,7 @@ impl<'a> PhysicalDeviceShaderCorePropertiesARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50200,6 +51135,7 @@ impl<'a> PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50237,6 +51173,7 @@ impl<'a> MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct QueryLowLatencySupportNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50269,6 +51206,7 @@ impl<'a> QueryLowLatencySupportNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryMapInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50321,6 +51259,7 @@ impl<'a> MemoryMapInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct MemoryUnmapInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50359,6 +51298,7 @@ impl<'a> MemoryUnmapInfoKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderObjectFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50392,6 +51332,7 @@ impl<'a> PhysicalDeviceShaderObjectFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderObjectPropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50432,6 +51373,7 @@ impl<'a> PhysicalDeviceShaderObjectPropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ShaderCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50547,6 +51489,7 @@ impl<'a> ShaderCreateInfoEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderTileImageFeaturesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50604,6 +51547,7 @@ impl<'a> PhysicalDeviceShaderTileImageFeaturesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderTileImagePropertiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50663,6 +51607,7 @@ impl<'a> PhysicalDeviceShaderTileImagePropertiesEXT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ImportScreenBufferInfoQNX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -50695,6 +51640,7 @@ impl<'a> ImportScreenBufferInfoQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ScreenBufferPropertiesQNX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50748,6 +51694,7 @@ impl<'a> ScreenBufferPropertiesQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ScreenBufferFormatPropertiesQNX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50842,6 +51789,7 @@ impl<'a> ScreenBufferFormatPropertiesQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExternalFormatQNX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50875,6 +51823,7 @@ impl<'a> ExternalFormatQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50912,6 +51861,7 @@ impl<'a> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCooperativeMatrixFeaturesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -50957,6 +51907,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixFeaturesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct CooperativeMatrixPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51044,6 +51995,7 @@ impl<'a> CooperativeMatrixPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCooperativeMatrixPropertiesKHR<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51080,6 +52032,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixPropertiesKHR<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderEnqueuePropertiesAMDX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51154,6 +52107,7 @@ impl<'a> PhysicalDeviceShaderEnqueuePropertiesAMDX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceShaderEnqueueFeaturesAMDX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51188,6 +52142,7 @@ impl<'a> PhysicalDeviceShaderEnqueueFeaturesAMDX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExecutionGraphPipelineCreateInfoAMDX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51275,6 +52230,7 @@ impl<'a> ExecutionGraphPipelineCreateInfoAMDX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PipelineShaderStageNodeCreateInfoAMDX<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51319,6 +52275,7 @@ impl<'a> PipelineShaderStageNodeCreateInfoAMDX<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct ExecutionGraphPipelineScratchSizeAMDX<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51349,6 +52306,7 @@ impl<'a> ExecutionGraphPipelineScratchSizeAMDX<'a> { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DispatchGraphInfoAMDX { pub node_index: u32, pub payload_count: u32, @@ -51391,6 +52349,7 @@ impl DispatchGraphInfoAMDX { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DispatchGraphCountInfoAMDX { pub count: u32, pub infos: DeviceOrHostAddressConstAMDX, @@ -51427,6 +52386,7 @@ impl DispatchGraphCountInfoAMDX { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCubicClampFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51460,6 +52420,7 @@ impl<'a> PhysicalDeviceCubicClampFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceYcbcrDegammaFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51494,6 +52455,7 @@ impl<'a> PhysicalDeviceYcbcrDegammaFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51537,6 +52499,7 @@ impl<'a> SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCubicWeightsFeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51571,6 +52534,7 @@ impl<'a> PhysicalDeviceCubicWeightsFeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerCubicWeightsCreateInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51603,6 +52567,7 @@ impl<'a> SamplerCubicWeightsCreateInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct BlitImageCubicWeightsInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51635,6 +52600,7 @@ impl<'a> BlitImageCubicWeightsInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageProcessing2FeaturesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51669,6 +52635,7 @@ impl<'a> PhysicalDeviceImageProcessing2FeaturesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceImageProcessing2PropertiesQCOM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51702,6 +52669,7 @@ impl<'a> PhysicalDeviceImageProcessing2PropertiesQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerBlockMatchWindowCreateInfoQCOM<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51745,6 +52713,7 @@ impl<'a> SamplerBlockMatchWindowCreateInfoQCOM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceDescriptorPoolOverallocationFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51782,6 +52751,7 @@ impl<'a> PhysicalDeviceDescriptorPoolOverallocationFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceLayeredDriverPropertiesMSFT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51815,6 +52785,7 @@ impl<'a> PhysicalDeviceLayeredDriverPropertiesMSFT<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalFormatResolveFeaturesANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51852,6 +52823,7 @@ impl<'a> PhysicalDeviceExternalFormatResolveFeaturesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceExternalFormatResolvePropertiesANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51912,6 +52884,7 @@ impl<'a> PhysicalDeviceExternalFormatResolvePropertiesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct AndroidHardwareBufferFormatResolvePropertiesANDROID<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -51948,6 +52921,7 @@ impl<'a> AndroidHardwareBufferFormatResolvePropertiesANDROID<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LatencySleepModeInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -51993,6 +52967,7 @@ impl<'a> LatencySleepModeInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LatencySleepInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52031,6 +53006,7 @@ impl<'a> LatencySleepInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SetLatencyMarkerInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52069,6 +53045,7 @@ impl<'a> SetLatencyMarkerInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct GetLatencyMarkerInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52103,6 +53080,7 @@ impl<'a> GetLatencyMarkerInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LatencyTimingsFrameReportNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52225,6 +53203,7 @@ impl<'a> LatencyTimingsFrameReportNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct OutOfBandQueueTypeInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52256,6 +53235,7 @@ impl<'a> OutOfBandQueueTypeInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LatencySubmissionPresentIdNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52289,6 +53269,7 @@ impl<'a> LatencySubmissionPresentIdNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SwapchainLatencyCreateInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52321,6 +53302,7 @@ impl<'a> SwapchainLatencyCreateInfoNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct LatencySurfaceCapabilitiesNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -52356,6 +53338,7 @@ impl<'a> LatencySurfaceCapabilitiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCudaKernelLaunchFeaturesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52390,6 +53373,7 @@ impl<'a> PhysicalDeviceCudaKernelLaunchFeaturesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceCudaKernelLaunchPropertiesNV<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52430,6 +53414,7 @@ impl<'a> PhysicalDeviceCudaKernelLaunchPropertiesNV<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct DeviceQueueShaderCoreControlCreateInfoARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52464,6 +53449,7 @@ impl<'a> DeviceQueueShaderCoreControlCreateInfoARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSchedulingControlsFeaturesARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52498,6 +53484,7 @@ impl<'a> PhysicalDeviceSchedulingControlsFeaturesARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceSchedulingControlsPropertiesARM<'a> { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52534,6 +53521,7 @@ impl<'a> PhysicalDeviceSchedulingControlsPropertiesARM<'a> { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { pub s_type: StructureType, pub p_next: *mut c_void, diff --git a/generator/src/lib.rs b/generator/src/lib.rs index de9a36782..1d92a3539 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1986,14 +1986,14 @@ fn derive_setters( assert!(field.null_terminate); assert_eq!(field.size, None); return Some(quote! { - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: &'a core::ffi::CStr) -> Self { self.#param_ident = #param_ident_short.as_ptr(); self } - #[inline] #deprecated + #[inline] pub unsafe fn #param_ident_as_c_str(&self) -> &core::ffi::CStr { core::ffi::CStr::from_ptr(self.#param_ident) } @@ -2001,13 +2001,13 @@ fn derive_setters( } else if is_static_array(field) { assert_eq!(field.size, None); return Some(quote! { - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: &core::ffi::CStr) -> core::result::Result { write_c_str_slice_with_nul(&mut self.#param_ident, #param_ident_short).map(|()| self) } - #[inline] #deprecated + #[inline] pub fn #param_ident_as_c_str(&self) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { wrap_c_str_slice_until_nul(&self.#param_ident) } @@ -2075,8 +2075,8 @@ fn derive_setters( let mutable = if field.is_const { quote!() } else { quote!(mut) }; return Some(quote! { - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self { #set_size_stmt self.#param_ident = #param_ident_short #ptr; @@ -2088,8 +2088,8 @@ fn derive_setters( if field.basetype == "VkBool32" { return Some(quote!{ - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: bool) -> Self { self.#param_ident = #param_ident_short.into(); self @@ -2109,8 +2109,8 @@ fn derive_setters( let objecttype_ident = format_ident!("{}", objecttype.to_snake_case()); return Some(quote!{ - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: T) -> Self { self.#param_ident = #param_ident_short.as_raw(); self.#objecttype_ident = T::TYPE; @@ -2128,8 +2128,8 @@ fn derive_setters( }; Some(quote!{ - #[inline] #deprecated + #[inline] pub fn #param_ident_short(mut self, #param_ident_short: #param_ty_tokens) -> Self { self.#param_ident = #param_ident_short; self @@ -2407,6 +2407,7 @@ pub fn generate_struct( #dbg_str #[derive(Copy, Clone, #default_str #manual_derive_tokens)] #[doc = #khronos_link] + #[must_use] pub struct #name #lifetimes { #(#params,)* #marker From e7dab7cb66b6a2fd2d3b0261f9ba4870cb30e477 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 24 Dec 2023 00:36:21 +0100 Subject: [PATCH 20/23] Clean up unused `std::XXX::` qualifications in examples and extensions (#852) --- ash-examples/src/bin/texture.rs | 20 ++++++++++--------- ash-examples/src/bin/triangle.rs | 11 +++++----- ash/src/entry.rs | 2 +- ash/src/extensions/amd/shader_info.rs | 2 +- .../khr/get_surface_capabilities2.rs | 3 ++- ash/src/extensions/khr/maintenance4.rs | 3 ++- .../extensions/nv/coverage_reduction_mode.rs | 3 ++- .../nv/device_diagnostic_checkpoints.rs | 3 ++- ash/src/extensions/nv/ray_tracing.rs | 2 +- ash/src/prelude.rs | 13 ++++++------ ash/src/util.rs | 3 +-- 11 files changed, 35 insertions(+), 30 deletions(-) diff --git a/ash-examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs index b512a22fc..45b1803f4 100644 --- a/ash-examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -1,7 +1,9 @@ +#![warn(unused_qualifications)] + use std::default::Default; use std::ffi::CStr; use std::io::Cursor; -use std::mem::{self, align_of}; +use std::mem; use std::os::raw::c_void; use ash::util::*; @@ -95,7 +97,7 @@ fn main() { .collect(); let index_buffer_data = [0u32, 1, 2, 2, 3, 0]; let index_buffer_info = vk::BufferCreateInfo { - size: std::mem::size_of_val(&index_buffer_data) as u64, + size: mem::size_of_val(&index_buffer_data) as u64, usage: vk::BufferUsageFlags::INDEX_BUFFER, sharing_mode: vk::SharingMode::EXCLUSIVE, ..Default::default() @@ -128,7 +130,7 @@ fn main() { .unwrap(); let mut index_slice = Align::new( index_ptr, - align_of::() as u64, + mem::align_of::() as u64, index_buffer_memory_req.size, ); index_slice.copy_from_slice(&index_buffer_data); @@ -156,7 +158,7 @@ fn main() { }, ]; let vertex_input_buffer_info = vk::BufferCreateInfo { - size: std::mem::size_of_val(&vertices) as u64, + size: mem::size_of_val(&vertices) as u64, usage: vk::BufferUsageFlags::VERTEX_BUFFER, sharing_mode: vk::SharingMode::EXCLUSIVE, ..Default::default() @@ -196,7 +198,7 @@ fn main() { .unwrap(); let mut slice = Align::new( vert_ptr, - align_of::() as u64, + mem::align_of::() as u64, vertex_input_buffer_memory_req.size, ); slice.copy_from_slice(&vertices); @@ -212,7 +214,7 @@ fn main() { _pad: 0.0, }; let uniform_color_buffer_info = vk::BufferCreateInfo { - size: std::mem::size_of_val(&uniform_color_buffer_data) as u64, + size: mem::size_of_val(&uniform_color_buffer_data) as u64, usage: vk::BufferUsageFlags::UNIFORM_BUFFER, sharing_mode: vk::SharingMode::EXCLUSIVE, ..Default::default() @@ -251,7 +253,7 @@ fn main() { .unwrap(); let mut uniform_aligned_slice = Align::new( uniform_ptr, - align_of::() as u64, + mem::align_of::() as u64, uniform_color_buffer_memory_req.size, ); uniform_aligned_slice.copy_from_slice(&[uniform_color_buffer_data]); @@ -267,7 +269,7 @@ fn main() { let image_extent = vk::Extent2D { width, height }; let image_data = image.into_raw(); let image_buffer_info = vk::BufferCreateInfo { - size: (std::mem::size_of::() * image_data.len()) as u64, + size: (mem::size_of::() * image_data.len()) as u64, usage: vk::BufferUsageFlags::TRANSFER_SRC, sharing_mode: vk::SharingMode::EXCLUSIVE, ..Default::default() @@ -301,7 +303,7 @@ fn main() { .unwrap(); let mut image_slice = Align::new( image_ptr, - std::mem::align_of::() as u64, + mem::align_of::() as u64, image_buffer_memory_req.size, ); image_slice.copy_from_slice(&image_data); diff --git a/ash-examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs index ee0bcc5be..318a6cf4c 100644 --- a/ash-examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -1,8 +1,9 @@ +#![warn(unused_qualifications)] + use std::default::Default; use std::ffi::CStr; use std::io::Cursor; use std::mem; -use std::mem::align_of; use ash::util::*; use ash::vk; @@ -87,7 +88,7 @@ fn main() { let index_buffer_data = [0u32, 1, 2]; let index_buffer_info = vk::BufferCreateInfo::default() - .size(std::mem::size_of_val(&index_buffer_data) as u64) + .size(mem::size_of_val(&index_buffer_data) as u64) .usage(vk::BufferUsageFlags::INDEX_BUFFER) .sharing_mode(vk::SharingMode::EXCLUSIVE); @@ -120,7 +121,7 @@ fn main() { .unwrap(); let mut index_slice = Align::new( index_ptr, - align_of::() as u64, + mem::align_of::() as u64, index_buffer_memory_req.size, ); index_slice.copy_from_slice(&index_buffer_data); @@ -130,7 +131,7 @@ fn main() { .unwrap(); let vertex_input_buffer_info = vk::BufferCreateInfo { - size: 3 * std::mem::size_of::() as u64, + size: 3 * mem::size_of::() as u64, usage: vk::BufferUsageFlags::VERTEX_BUFFER, sharing_mode: vk::SharingMode::EXCLUSIVE, ..Default::default() @@ -190,7 +191,7 @@ fn main() { let mut vert_align = Align::new( vert_ptr, - align_of::() as u64, + mem::align_of::() as u64, vertex_input_buffer_memory_req.size, ); vert_align.copy_from_slice(&vertices); diff --git a/ash/src/entry.rs b/ash/src/entry.rs index a87cafc91..defa19209 100644 --- a/ash/src/entry.rs +++ b/ash/src/entry.rs @@ -337,7 +337,7 @@ impl vk::StaticFn { if val.is_null() { return Err(MissingEntryPoint); } else { - ::std::mem::transmute(val) + mem::transmute(val) } }, }) diff --git a/ash/src/extensions/amd/shader_info.rs b/ash/src/extensions/amd/shader_info.rs index 9c01aec0c..5b3367ac9 100644 --- a/ash/src/extensions/amd/shader_info.rs +++ b/ash/src/extensions/amd/shader_info.rs @@ -43,7 +43,7 @@ impl ShaderInfo { vk::ShaderInfoTypeAMD::STATISTICS => { let mut statistics_info = mem::MaybeUninit::::uninit(); load_data( - &mut std::mem::size_of_val(&statistics_info), + &mut mem::size_of_val(&statistics_info), statistics_info.as_mut_ptr().cast(), ) .result()?; diff --git a/ash/src/extensions/khr/get_surface_capabilities2.rs b/ash/src/extensions/khr/get_surface_capabilities2.rs index 23762b32b..804ba2f07 100644 --- a/ash/src/extensions/khr/get_surface_capabilities2.rs +++ b/ash/src/extensions/khr/get_surface_capabilities2.rs @@ -3,6 +3,7 @@ use crate::vk; use crate::{Entry, Instance}; use std::ffi::CStr; use std::mem; +use std::ptr; /// #[derive(Clone)] @@ -46,7 +47,7 @@ impl GetSurfaceCapabilities2 { physical_device, surface_info, count.as_mut_ptr(), - std::ptr::null_mut(), + ptr::null_mut(), ); err_code.assume_init_on_success(count).map(|c| c as usize) } diff --git a/ash/src/extensions/khr/maintenance4.rs b/ash/src/extensions/khr/maintenance4.rs index db7a07588..663816e81 100644 --- a/ash/src/extensions/khr/maintenance4.rs +++ b/ash/src/extensions/khr/maintenance4.rs @@ -2,6 +2,7 @@ use crate::vk; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; +use std::ptr; /// #[derive(Clone)] @@ -50,7 +51,7 @@ impl Maintenance4 { self.handle, memory_requirements, count.as_mut_ptr(), - std::ptr::null_mut(), + ptr::null_mut(), ); count.assume_init() as usize } diff --git a/ash/src/extensions/nv/coverage_reduction_mode.rs b/ash/src/extensions/nv/coverage_reduction_mode.rs index 94c789211..d6ed3e1ae 100644 --- a/ash/src/extensions/nv/coverage_reduction_mode.rs +++ b/ash/src/extensions/nv/coverage_reduction_mode.rs @@ -3,6 +3,7 @@ use crate::vk; use crate::{Entry, Instance}; use std::ffi::CStr; use std::mem; +use std::ptr; /// #[derive(Clone)] @@ -30,7 +31,7 @@ impl CoverageReductionMode { .get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)( physical_device, count.as_mut_ptr(), - std::ptr::null_mut(), + ptr::null_mut(), ) .assume_init_on_success(count) .map(|c| c as usize) diff --git a/ash/src/extensions/nv/device_diagnostic_checkpoints.rs b/ash/src/extensions/nv/device_diagnostic_checkpoints.rs index 03c801119..c849adc38 100644 --- a/ash/src/extensions/nv/device_diagnostic_checkpoints.rs +++ b/ash/src/extensions/nv/device_diagnostic_checkpoints.rs @@ -3,6 +3,7 @@ use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; use std::os::raw::c_void; +use std::ptr; /// #[derive(Clone)] @@ -32,7 +33,7 @@ impl DeviceDiagnosticCheckpoints { #[inline] pub unsafe fn get_queue_checkpoint_data_len(&self, queue: vk::Queue) -> usize { let mut count = mem::MaybeUninit::uninit(); - (self.fp.get_queue_checkpoint_data_nv)(queue, count.as_mut_ptr(), std::ptr::null_mut()); + (self.fp.get_queue_checkpoint_data_nv)(queue, count.as_mut_ptr(), ptr::null_mut()); count.assume_init() as usize } diff --git a/ash/src/extensions/nv/ray_tracing.rs b/ash/src/extensions/nv/ray_tracing.rs index d09a70959..794135725 100755 --- a/ash/src/extensions/nv/ray_tracing.rs +++ b/ash/src/extensions/nv/ray_tracing.rs @@ -208,7 +208,7 @@ impl RayTracing { (self.fp.get_acceleration_structure_handle_nv)( self.handle, accel_struct, - std::mem::size_of_val(&handle), + mem::size_of_val(&handle), handle.as_mut_ptr().cast(), ) .assume_init_on_success(handle) diff --git a/ash/src/prelude.rs b/ash/src/prelude.rs index d73e53de0..3dd7c0348 100644 --- a/ash/src/prelude.rs +++ b/ash/src/prelude.rs @@ -1,7 +1,6 @@ use std::convert::TryInto; -#[cfg(feature = "debug")] -use std::fmt; use std::mem; +use std::ptr; use crate::vk; pub type VkResult = Result; @@ -50,7 +49,7 @@ where { loop { let mut count = N::default(); - f(&mut count, std::ptr::null_mut()).result()?; + f(&mut count, ptr::null_mut()).result()?; let mut data = Vec::with_capacity(count.try_into().expect("`N` failed to convert to `usize`")); @@ -69,7 +68,7 @@ where /// /// Items in the target vector are [`default()`][Default::default()]-initialized which is required /// for [`vk::BaseOutStructure`]-like structs where [`vk::BaseOutStructure::s_type`] needs to be a -/// valid type and [`vk::BaseOutStructure::p_next`] a valid or [`null`][std::ptr::null_mut()] +/// valid type and [`vk::BaseOutStructure::p_next`] a valid or [`null`][ptr::null_mut()] /// pointer. /// /// See for example [`vkEnumerateInstanceExtensionProperties`]: the number of available items may @@ -88,7 +87,7 @@ where { loop { let mut count = N::default(); - f(&mut count, std::ptr::null_mut()).result()?; + f(&mut count, ptr::null_mut()).result()?; let mut data = vec![Default::default(); count.try_into().expect("`N` failed to convert to `usize`")]; @@ -104,10 +103,10 @@ where #[cfg(feature = "debug")] pub(crate) fn debug_flags + Copy>( - f: &mut fmt::Formatter<'_>, + f: &mut std::fmt::Formatter<'_>, known: &[(Value, &'static str)], value: Value, -) -> fmt::Result { +) -> std::fmt::Result { let mut first = true; let mut accum = value.into(); for &(bit, name) in known { diff --git a/ash/src/util.rs b/ash/src/util.rs index 0116f74b8..099655770 100644 --- a/ash/src/util.rs +++ b/ash/src/util.rs @@ -28,10 +28,9 @@ pub struct AlignIter<'a, T> { impl Align { pub fn copy_from_slice(&mut self, slice: &[T]) { - use std::slice::from_raw_parts_mut; if self.elem_size == size_of::() as u64 { unsafe { - let mapped_slice = from_raw_parts_mut(self.ptr.cast(), slice.len()); + let mapped_slice = slice::from_raw_parts_mut(self.ptr.cast(), slice.len()); mapped_slice.copy_from_slice(slice); } } else { From 51080bd5224deb0c86589622e3cb3578df02aea6 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 11 Jan 2024 00:18:28 +0100 Subject: [PATCH 21/23] Fix Rust 1.75 clippy lints (#859) Rust 1.75 has once again gotten a bit more complete/strict when linting code. `.get(0)` is now recommended to be replaced with `.first()`, and needless glob reexports are equally denied (the modules in question either contain macros which are already reexported via `#[macro_export]`, or contain `impl` blocks exclusively which cannot be referred to as item paths either). --- ash/src/vk.rs | 2 -- generator/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ash/src/vk.rs b/ash/src/vk.rs index 17b49d197..1d551eea2 100644 --- a/ash/src/vk.rs +++ b/ash/src/vk.rs @@ -5,7 +5,6 @@ )] #[macro_use] mod macros; -pub use macros::*; mod aliases; pub use aliases::*; mod bitflags; @@ -21,7 +20,6 @@ pub use enums::*; mod extensions; pub use extensions::*; mod feature_extensions; -pub use feature_extensions::*; mod features; pub use features::*; mod prelude; diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 1d92a3539..67af12d6a 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -566,7 +566,7 @@ pub trait CommandExt { impl CommandExt for vk_parse::CommandDefinition { fn function_type(&self) -> FunctionType { - let is_first_param_device = self.params.get(0).map_or(false, |field| { + let is_first_param_device = self.params.first().map_or(false, |field| { matches!( field.definition.type_name.as_deref(), Some("VkDevice" | "VkCommandBuffer" | "VkQueue") From e99222521e5fa28920927c3708ca7555df80a662 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 11 Jan 2024 00:33:32 +0100 Subject: [PATCH 22/23] generator: Derive slice getters/setters for runtime-bounded static arrays (#858) Upstream Vulkan is okay with the request to annotate static arrays with a `len="structField"` annotation when the size of the static arrary is bounded by a value at runtime. This allows us to generate more convenient builder functions that copy slices into the target "builder" struct while _also_ updating the length, rather than forcing the caller to move an array of the desired length with zeroed elements and setting the length field separately. In addition provide a safe getter (and use it in the `Debug` implementation) to return a slice view containing only valid items per the length field. As with strings this is only possible for static-sized arrays as we can never safely dereference a random pointer. --- generator/src/lib.rs | 110 ++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 34 deletions(-) diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 67af12d6a..0ea1b28ab 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -804,33 +804,30 @@ impl FieldExt for vkxml::Field { assert!(!self.is_void()); let ty = name_to_tokens(&self.basetype); - match self.array { - Some(vkxml::ArrayType::Static) => { - assert!(self.reference.is_none()); - let size = self - .size - .as_ref() - .or(self.size_enumref.as_ref()) - .expect("Should have size"); - // Make sure we also rename the constant, that is - // used inside the static array - let size = convert_c_expression(size, &BTreeMap::new()); - // arrays in c are always passed as a pointer - if is_ffi_param { - quote!(*const [#ty; #size]) - } else { - quote!([#ty #type_lifetime; #size]) - } + if is_static_array(self) { + assert!(self.reference.is_none()); + let size = self + .size_enumref + .as_ref() + .or(self.size.as_ref()) + .expect("Should have size"); + // Make sure we also rename the constant, that is + // used inside the static array + let size = convert_c_expression(size, &BTreeMap::new()); + // arrays in c are always passed as a pointer + if is_ffi_param { + quote!(*const [#ty; #size]) + } else { + quote!([#ty #type_lifetime; #size]) } - _ => { - let pointer = self.reference.as_ref().map(|r| r.to_tokens(self.is_const)); - if self.is_pointer_to_static_sized_array() { - let size = self.c_size.as_ref().expect("Should have c_size"); - let size = convert_c_expression(size, &BTreeMap::new()); - quote!(#pointer [#ty #type_lifetime; #size]) - } else { - quote!(#pointer #ty #type_lifetime) - } + } else { + let pointer = self.reference.as_ref().map(|r| r.to_tokens(self.is_const)); + if self.is_pointer_to_static_sized_array() { + let size = self.c_size.as_ref().expect("Should have c_size"); + let size = convert_c_expression(size, &BTreeMap::new()); + quote!(#pointer [#ty #type_lifetime; #size]) + } else { + quote!(#pointer #ty #type_lifetime) } } } @@ -1711,7 +1708,13 @@ fn generate_result(ident: Ident, enum_: &vk_parse::Enums) -> TokenStream { } fn is_static_array(field: &vkxml::Field) -> bool { - matches!(field.array, Some(vkxml::ArrayType::Static)) + match field.array { + Some(vkxml::ArrayType::Static) => true, + // Ancient vkxml turns static-sized arrays with a len= attribute (new concept) into Static arrays. + // The len= attribute will be used to bound the static-sized array at runtime. + Some(vkxml::ArrayType::Dynamic) => field.size_enumref.is_some(), + _ => false, + } } fn derive_default( @@ -1808,9 +1811,18 @@ fn derive_debug( .map(|n| n.contains("pfn")) .unwrap_or(false) }); - let contains_static_array = members - .iter() - .any(|member| is_static_array(member.vkxml_field) && member.vkxml_field.basetype == "char"); + fn is_static_char_array(field: &vkxml::Field) -> bool { + // Exclude string pointers from formatting as they will always be unsafe to read, even if + // https://github.com/ash-rs/ash/pull/831#discussion_r1447805951 is resolved. + is_static_array(field) && field.basetype == "char" + } + fn is_static_bounded_array(field: &vkxml::Field) -> bool { + // Excerpt from is_static_array() for runtime-bounded static arrays that are considered "dynamic" by vkxml + matches!(field.array, Some(vkxml::ArrayType::Dynamic)) && field.size_enumref.is_some() + } + let contains_static_array = members.iter().any(|member| { + is_static_char_array(member.vkxml_field) || is_static_bounded_array(member.vkxml_field) + }); let contains_union = members .iter() .any(|member| union_types.contains(member.vkxml_field.basetype.as_str())); @@ -1821,9 +1833,12 @@ fn derive_debug( let field = &member.vkxml_field; let param_ident = field.param_ident(); let param_str = param_ident.to_string(); - let debug_value = if is_static_array(field) && field.basetype == "char" { + let debug_value = if is_static_char_array(field) { let param_ident = format_ident!("{}_as_c_str", param_ident); quote!(&self.#param_ident()) + } else if is_static_bounded_array(field) { + let param_ident = format_ident!("{}_as_slice", param_ident); + quote!(&self.#param_ident()) } else if param_str.contains("pfn") { quote!(&(self.#param_ident.map(|x| x as *const ()))) } else if union_types.contains(field.basetype.as_str()) { @@ -1848,7 +1863,7 @@ fn derive_debug( Some(q) } -fn derive_setters( +fn derive_getters_and_setters( struct_: &vkxml::Struct, members: &[PreprocessedMember<'_>], root_structs: &HashSet, @@ -2016,7 +2031,7 @@ fn derive_setters( } // TODO: Improve in future when https://github.com/rust-lang/rust/issues/53667 is merged id:6 - if field.reference.is_some() && matches!(field.array, Some(vkxml::ArrayType::Dynamic)) { + if matches!(field.array, Some(vkxml::ArrayType::Dynamic)) { if let Some(ref array_size) = field.size { let mut ptr = if field.is_const { quote!(.as_ptr()) @@ -2032,6 +2047,33 @@ fn derive_setters( let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); + // vkxml wrongly annotates static arrays with a len= field is dynamic. These fields have a static length, + // and a runtime field to describe the actual number of valid items in this static array. + if is_static_array(field) { + let array_size_ident = format_ident!("{}", array_size.to_snake_case()); + let param_ident_short_as_slice = format_ident!("{}_as_slice", param_ident_short); + let size_field = members.iter().find(|member| member.vkxml_field.name.as_deref() == Some(array_size)).unwrap(); + let cast = if size_field.vkxml_field.basetype == "size_t" { + quote!() + } else { + quote!(as _) + }; + return Some(quote! { + #deprecated + #[inline] + pub fn #param_ident_short(mut self, #param_ident_short: &'_ #slice_param_ty_tokens) -> Self { + self.#array_size_ident = #param_ident_short.len()#cast; + self.#param_ident[..#param_ident_short.len()].copy_from_slice(#param_ident_short); + self + } + #deprecated + #[inline] + pub fn #param_ident_short_as_slice(&self) -> &#slice_param_ty_tokens { + &self.#param_ident[..self.#array_size_ident #cast] + } + }); + } + // Interpret void array as byte array if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) { slice_param_ty_tokens = quote!([u8]); @@ -2389,7 +2431,7 @@ pub fn generate_struct( let debug_tokens = derive_debug(struct_, &members, union_types, has_lifetime); let default_tokens = derive_default(struct_, &members, has_lifetime); - let setter_tokens = derive_setters(struct_, &members, root_structs, has_lifetimes); + let setter_tokens = derive_getters_and_setters(struct_, &members, root_structs, has_lifetimes); let manual_derive_tokens = manual_derives(struct_); let dbg_str = if debug_tokens.is_none() { quote!(#[cfg_attr(feature = "debug", derive(Debug))]) From 92084df65f52aa15b704279fb6d8d26a3ee71809 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 12 Jan 2024 00:08:38 +0100 Subject: [PATCH 23/23] generator: Wrap `_as_c_str()` getter for possibly-pointers in `Option` (#860) While this function is already marked `unsafe` to represent cases where an invalid pointer might be dereferenced, it should at least be obvious to the caller that there is a real chance for `NULL` pointers in these `CStr` getters, which will now be returned as `None`. This function won't be used in `Debug` now as the dereference operation is still `unsafe`. The `_as_c_str()` getters for static arrays is left untouched, as the data is read directly from the known-valid struct here. --- ash/src/vk/definitions.rs | 112 ++++++++++++++++++++++++++++---------- generator/src/lib.rs | 15 +++-- 2 files changed, 95 insertions(+), 32 deletions(-) diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index 04df6f53a..e2af6480c 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -1062,8 +1062,12 @@ impl<'a> ApplicationInfo<'a> { self } #[inline] - pub unsafe fn application_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_application_name) + pub unsafe fn application_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_application_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_application_name)) + } } #[inline] pub fn application_version(mut self, application_version: u32) -> Self { @@ -1076,8 +1080,12 @@ impl<'a> ApplicationInfo<'a> { self } #[inline] - pub unsafe fn engine_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_engine_name) + pub unsafe fn engine_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_engine_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_engine_name)) + } } #[inline] pub fn engine_version(mut self, engine_version: u32) -> Self { @@ -3755,8 +3763,12 @@ impl<'a> PipelineShaderStageCreateInfo<'a> { self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } } #[inline] pub fn specialization_info(mut self, specialization_info: &'a SpecializationInfo<'a>) -> Self { @@ -7869,8 +7881,12 @@ impl<'a> DisplayPropertiesKHR<'a> { self } #[inline] - pub unsafe fn display_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.display_name) + pub unsafe fn display_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.display_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.display_name)) + } } #[inline] pub fn physical_dimensions(mut self, physical_dimensions: Extent2D) -> Self { @@ -9172,8 +9188,12 @@ impl<'a> DebugMarkerObjectNameInfoEXT<'a> { self } #[inline] - pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_object_name) + pub unsafe fn object_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_object_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_object_name)) + } } } #[repr(C)] @@ -9266,8 +9286,12 @@ impl<'a> DebugMarkerMarkerInfoEXT<'a> { self } #[inline] - pub unsafe fn marker_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_marker_name) + pub unsafe fn marker_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_marker_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_marker_name)) + } } #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { @@ -18726,8 +18750,12 @@ impl<'a> DebugUtilsObjectNameInfoEXT<'a> { self } #[inline] - pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_object_name) + pub unsafe fn object_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_object_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_object_name)) + } } } #[repr(C)] @@ -18816,8 +18844,12 @@ impl<'a> DebugUtilsLabelEXT<'a> { self } #[inline] - pub unsafe fn label_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_label_name) + pub unsafe fn label_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_label_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_label_name)) + } } #[inline] pub fn color(mut self, color: [f32; 4]) -> Self { @@ -18961,8 +18993,12 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { self } #[inline] - pub unsafe fn message_id_name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_message_id_name) + pub unsafe fn message_id_name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_message_id_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_message_id_name)) + } } #[inline] pub fn message_id_number(mut self, message_id_number: i32) -> Self { @@ -18975,8 +19011,12 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> { self } #[inline] - pub unsafe fn message_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_message) + pub unsafe fn message_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_message.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_message)) + } } #[inline] pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self { @@ -42334,8 +42374,12 @@ impl<'a> CuFunctionCreateInfoNVX<'a> { self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } } } #[repr(C)] @@ -44790,8 +44834,12 @@ impl<'a> CudaFunctionCreateInfoNV<'a> { self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } } } #[repr(C)] @@ -51450,8 +51498,12 @@ impl<'a> ShaderCreateInfoEXT<'a> { self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } } #[inline] pub fn set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self { @@ -52262,8 +52314,12 @@ impl<'a> PipelineShaderStageNodeCreateInfoAMDX<'a> { self } #[inline] - pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.p_name) + pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } } #[inline] pub fn index(mut self, index: u32) -> Self { diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 0ea1b28ab..3717e19b0 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -838,6 +838,8 @@ impl FieldExt for vkxml::Field { fn is_pointer_to_static_sized_array(&self) -> bool { matches!(self.array, Some(vkxml::ArrayType::Dynamic)) + // TODO: This should not be hardcoded to one field name, but recognize this pattern somehow + // (by checking if the len field is an expression consisting of purely constants) && self.name.as_deref() == Some("pVersionData") } } @@ -2009,8 +2011,12 @@ fn derive_getters_and_setters( } #deprecated #[inline] - pub unsafe fn #param_ident_as_c_str(&self) -> &core::ffi::CStr { - core::ffi::CStr::from_ptr(self.#param_ident) + pub unsafe fn #param_ident_as_c_str(&self) -> Option<&core::ffi::CStr> { + if self.#param_ident.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.#param_ident)) + } } }); } else if is_static_array(field) { @@ -2047,8 +2053,9 @@ fn derive_getters_and_setters( let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None); - // vkxml wrongly annotates static arrays with a len= field is dynamic. These fields have a static length, - // and a runtime field to describe the actual number of valid items in this static array. + // vkxml considers static arrays with len= to be Dynamic (which they are to some + // extent). These fields have a static upper-bound length, and a runtime field to + // describe the actual number of valid items in this static array. if is_static_array(field) { let array_size_ident = format_ident!("{}", array_size.to_snake_case()); let param_ident_short_as_slice = format_ident!("{}_as_slice", param_ident_short);