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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d83ae75..40d104aa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,33 +7,26 @@ 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) + name: Check ash and ash-window MSRV (1.69.0) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - 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@v1 - - uses: dtolnay/rust-toolchain@1.64.0 - - run: cargo check -p ash-window -p examples --all-features + - uses: actions/checkout@v4 + - 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: name: Generated runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - with: - submodules: true + - 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 - name: Run generator run: cargo run -p generator - name: Diff autogen result @@ -45,7 +38,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 @@ -55,7 +48,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - run: cargo fmt --all -- --check clippy: @@ -69,7 +62,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 @@ -90,7 +83,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 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 diff --git a/Cargo.toml b/Cargo.toml index a11a2c018..17b22f707 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,11 @@ [workspace] +resolver = "2" members = [ - "examples", + "analysis", "ash", + "ash-examples", "ash-rewrite", "ash-window", - "analysis", "generator", "generator-rewrite", ] diff --git a/Changelog.md b/Changelog.md index b0654193e..91c554707 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) @@ -28,15 +28,19 @@ 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) +- 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 - 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) +- 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()` @@ -46,6 +50,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) +- Replaced `c_char` array setters with `CStr` setters (#831) ### Removed @@ -434,20 +440,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..56f3fe936 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ 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) -[![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 @@ -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/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/MaikKlein/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/MaikKlein/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) @@ -252,7 +250,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/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 98% rename from examples/src/bin/texture.rs rename to ash-examples/src/bin/texture.rs index 482b5c3db..45b1803f4 100644 --- a/examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -1,13 +1,14 @@ +#![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::*; use ash::vk; - -use examples::*; +use ash_examples::*; #[derive(Clone, Debug, Copy)] struct Vertex { @@ -96,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() @@ -129,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); @@ -157,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() @@ -197,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); @@ -213,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() @@ -252,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]); @@ -268,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() @@ -302,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); @@ -769,7 +770,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/examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs similarity index 98% rename from examples/src/bin/triangle.rs rename to ash-examples/src/bin/triangle.rs index 46eb1ce52..318a6cf4c 100644 --- a/examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -1,11 +1,13 @@ -use ash::util::*; -use ash::vk; -use examples::*; +#![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; +use ash_examples::*; #[derive(Clone, Debug, Copy)] struct Vertex { @@ -86,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); @@ -119,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); @@ -129,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() @@ -189,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); @@ -422,7 +424,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/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/ash-rewrite/Cargo.toml b/ash-rewrite/Cargo.toml index f84365ce1..77cdc05e4 100644 --- a/ash-rewrite/Cargo.toml +++ b/ash-rewrite/Cargo.toml @@ -9,17 +9,19 @@ 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 -rust-version = "1.60.0" +rust-version = "1.69.0" [dependencies] -libloading = { version = "0.7", optional = true } +libloading = { version = "0.8", optional = true } [features] default = ["loaded", "debug"] diff --git a/ash-window/Cargo.toml b/ash-window/Cargo.toml index 76ad7c154..254c8d05d 100644 --- a/ash-window/Cargo.toml +++ b/ash-window/Cargo.toml @@ -1,18 +1,22 @@ [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" +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 ec2cbbf8f..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 @@ -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..307222874 100644 --- a/ash-window/README.md +++ b/ash-window/README.md @@ -1,14 +1,14 @@ ## 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) -[![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 fa424e8bd..8832369c9 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 ", @@ -8,15 +8,21 @@ 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" +rust-version = "1.69.0" [dependencies] -libloading = { version = "0.7", optional = true } +libloading = { version = "0.8", optional = true } [features] default = ["loaded", "debug"] 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..defa19209 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) } } @@ -335,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/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..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)] @@ -41,14 +42,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, - std::ptr::null_mut(), + count.as_mut_ptr(), + 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..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)] @@ -45,14 +46,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, - std::ptr::null_mut(), + count.as_mut_ptr(), + 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 72e7de34b..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) } /// @@ -122,18 +118,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, ); } 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..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)] @@ -24,15 +25,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, - std::ptr::null_mut(), + count.as_mut_ptr(), + 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..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)] @@ -31,9 +32,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(), ptr::null_mut()); + count.assume_init() as usize } /// 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/extensions/nv/ray_tracing.rs b/ash/src/extensions/nv/ray_tracing.rs index 75d718724..794135725 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(), + 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..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; @@ -24,6 +23,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 @@ -42,15 +49,16 @@ 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`")); 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`"), + ); } } } @@ -60,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 @@ -79,24 +87,26 @@ 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`")]; 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`"), + ); } } } #[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 894af0b32..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 { @@ -117,7 +116,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]; 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/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 6646a5292..e2af6480c 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 = ""] @@ -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, @@ -817,9 +828,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", &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 +878,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.device_name, device_name).map(|()| self) + } + #[inline] + 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] pub fn pipeline_cache_uuid(mut self, pipeline_cache_uuid: [u8; UUID_SIZE]) -> Self { @@ -892,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, @@ -900,9 +918,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", &self.extension_name_as_c_str()) .field("spec_version", &self.spec_version) .finish() } @@ -918,9 +934,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.extension_name, extension_name).map(|()| self) + } + #[inline] + 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] pub fn spec_version(mut self, spec_version: u32) -> Self { @@ -931,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, @@ -941,14 +966,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", &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", &self.description_as_c_str()) .finish() } } @@ -965,9 +986,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.layer_name, layer_name).map(|()| self) + } + #[inline] + 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] pub fn spec_version(mut self, spec_version: u32) -> Self { @@ -980,15 +1009,24 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { + wrap_c_str_slice_until_nul(&self.description) } } #[repr(C)] #[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, @@ -1019,21 +1057,37 @@ 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) -> 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 { 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 core::ffi::CStr) -> Self { self.p_engine_name = engine_name.as_ptr(); self } #[inline] + 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 { self.engine_version = engine_version; self @@ -1047,6 +1101,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, @@ -1134,6 +1189,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, @@ -1197,6 +1253,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, @@ -1250,9 +1307,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(); @@ -1288,6 +1345,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, @@ -1361,6 +1419,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, @@ -1396,6 +1455,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], @@ -1439,6 +1499,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, @@ -1492,6 +1553,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, @@ -1518,6 +1580,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, @@ -1544,6 +1607,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, @@ -1582,6 +1646,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, @@ -1602,6 +1667,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, @@ -1622,6 +1688,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, @@ -1667,6 +1734,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, @@ -1693,6 +1761,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, @@ -1731,6 +1800,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, @@ -1757,6 +1827,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, @@ -1783,6 +1854,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, @@ -1835,6 +1907,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 @@ -1876,6 +1953,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, @@ -1949,6 +2027,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, @@ -1984,6 +2063,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, @@ -2061,6 +2141,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, @@ -2135,6 +2216,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, @@ -2161,6 +2243,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, @@ -2193,6 +2276,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, @@ -2231,6 +2315,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, @@ -2269,6 +2354,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, @@ -2357,6 +2443,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, @@ -2452,6 +2539,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, @@ -2578,6 +2666,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, @@ -2616,6 +2705,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, @@ -2697,6 +2787,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, @@ -2723,6 +2814,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, @@ -2761,6 +2853,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, @@ -2805,6 +2898,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, @@ -2839,6 +2933,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, @@ -2873,6 +2968,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, @@ -2907,6 +3003,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, @@ -2999,6 +3096,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, @@ -3037,6 +3135,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], @@ -3080,6 +3179,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, @@ -3124,6 +3224,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, @@ -3150,6 +3251,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, @@ -3194,6 +3296,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, @@ -3232,6 +3335,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, @@ -3289,6 +3393,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, @@ -3342,6 +3447,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, @@ -3398,6 +3504,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, @@ -3418,6 +3525,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, @@ -3481,6 +3589,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, @@ -3537,6 +3646,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, @@ -3563,6 +3673,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, @@ -3600,6 +3711,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, @@ -3646,11 +3758,19 @@ 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) -> 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 { self.p_specialization_info = specialization_info; self @@ -3674,6 +3794,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, @@ -3748,6 +3869,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, @@ -3796,6 +3918,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, @@ -3831,6 +3954,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, @@ -3857,6 +3981,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, @@ -3889,6 +4014,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, @@ -3964,6 +4090,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, @@ -4009,6 +4136,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, @@ -4065,6 +4193,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, @@ -4141,6 +4270,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, @@ -4260,6 +4390,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, @@ -4360,6 +4491,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, @@ -4416,6 +4548,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, @@ -4496,6 +4629,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, @@ -4537,6 +4671,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, @@ -4587,6 +4722,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, @@ -4681,6 +4817,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, @@ -4859,6 +4996,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, @@ -4900,6 +5038,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, @@ -4950,6 +5089,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, @@ -4976,6 +5116,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, @@ -5027,6 +5168,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, @@ -5178,6 +5320,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, @@ -5216,6 +5359,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, @@ -5261,6 +5405,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, @@ -5342,6 +5487,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, @@ -5397,6 +5543,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, @@ -5495,6 +5642,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, @@ -5527,6 +5675,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, @@ -5563,6 +5712,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, @@ -5625,6 +5775,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, @@ -5645,6 +5796,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, @@ -5724,6 +5876,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, @@ -5774,6 +5927,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, @@ -5850,6 +6004,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, @@ -5896,6 +6051,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, @@ -5942,6 +6098,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, @@ -6317,6 +6474,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, @@ -6365,6 +6523,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, @@ -7254,6 +7413,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, @@ -7300,6 +7460,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, @@ -7367,6 +7528,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, @@ -7456,6 +7618,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, @@ -7488,6 +7651,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, @@ -7526,6 +7690,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, @@ -7552,6 +7717,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, @@ -7572,6 +7738,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, @@ -7598,6 +7765,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, @@ -7675,6 +7843,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, @@ -7707,11 +7876,19 @@ 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) -> 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 { self.physical_dimensions = physical_dimensions; self @@ -7741,6 +7918,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, @@ -7761,6 +7939,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, @@ -7781,6 +7960,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, @@ -7801,6 +7981,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, @@ -7839,6 +8020,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, @@ -7901,6 +8083,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, @@ -7981,6 +8164,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, @@ -8027,6 +8211,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, @@ -8098,6 +8283,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, @@ -8136,6 +8322,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, @@ -8174,6 +8361,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, @@ -8219,6 +8407,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, @@ -8264,6 +8453,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, @@ -8309,6 +8499,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, @@ -8354,6 +8545,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, @@ -8399,6 +8591,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, @@ -8437,6 +8630,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, @@ -8475,6 +8669,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, @@ -8520,6 +8715,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, @@ -8540,6 +8736,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, @@ -8687,6 +8884,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, @@ -8761,6 +8959,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, @@ -8819,6 +9018,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, @@ -8857,6 +9057,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, @@ -8908,6 +9109,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, @@ -8944,6 +9146,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, @@ -8980,15 +9183,24 @@ 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) -> 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)] #[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, @@ -9044,6 +9256,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, @@ -9068,11 +9281,19 @@ 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) -> 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 { self.color = color; self @@ -9082,6 +9303,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, @@ -9114,6 +9336,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, @@ -9146,6 +9369,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, @@ -9186,6 +9410,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, @@ -9230,6 +9455,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, @@ -9262,6 +9488,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, @@ -9294,6 +9521,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, @@ -9333,6 +9561,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, @@ -9372,6 +9601,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, @@ -9442,6 +9672,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, @@ -9476,6 +9707,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, @@ -9534,6 +9766,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, @@ -9566,6 +9799,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, @@ -9597,6 +9831,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, @@ -9630,6 +9865,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, @@ -9746,6 +9982,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, @@ -9778,6 +10015,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, @@ -9832,6 +10070,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, @@ -9878,6 +10117,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, } @@ -9892,6 +10132,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, @@ -9918,6 +10159,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, @@ -9944,6 +10186,7 @@ impl BindVertexBufferIndirectCommandNV { #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct SetStateFlagsIndirectCommandNV { pub data: u32, } @@ -9958,6 +10201,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, @@ -9978,6 +10222,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, @@ -10096,6 +10341,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, @@ -10154,6 +10400,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, @@ -10268,6 +10515,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, @@ -10324,6 +10572,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, @@ -10362,6 +10611,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, } @@ -10376,6 +10626,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, @@ -10423,6 +10674,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, @@ -10469,6 +10721,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, @@ -10515,6 +10768,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, @@ -10564,6 +10818,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, @@ -10638,6 +10893,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, @@ -10687,6 +10943,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, @@ -10733,6 +10990,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, @@ -10764,6 +11022,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, @@ -10823,6 +11082,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, @@ -10856,6 +11116,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, @@ -10887,6 +11148,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, @@ -10903,12 +11165,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", &self.driver_name_as_c_str()) + .field("driver_info", &self.driver_info_as_c_str()) .field("conformance_version", &self.conformance_version) .finish() } @@ -10938,14 +11196,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) + } + #[inline] + 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] pub fn conformance_version(mut self, conformance_version: ConformanceVersion) -> Self { @@ -10957,6 +11231,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, @@ -10992,6 +11267,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, @@ -11019,6 +11295,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, @@ -11045,6 +11322,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, @@ -11088,6 +11366,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, @@ -11123,6 +11402,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, @@ -11155,6 +11435,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, @@ -11190,6 +11471,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, @@ -11253,6 +11535,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, @@ -11287,6 +11570,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, @@ -11347,6 +11631,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, @@ -11379,6 +11664,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, @@ -11411,6 +11697,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, @@ -11443,6 +11730,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, @@ -11489,6 +11777,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, @@ -11535,6 +11824,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, @@ -11574,6 +11864,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, @@ -11605,6 +11896,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, @@ -11643,6 +11935,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, @@ -11674,6 +11967,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, @@ -11712,6 +12006,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, @@ -11751,6 +12046,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, @@ -11782,6 +12078,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, @@ -11820,6 +12117,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, @@ -11890,6 +12188,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, @@ -11939,6 +12238,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, @@ -11993,6 +12293,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, @@ -12025,6 +12326,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, @@ -12084,6 +12386,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, @@ -12130,6 +12433,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, @@ -12175,6 +12479,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, @@ -12213,6 +12518,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, @@ -12265,6 +12571,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, @@ -12303,6 +12610,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, @@ -12356,6 +12664,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, @@ -12394,6 +12703,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, @@ -12425,6 +12735,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, @@ -12479,6 +12790,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, @@ -12511,6 +12823,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, @@ -12570,6 +12883,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, @@ -12616,6 +12930,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, @@ -12654,6 +12969,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, @@ -12706,6 +13022,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, @@ -12744,6 +13061,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, @@ -12791,6 +13109,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, @@ -12830,6 +13149,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, @@ -12885,6 +13205,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, @@ -12992,6 +13313,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, @@ -13023,6 +13345,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, @@ -13054,6 +13377,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, @@ -13085,6 +13409,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, @@ -13117,6 +13442,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, @@ -13165,6 +13491,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, @@ -13204,6 +13531,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, @@ -13264,6 +13592,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, @@ -13299,6 +13628,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, @@ -13359,6 +13689,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, @@ -13407,6 +13738,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, @@ -13450,6 +13782,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, @@ -13482,6 +13815,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, @@ -13543,6 +13877,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, @@ -13582,6 +13917,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, @@ -13620,6 +13956,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, @@ -13652,6 +13989,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, @@ -13691,6 +14029,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, @@ -13750,6 +14089,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, @@ -13792,6 +14132,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, @@ -13827,6 +14168,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, @@ -13859,6 +14201,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, @@ -13903,6 +14246,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, @@ -13982,6 +14326,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, @@ -14002,6 +14347,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, @@ -14035,6 +14381,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, @@ -14070,6 +14417,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, @@ -14103,6 +14451,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, @@ -14183,6 +14532,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, @@ -14216,6 +14566,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, @@ -14249,6 +14600,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, } @@ -14263,6 +14615,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, @@ -14301,6 +14654,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, @@ -14336,6 +14690,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, @@ -14356,6 +14711,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, @@ -14394,6 +14750,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, @@ -14432,6 +14789,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, @@ -14470,6 +14828,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, @@ -14490,6 +14849,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, @@ -14536,6 +14896,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, @@ -14568,6 +14929,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, @@ -14614,6 +14976,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, @@ -14647,6 +15010,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, @@ -14700,6 +15064,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, @@ -14739,6 +15104,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, @@ -14765,6 +15131,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, @@ -14804,6 +15171,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, @@ -14850,6 +15218,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, @@ -14896,6 +15265,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, @@ -14942,6 +15312,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, @@ -14973,6 +15344,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, @@ -15007,6 +15379,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, @@ -15041,6 +15414,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, @@ -15079,6 +15453,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, @@ -15110,6 +15485,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, @@ -15145,6 +15521,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, @@ -15203,6 +15580,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, @@ -15256,6 +15634,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, @@ -15293,6 +15672,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, @@ -15324,6 +15704,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, @@ -15355,6 +15736,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, @@ -15401,6 +15783,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, @@ -15432,6 +15815,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, @@ -15470,6 +15854,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, @@ -15516,6 +15901,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, @@ -15550,6 +15936,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, @@ -15585,6 +15972,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, @@ -15624,6 +16012,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, @@ -15663,6 +16052,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, @@ -15695,6 +16085,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, @@ -15734,6 +16125,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, @@ -15770,6 +16162,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, @@ -15803,6 +16196,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, @@ -15901,6 +16295,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, @@ -15933,6 +16328,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, @@ -15965,6 +16361,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, @@ -15999,6 +16396,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, @@ -16035,6 +16433,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, @@ -16070,6 +16469,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, @@ -16115,6 +16515,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, @@ -16147,6 +16548,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, @@ -16180,6 +16582,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, @@ -16213,6 +16616,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, @@ -16258,6 +16662,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, @@ -16308,6 +16713,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, @@ -16354,6 +16760,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, @@ -16374,6 +16781,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, @@ -16427,6 +16835,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>, @@ -16451,6 +16860,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>, @@ -16475,6 +16885,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, @@ -16528,6 +16939,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, @@ -16574,6 +16986,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, @@ -16644,6 +17057,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, @@ -16678,6 +17092,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, @@ -16710,6 +17125,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, @@ -16747,6 +17163,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, @@ -16780,6 +17197,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, @@ -16868,6 +17286,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, @@ -16918,6 +17337,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, @@ -16963,6 +17383,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, @@ -17039,6 +17460,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, @@ -17074,6 +17496,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, @@ -17110,6 +17533,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, @@ -17176,6 +17600,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, @@ -17213,6 +17638,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, @@ -17254,6 +17680,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, @@ -17288,6 +17715,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, @@ -17327,6 +17755,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, @@ -17360,6 +17789,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, @@ -17392,6 +17822,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, @@ -17425,6 +17856,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, @@ -17512,6 +17944,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, @@ -17567,6 +18000,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, @@ -17613,6 +18047,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, @@ -17647,6 +18082,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, @@ -17688,6 +18124,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, @@ -17877,6 +18314,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, @@ -17910,6 +18348,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, @@ -17930,6 +18369,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, @@ -17989,6 +18429,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, @@ -18020,6 +18461,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, @@ -18052,6 +18494,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, @@ -18090,6 +18533,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, @@ -18154,6 +18598,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, @@ -18187,6 +18632,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, @@ -18221,6 +18667,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, @@ -18264,6 +18711,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, @@ -18297,15 +18745,24 @@ 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) -> 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)] #[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, @@ -18357,6 +18814,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, @@ -18381,11 +18839,19 @@ 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) -> 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 { self.color = color; self @@ -18394,6 +18860,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, @@ -18474,6 +18941,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, @@ -18520,21 +18988,37 @@ 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) -> 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 { 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 core::ffi::CStr) -> Self { self.p_message = message.as_ptr(); self } #[inline] + 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 { self.queue_label_count = queue_labels.len() as _; self.p_queue_labels = queue_labels.as_ptr(); @@ -18574,6 +19058,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, @@ -18607,6 +19092,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, @@ -18672,6 +19158,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, @@ -18741,6 +19228,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, @@ -18780,6 +19268,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, @@ -18811,6 +19300,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, @@ -18847,6 +19337,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, @@ -18961,6 +19452,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, @@ -18992,6 +19484,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, @@ -19115,6 +19608,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, @@ -19158,6 +19652,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, @@ -19214,6 +19709,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, @@ -19456,6 +19952,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, @@ -19729,6 +20226,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, @@ -19765,6 +20263,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, @@ -19804,6 +20303,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, @@ -19840,6 +20340,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, @@ -19942,6 +20443,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, @@ -20002,6 +20504,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, @@ -20113,6 +20616,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, @@ -20208,6 +20712,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, @@ -20294,6 +20799,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, @@ -20325,6 +20831,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, @@ -20364,6 +20871,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, @@ -20398,6 +20906,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, @@ -20434,6 +20943,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, @@ -20474,6 +20984,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, @@ -20520,6 +21031,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, @@ -20569,6 +21081,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, @@ -20607,6 +21120,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, @@ -20627,6 +21141,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, @@ -20669,6 +21184,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, @@ -20705,6 +21221,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, @@ -20759,6 +21276,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, @@ -20792,6 +21310,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, @@ -20824,6 +21343,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, @@ -20880,6 +21400,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, @@ -20912,6 +21433,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, @@ -21003,6 +21525,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, @@ -21039,6 +21562,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, @@ -21075,6 +21599,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, @@ -21125,6 +21650,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, @@ -21169,6 +21695,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, @@ -21224,6 +21751,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, @@ -21265,6 +21793,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, @@ -21394,6 +21923,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, @@ -21535,6 +22065,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, @@ -21583,6 +22114,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, @@ -21618,6 +22150,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, @@ -21656,6 +22189,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, @@ -21716,6 +22250,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, @@ -21765,6 +22300,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, @@ -21797,6 +22333,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, @@ -21830,6 +22367,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, @@ -21871,6 +22409,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, @@ -21987,6 +22526,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, @@ -22030,6 +22570,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, @@ -22067,6 +22608,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, @@ -22106,6 +22648,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, @@ -22140,6 +22683,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, @@ -22179,6 +22723,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, @@ -22213,6 +22758,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, @@ -22260,6 +22806,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, @@ -22294,6 +22841,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, @@ -22337,6 +22885,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, @@ -22371,6 +22920,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, @@ -22404,6 +22954,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, @@ -22438,6 +22989,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, @@ -22484,6 +23036,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, @@ -22514,6 +23067,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, @@ -22563,6 +23117,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, @@ -22607,6 +23162,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, @@ -22654,6 +23210,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, @@ -22688,6 +23245,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, @@ -22714,6 +23272,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, @@ -22755,6 +23314,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, @@ -22804,6 +23364,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, @@ -22844,6 +23405,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, @@ -22966,6 +23528,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, @@ -22986,6 +23549,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, @@ -23051,6 +23615,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, @@ -23303,6 +23868,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, @@ -23329,6 +23895,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, @@ -23388,6 +23955,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, @@ -23457,6 +24025,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, @@ -23551,6 +24120,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, @@ -23672,6 +24242,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, @@ -23773,6 +24344,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, @@ -23825,6 +24397,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>, @@ -23846,6 +24419,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, @@ -23891,6 +24465,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, @@ -23946,6 +24521,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, @@ -24002,6 +24578,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, @@ -24060,6 +24637,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, @@ -24099,6 +24677,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, @@ -24138,6 +24717,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, @@ -24180,6 +24760,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, @@ -24255,6 +24836,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, @@ -24332,6 +24914,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, @@ -24365,6 +24948,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, @@ -24470,6 +25054,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, @@ -24558,6 +25143,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, @@ -24643,6 +25229,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, @@ -24669,6 +25256,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, @@ -24695,6 +25283,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, @@ -24817,6 +25406,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, @@ -24862,6 +25452,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, @@ -24900,6 +25491,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, @@ -24929,6 +25521,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, @@ -24982,6 +25575,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, @@ -25018,6 +25612,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, @@ -25061,6 +25656,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, @@ -25092,6 +25688,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, @@ -25125,6 +25722,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, @@ -25161,6 +25759,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, @@ -25213,6 +25812,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, @@ -25247,6 +25847,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, @@ -25284,6 +25885,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, @@ -25337,6 +25939,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, @@ -25401,6 +26004,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, @@ -25440,6 +26044,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, @@ -25477,6 +26082,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, @@ -25513,6 +26119,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, @@ -25547,6 +26154,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, @@ -25579,6 +26187,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, @@ -25616,6 +26225,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, @@ -25650,6 +26260,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, @@ -25693,6 +26304,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, @@ -25733,6 +26345,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, @@ -25767,6 +26380,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, @@ -25799,6 +26413,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, @@ -25836,6 +26451,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, @@ -25890,6 +26506,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, @@ -25944,6 +26561,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, @@ -25975,6 +26593,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, @@ -26007,6 +26626,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, @@ -26039,6 +26659,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, @@ -26075,6 +26696,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, @@ -26115,6 +26737,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, @@ -26149,6 +26772,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, @@ -26187,6 +26811,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, @@ -26256,6 +26881,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, @@ -26291,6 +26917,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, @@ -26325,6 +26952,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, @@ -26370,6 +26998,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, @@ -26406,6 +27035,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, @@ -26486,6 +27116,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, @@ -26520,6 +27151,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, @@ -26565,6 +27197,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, @@ -26603,6 +27236,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, @@ -26635,6 +27269,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, @@ -26655,6 +27290,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, @@ -26707,6 +27343,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, @@ -26740,6 +27377,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, @@ -26774,6 +27412,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, @@ -26810,6 +27449,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, @@ -26844,6 +27484,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, @@ -26876,6 +27517,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, @@ -26908,6 +27550,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, @@ -26956,6 +27599,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, @@ -26992,6 +27636,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, @@ -27043,6 +27688,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, @@ -27059,15 +27705,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", &self.name_as_c_str()) + .field("category", &self.category_as_c_str()) + .field("description", &self.description_as_c_str()) .finish() } } @@ -27095,25 +27735,50 @@ 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: &core::ffi::CStr, + ) -> core::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 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: [c_char; MAX_DESCRIPTION_SIZE]) -> Self { - self.description = description; - self + pub fn category( + mut self, + category: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.category, category).map(|()| self) + } + #[inline] + 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + pub fn description_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { + wrap_c_str_slice_until_nul(&self.description) } } #[repr(C)] #[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, @@ -27173,6 +27838,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, @@ -27211,6 +27877,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, @@ -27244,6 +27911,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, @@ -27275,6 +27943,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, @@ -27309,6 +27978,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, @@ -27355,6 +28025,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, @@ -27410,6 +28081,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, @@ -27462,6 +28134,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, @@ -27491,6 +28164,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, @@ -27522,6 +28196,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, @@ -27558,6 +28233,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, @@ -27589,6 +28265,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, @@ -27620,6 +28297,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, @@ -27665,6 +28343,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, @@ -27697,6 +28376,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, @@ -27737,6 +28417,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, @@ -27771,6 +28452,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, @@ -27811,6 +28493,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, @@ -27845,6 +28528,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, @@ -27905,6 +28589,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, @@ -27942,6 +28627,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, @@ -27974,6 +28660,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, @@ -28024,6 +28711,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, @@ -28063,6 +28751,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, @@ -28100,6 +28789,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, @@ -28130,6 +28820,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, @@ -28146,12 +28837,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", &self.name_as_c_str()) + .field("description", &self.description_as_c_str()) .field("subgroup_size", &self.subgroup_size) .finish() } @@ -28180,14 +28867,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 subgroup_size(mut self, subgroup_size: u32) -> Self { @@ -28199,6 +28902,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, @@ -28251,6 +28955,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, @@ -28266,12 +28971,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", &self.name_as_c_str()) + .field("description", &self.description_as_c_str()) .field("format", &self.format) .field("value", &"union") .finish() @@ -28296,14 +28997,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 format(mut self, format: PipelineExecutableStatisticFormatKHR) -> Self { @@ -28319,6 +29036,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, @@ -28335,12 +29053,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", &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) @@ -28368,14 +29082,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 is_text(mut self, is_text: bool) -> Self { @@ -28393,6 +29123,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, @@ -28433,6 +29164,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, @@ -28467,6 +29199,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, @@ -28537,6 +29270,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, @@ -28578,6 +29312,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, @@ -28635,6 +29370,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, @@ -28672,6 +29408,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, @@ -28712,6 +29449,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, @@ -28749,6 +29487,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, @@ -28809,6 +29548,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, @@ -28842,6 +29582,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, @@ -28873,6 +29614,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, @@ -28942,6 +29684,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, @@ -28975,6 +29718,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, @@ -29035,6 +29779,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, @@ -29075,6 +29820,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, @@ -29192,6 +29938,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, @@ -29334,6 +30081,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, @@ -29779,6 +30527,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, @@ -29843,12 +30592,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", &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", @@ -30112,14 +30857,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.driver_info, driver_info).map(|()| self) + } + #[inline] + 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] pub fn conformance_version(mut self, conformance_version: ConformanceVersion) -> Self { @@ -30520,6 +31281,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, @@ -30665,6 +31427,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, @@ -31110,6 +31873,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, @@ -31150,6 +31914,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, @@ -31183,6 +31948,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, @@ -31199,19 +31965,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", &self.name_as_c_str()) + .field("version", &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", &self.description_as_c_str()) + .field("layer", &self.layer_as_c_str()) .finish() } } @@ -31235,14 +31993,30 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.version, version).map(|()| self) + } + #[inline] + 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] pub fn purposes(mut self, purposes: ToolPurposeFlags) -> Self { @@ -31250,19 +32024,36 @@ 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: &core::ffi::CStr, + ) -> core::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 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.layer, layer).map(|()| self) + } + #[inline] + pub fn layer_as_c_str( + &self, + ) -> core::result::Result<&core::ffi::CStr, core::ffi::FromBytesUntilNulError> { + wrap_c_str_slice_until_nul(&self.layer) } } #[repr(C)] #[derive(Copy, Clone)] #[doc = ""] +#[must_use] pub struct SamplerCustomBorderColorCreateInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, @@ -31314,6 +32105,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, @@ -31350,6 +32142,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, @@ -31394,6 +32187,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, @@ -31434,6 +32228,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, @@ -31516,6 +32311,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, @@ -31623,6 +32419,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, @@ -31672,6 +32469,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, @@ -31735,6 +32533,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, @@ -31791,6 +32590,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, @@ -31909,6 +32709,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, @@ -31941,6 +32742,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, @@ -32025,6 +32827,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, @@ -32091,6 +32894,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, @@ -32126,6 +32930,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, @@ -32157,6 +32962,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, @@ -32201,6 +33007,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, @@ -32258,6 +33065,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, @@ -32316,6 +33124,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, @@ -32358,6 +33167,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, @@ -32393,6 +33203,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, @@ -32427,6 +33238,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, @@ -32482,6 +33294,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, @@ -32848,6 +33661,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, @@ -32888,6 +33702,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, @@ -32932,6 +33747,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, @@ -32970,6 +33786,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, @@ -33002,6 +33819,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, @@ -33035,6 +33853,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, @@ -33078,6 +33897,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, @@ -33112,6 +33932,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, @@ -33144,6 +33965,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, @@ -33185,6 +34007,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, @@ -33228,6 +34051,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, @@ -33275,6 +34099,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, @@ -33323,6 +34148,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, @@ -33356,6 +34182,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, @@ -33429,6 +34256,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, @@ -33574,6 +34402,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, @@ -33610,6 +34439,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, @@ -33650,6 +34480,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, @@ -33684,6 +34515,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, @@ -33731,6 +34563,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, @@ -33776,6 +34609,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, @@ -33835,6 +34669,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, @@ -33902,6 +34737,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, @@ -33983,6 +34819,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, @@ -34042,6 +34879,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, @@ -34090,6 +34928,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, @@ -34152,6 +34991,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, @@ -34236,6 +35076,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, @@ -34291,6 +35132,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, @@ -34346,6 +35188,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, @@ -34408,6 +35251,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, @@ -34449,6 +35293,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, @@ -34494,6 +35339,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, @@ -34537,6 +35383,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, @@ -34591,6 +35438,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, @@ -34797,6 +35645,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, @@ -34835,6 +35684,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, @@ -34869,6 +35719,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, @@ -34926,6 +35777,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, @@ -34966,6 +35818,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, @@ -35016,6 +35869,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, @@ -35062,6 +35916,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, @@ -35103,6 +35958,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, @@ -35137,6 +35993,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, @@ -35182,6 +36039,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, @@ -35216,6 +36074,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, @@ -35243,6 +36102,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, @@ -35282,6 +36142,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, @@ -35316,6 +36177,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, @@ -35352,6 +36214,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, @@ -35389,6 +36252,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, @@ -35423,6 +36287,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, @@ -35475,6 +36340,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, @@ -35527,6 +36393,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, @@ -35561,6 +36428,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, @@ -35596,6 +36464,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, @@ -35649,6 +36518,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, @@ -35758,6 +36628,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, @@ -35860,6 +36731,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, @@ -35927,6 +36799,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, @@ -35979,6 +36852,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, @@ -36017,6 +36891,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, @@ -36102,6 +36977,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, @@ -36137,6 +37013,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, @@ -36175,6 +37052,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, @@ -36208,6 +37086,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, @@ -36242,6 +37121,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, @@ -36308,6 +37188,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, @@ -36374,6 +37255,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, @@ -36440,6 +37322,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, @@ -36495,6 +37378,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, @@ -36550,6 +37434,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, @@ -36619,6 +37504,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, @@ -36671,6 +37557,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, @@ -36703,6 +37590,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, @@ -36743,6 +37631,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, @@ -36802,6 +37691,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, @@ -36836,6 +37726,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, @@ -36879,6 +37770,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, @@ -36911,6 +37803,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, @@ -36956,6 +37849,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, @@ -36993,6 +37887,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, @@ -37028,6 +37923,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, @@ -37061,6 +37957,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, @@ -37099,6 +37996,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, @@ -37148,6 +38046,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, @@ -37214,6 +38113,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, @@ -37288,6 +38188,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, @@ -37396,6 +38297,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, @@ -37434,6 +38336,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, @@ -37486,6 +38389,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, @@ -37538,6 +38442,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, @@ -37594,6 +38499,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, @@ -37626,6 +38532,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, @@ -37659,6 +38566,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, @@ -37756,6 +38664,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, @@ -37796,6 +38705,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, @@ -37835,6 +38745,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, @@ -37884,6 +38795,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, @@ -37937,6 +38849,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, @@ -37979,6 +38892,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, @@ -38014,6 +38928,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, @@ -38047,6 +38962,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, @@ -38079,6 +38995,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, @@ -38138,6 +39055,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, @@ -38198,6 +39116,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, @@ -38240,6 +39159,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, @@ -38275,6 +39195,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, @@ -38377,6 +39298,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, @@ -38443,6 +39365,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, @@ -38492,6 +39415,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, @@ -38545,6 +39469,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, @@ -38595,6 +39520,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, @@ -38668,6 +39594,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, @@ -38699,6 +39626,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, @@ -38745,6 +39673,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, @@ -38792,6 +39721,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, @@ -38899,6 +39829,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, @@ -38935,6 +39866,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, @@ -38968,6 +39900,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, @@ -39007,6 +39940,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, @@ -39069,6 +40003,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, @@ -39139,6 +40074,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, @@ -39209,6 +40145,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, @@ -39292,6 +40229,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, @@ -39417,6 +40355,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, @@ -39524,6 +40463,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, @@ -39563,6 +40503,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, @@ -39612,6 +40553,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, @@ -39665,6 +40607,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, @@ -39722,6 +40665,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, @@ -39765,6 +40709,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, @@ -39800,6 +40745,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, @@ -39852,6 +40798,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, @@ -39885,6 +40832,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, @@ -39923,6 +40871,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, @@ -39984,6 +40933,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, @@ -40010,6 +40960,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, @@ -40036,6 +40987,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, @@ -40090,6 +41042,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, @@ -40161,6 +41114,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, @@ -40311,6 +41265,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, @@ -40408,6 +41363,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, @@ -40447,6 +41403,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, @@ -40506,6 +41463,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, @@ -40566,6 +41524,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, @@ -40637,6 +41596,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, @@ -40687,6 +41647,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, @@ -40732,6 +41693,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, @@ -40774,6 +41736,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, @@ -40835,6 +41798,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, @@ -40861,6 +41825,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, @@ -40887,6 +41852,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, @@ -40941,6 +41907,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, @@ -41012,6 +41979,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, @@ -41045,6 +42013,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, @@ -41080,6 +42049,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, @@ -41117,6 +42087,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, @@ -41167,6 +42138,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, @@ -41201,6 +42173,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, @@ -41246,6 +42219,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, @@ -41293,6 +42267,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, @@ -41329,6 +42304,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, @@ -41363,6 +42339,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, @@ -41392,15 +42369,24 @@ 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) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } + } } #[repr(C)] #[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, @@ -41501,6 +42487,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, @@ -41565,6 +42552,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, @@ -41907,6 +42895,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, @@ -41947,6 +42936,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, @@ -41992,6 +42982,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, @@ -42045,6 +43036,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, @@ -42101,6 +43093,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, @@ -42150,6 +43143,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, @@ -42181,6 +43175,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, @@ -42212,6 +43207,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, @@ -42244,6 +43240,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, @@ -42275,6 +43272,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, @@ -42320,6 +43318,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, @@ -42367,6 +43366,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, @@ -42401,6 +43401,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, @@ -42726,6 +43727,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, @@ -42793,6 +43795,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, @@ -42830,6 +43833,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, @@ -42870,6 +43874,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, @@ -42914,6 +43919,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, @@ -42960,6 +43966,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, @@ -42999,6 +44006,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, @@ -43140,6 +44148,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, @@ -43178,6 +44187,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, @@ -43216,6 +44226,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, @@ -43255,6 +44266,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, @@ -43295,6 +44307,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, @@ -43335,6 +44348,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, @@ -43366,6 +44380,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, @@ -43476,6 +44491,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, @@ -43527,6 +44543,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, @@ -43558,6 +44575,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, @@ -43623,6 +44641,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, @@ -43677,6 +44696,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, @@ -43744,6 +44764,7 @@ handle_nondispatchable ! (CudaFunctionNV , CUDA_FUNCTION_NV , doc = " { pub s_type: StructureType, pub p_next: *const c_void, @@ -43778,6 +44799,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, @@ -43807,15 +44829,24 @@ 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) -> Option<&core::ffi::CStr> { + if self.p_name.is_null() { + None + } else { + Some(core::ffi::CStr::from_ptr(self.p_name)) + } + } } #[repr(C)] #[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, @@ -43916,6 +44947,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, @@ -43954,6 +44986,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, @@ -44000,6 +45033,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, @@ -44038,6 +45072,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, @@ -44067,6 +45102,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, @@ -44158,6 +45194,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, @@ -44214,6 +45251,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, @@ -44310,6 +45348,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, @@ -44407,6 +45446,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, @@ -44457,6 +45497,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, @@ -44497,6 +45538,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, @@ -44530,6 +45572,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, @@ -44600,6 +45643,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, @@ -44649,6 +45693,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, @@ -44693,6 +45738,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, @@ -44727,6 +45773,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, @@ -44759,6 +45806,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, @@ -44827,6 +45875,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, @@ -44861,6 +45910,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, @@ -44898,6 +45948,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, @@ -44948,6 +45999,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, @@ -44980,6 +46032,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, @@ -45017,6 +46070,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, @@ -45055,6 +46109,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, @@ -45094,6 +46149,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, @@ -45148,6 +46204,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, @@ -45187,6 +46244,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, @@ -45221,6 +46279,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, @@ -45260,6 +46319,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, @@ -45299,6 +46359,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, @@ -45337,6 +46398,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, @@ -45384,6 +46446,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, @@ -45421,6 +46484,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, @@ -45468,6 +46532,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, @@ -45511,6 +46576,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, @@ -45542,6 +46608,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, @@ -45588,6 +46655,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, @@ -45621,6 +46689,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, } @@ -45635,6 +46704,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, @@ -45670,6 +46740,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], @@ -45680,9 +46751,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", &self.description_as_c_str()) .field("post_merge_index", &self.post_merge_index) .finish() } @@ -45704,9 +46773,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 post_merge_index(mut self, post_merge_index: u32) -> Self { @@ -45718,6 +46795,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, @@ -45754,6 +46832,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, @@ -45787,6 +46866,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, @@ -45905,6 +46985,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, @@ -45971,6 +47052,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, @@ -46002,6 +47084,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, @@ -46046,6 +47129,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, @@ -46102,6 +47186,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, @@ -46159,6 +47244,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, @@ -46204,6 +47290,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, @@ -46230,6 +47317,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, @@ -46256,6 +47344,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, @@ -46304,6 +47393,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, @@ -46349,6 +47439,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, @@ -46448,6 +47539,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, @@ -46482,6 +47574,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, @@ -46521,6 +47614,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, @@ -46717,6 +47811,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, @@ -46748,6 +47843,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, @@ -46782,6 +47878,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, @@ -46825,6 +47922,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, @@ -46860,6 +47958,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, @@ -46898,6 +47997,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, @@ -46937,6 +48037,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, @@ -46969,6 +48070,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, @@ -47008,6 +48110,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, @@ -47047,6 +48150,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, @@ -47079,6 +48183,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, @@ -47139,6 +48244,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, @@ -47178,6 +48284,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, @@ -47217,6 +48324,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, @@ -47249,6 +48357,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, @@ -47295,6 +48404,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, @@ -47328,6 +48438,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, @@ -47362,6 +48473,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, @@ -47396,6 +48508,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, @@ -47452,6 +48565,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, @@ -47518,6 +48632,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, @@ -47564,6 +48679,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, @@ -47612,6 +48728,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, @@ -47666,6 +48783,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, @@ -47700,6 +48818,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, @@ -47745,6 +48864,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, @@ -47779,6 +48899,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, @@ -47818,6 +48939,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, @@ -47858,6 +48980,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, @@ -47892,6 +49015,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, @@ -47926,6 +49050,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, @@ -47979,6 +49104,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, @@ -48012,6 +49138,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, @@ -48120,6 +49247,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, @@ -48153,6 +49281,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, @@ -48184,6 +49313,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, @@ -48286,6 +49416,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, @@ -48336,6 +49467,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, @@ -48377,6 +49509,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, @@ -48417,6 +49550,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, @@ -48442,6 +49576,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, @@ -48451,9 +49586,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", &self.description_as_c_str()) .field("vendor_fault_code", &self.vendor_fault_code) .field("vendor_fault_data", &self.vendor_fault_data) .finish() @@ -48471,9 +49604,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 vendor_fault_code(mut self, vendor_fault_code: u64) -> Self { @@ -48490,6 +49631,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, @@ -48534,6 +49676,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, @@ -48549,9 +49692,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", &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) @@ -48577,9 +49718,17 @@ 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: &core::ffi::CStr, + ) -> core::result::Result { + write_c_str_slice_with_nul(&mut self.description, description).map(|()| self) + } + #[inline] + 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 address_infos(mut self, address_infos: &'a mut DeviceFaultAddressInfoEXT) -> Self { @@ -48601,6 +49750,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, @@ -48696,6 +49846,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, @@ -48733,6 +49884,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, @@ -48793,6 +49945,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, @@ -48836,6 +49989,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, @@ -48877,6 +50031,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, @@ -48924,6 +50079,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, @@ -48958,6 +50114,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, @@ -49037,6 +50194,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, @@ -49071,6 +50229,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, @@ -49114,6 +50273,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, @@ -49146,6 +50306,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, @@ -49215,6 +50376,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, @@ -49250,6 +50412,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, @@ -49284,6 +50447,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, @@ -49319,6 +50483,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, @@ -49354,6 +50519,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, @@ -49389,6 +50555,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, @@ -49435,6 +50602,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, @@ -49476,6 +50644,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, @@ -49535,6 +50704,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, @@ -49572,6 +50742,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, @@ -49613,6 +50784,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, @@ -49650,6 +50822,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, @@ -49708,6 +50881,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, @@ -49763,9 +50937,10 @@ 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: *mut c_void, + pub p_next: *const c_void, pub mode: DirectDriverLoadingModeLUNARG, pub driver_count: u32, pub p_drivers: *const DirectDriverLoadingInfoLUNARG<'a>, @@ -49776,7 +50951,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(), @@ -49805,6 +50980,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, @@ -49842,6 +51018,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, @@ -49879,6 +51056,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, @@ -49917,6 +51095,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, @@ -49963,6 +51142,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, @@ -50003,6 +51183,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, @@ -50040,6 +51221,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, @@ -50072,6 +51254,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, @@ -50124,6 +51307,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, @@ -50162,6 +51346,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, @@ -50195,6 +51380,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, @@ -50235,6 +51421,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, @@ -50306,11 +51493,19 @@ 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) -> 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 { self.set_layout_count = set_layouts.len() as _; self.p_set_layouts = set_layouts.as_ptr(); @@ -50346,6 +51541,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, @@ -50403,6 +51599,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, @@ -50462,6 +51659,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, @@ -50494,6 +51692,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, @@ -50547,6 +51746,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, @@ -50641,6 +51841,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, @@ -50674,6 +51875,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, @@ -50711,6 +51913,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, @@ -50756,6 +51959,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, @@ -50843,6 +52047,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, @@ -50879,6 +52084,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, @@ -50953,6 +52159,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, @@ -50987,6 +52194,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, @@ -51074,6 +52282,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, @@ -51100,11 +52309,19 @@ 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) -> 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 { self.index = index; self @@ -51114,6 +52331,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, @@ -51144,6 +52362,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, @@ -51186,6 +52405,7 @@ impl DispatchGraphInfoAMDX { #[repr(C)] #[derive(Copy, Clone, Default)] #[doc = ""] +#[must_use] pub struct DispatchGraphCountInfoAMDX { pub count: u32, pub infos: DeviceOrHostAddressConstAMDX, @@ -51222,6 +52442,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, @@ -51255,6 +52476,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, @@ -51289,6 +52511,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, @@ -51332,6 +52555,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, @@ -51366,6 +52590,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, @@ -51398,6 +52623,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, @@ -51430,6 +52656,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, @@ -51464,6 +52691,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, @@ -51497,6 +52725,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, @@ -51540,6 +52769,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, @@ -51577,6 +52807,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, @@ -51610,6 +52841,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, @@ -51647,6 +52879,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, @@ -51707,6 +52940,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, @@ -51743,6 +52977,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, @@ -51788,6 +53023,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, @@ -51826,6 +53062,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, @@ -51864,9 +53101,11 @@ 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, + pub timing_count: u32, pub p_timings: *mut LatencyTimingsFrameReportNV<'a>, pub _marker: PhantomData<&'a ()>, } @@ -51876,6 +53115,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, } @@ -51886,8 +53126,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<'_>]) -> Self { + self.timing_count = timings.len() as _; + self.p_timings = timings.as_mut_ptr().cast(); self } } @@ -51895,6 +53136,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, @@ -52017,6 +53259,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, @@ -52048,6 +53291,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, @@ -52081,6 +53325,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, @@ -52113,6 +53358,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, @@ -52148,6 +53394,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, @@ -52182,6 +53429,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, @@ -52222,6 +53470,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, @@ -52256,6 +53505,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, @@ -52290,6 +53540,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, @@ -52322,3 +53573,41 @@ impl<'a> PhysicalDeviceSchedulingControlsPropertiesARM<'a> { self } } +#[repr(C)] +#[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, + 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/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/ash/src/vk/prelude.rs b/ash/src/vk/prelude.rs index cb2f17718..626cd7888 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,47 @@ impl From for vk::Rect2D { pub unsafe trait TaggedStructure { const STRUCTURE_TYPE: vk::StructureType; } + +#[inline] +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)] +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: &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 { core::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-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..046fafd3d 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -3,19 +3,20 @@ name = "generator" version = "0.1.0" authors = ["Maik Klein "] edition = "2021" +publish = false [dependencies] -bindgen = "0.64" +bindgen = "0.69" heck = "0.4" -itertools = "0.10" +itertools = "0.12" nom = "7.1" 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] -version = "1.0" +version = "2.0" features = ["full", "extra-traits"] 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 diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 3cc8ad857..3717e19b0 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") @@ -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) } } } @@ -841,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") } } @@ -1711,7 +1710,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 +1813,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,26 +1835,20 @@ 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" { - quote! { - &unsafe { - ::std::ffi::CStr::from_ptr(self.#param_ident.as_ptr()) - } - } + 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 ())) - } + 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!(<'_>)); @@ -1857,7 +1865,7 @@ fn derive_debug( Some(q) } -fn derive_setters( +fn derive_getters_and_setters( struct_: &vkxml::Struct, members: &[PreprocessedMember<'_>], root_structs: &HashSet, @@ -1893,6 +1901,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() @@ -1935,7 +1946,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); @@ -1986,90 +1997,148 @@ 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!{ - #[inline] + return Some(quote! { #deprecated - pub fn #param_ident_short(mut self, #param_ident_short: &'a ::std::ffi::CStr) -> Self { + #[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 } + #deprecated + #[inline] + 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) { + assert_eq!(field.size, None); + return Some(quote! { + #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) + } + #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) + } }); } + } + + // TODO: Improve in future when https://github.com/rust-lang/rust/issues/53667 is merged id:6 + 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()) + } 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()) + }; - 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); + 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()) + // 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); + 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_mut_ptr()) + 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]); - 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 - }; + array_size + }; - let array_size_ident = format_ident!("{}", array_size.to_snake_case()); + let array_size_ident = format_ident!("{}", array_size.to_snake_case()); - let size_field = members.iter().find(|member| member.vkxml_field.name.as_deref() == Some(array_size)).unwrap(); + 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 _) - }; - - 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! { + #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; + self + } + }); } } 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 @@ -2089,8 +2158,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; @@ -2108,8 +2177,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 @@ -2369,7 +2438,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))]) @@ -2387,6 +2456,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