From 07736487d6ab522ce1f7cd52c0d05cb0456ced8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 30 Jun 2024 13:19:35 +0200 Subject: [PATCH] Fix typos and introduce a workflow (#2537) * Fix typos and introduce a workflow * Revert vk.xml * Update .typos.toml * fix typos config --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/rust.yml | 12 +++++++++--- .typos.toml | 14 ++++++++++++++ CHANGELOG.md | 16 ++++++++-------- README.md | 4 ++-- examples/README.md | 2 +- examples/async-update/main.rs | 12 ++++++------ examples/dynamic-local-size/main.rs | 2 +- examples/indirect/main.rs | 4 ++-- examples/self-copy-buffer/main.rs | 8 ++++---- examples/shader-types-derive/main.rs | 2 +- examples/simple-particles/main.rs | 16 ++++++++-------- examples/triangle-util/main.rs | 2 +- vulkano/src/buffer/mod.rs | 2 +- vulkano/src/buffer/subbuffer.rs | 6 +++--- vulkano/src/command_buffer/allocator.rs | 2 +- vulkano/src/command_buffer/sys.rs | 2 +- vulkano/src/descriptor_set/allocator.rs | 2 +- vulkano/src/descriptor_set/layout.rs | 2 +- vulkano/src/image/mod.rs | 2 +- vulkano/src/lib.rs | 2 +- vulkano/src/memory/allocator/mod.rs | 2 +- vulkano/src/memory/allocator/suballocator/mod.rs | 2 +- vulkano/src/memory/device_memory.rs | 2 +- vulkano/src/range_map.rs | 2 +- vulkano/src/shader/spirv/mod.rs | 4 ++-- vulkano/src/swapchain/surface.rs | 2 +- 27 files changed, 75 insertions(+), 55 deletions(-) create mode 100644 .typos.toml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index eaeab4dd..c552e5b8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,7 +14,7 @@ Please remove any items from the template below that are not applicable. 6. [ ] Describe in common words what is the purpose of this change, related - Github Issues, and highlight important implementation aspects. + GitHub Issues, and highlight important implementation aspects. Changelog: ```markdown diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b3b7c422..46f1023b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,7 +29,7 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 if: ${{ ! matrix.self-hosted }} @@ -44,7 +44,7 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: rustup toolchain install stable --component clippy - uses: Swatinem/rust-cache@v2 with: @@ -55,7 +55,13 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: rustup toolchain install nightly --component rustfmt - name: Run fmt check run: cargo +nightly fmt --check + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run typos + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..db8a6288 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,14 @@ +[files] +extend-exclude = [ + ".git/", + "vulkano/spirv.core.grammar.json", + "vulkano/vk.xml", +] +ignore-hidden = false + +[default.extend-words] +lod = "lod" +uscaled = "uscaled" + +[default.extend-identifiers] +ANDed = "ANDed" diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f25939d..8daf0cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -363,7 +363,7 @@ Changes to the physical device: - vulkano-shaders: Use a placeholder name instead of erroring out, when the shader doesn't contain a name for a struct. - [#2203](https://github.com/vulkano-rs/vulkano/issues/2203): Shader reflection fails to find descriptor set variables if multiple `OpAccessChain` instructions are themselves chained. - vulkano-shaders: Invalid emitted code for shader input/output interfaces if the shader is missing a name decoration. -- Fixed potential UB when using `MemoryAlloc::try_unwrap`, where the allocation was mapped on contruction of the `MemoryAlloc` but not unmapped on unwrapping, allowing double-mapping. +- Fixed potential UB when using `MemoryAlloc::try_unwrap`, where the allocation was mapped on construction of the `MemoryAlloc` but not unmapped on unwrapping, allowing double-mapping. - Fixed a bug in `GenericMemoryAllocator::allocate`, where the root allocations weren't created with the configured `AllocationType`. - Specialization constants are now applied to the reflected SPIR-V code before any other reflection is performed. - Fragment shaders cannot use `dual_src_blend` device feature due to interface errors. @@ -939,7 +939,7 @@ Miscellaneous: # Version 0.27.1 (2021-12-07) -- Reimplement generic impl's for `BufferAcces`, `TypedBufferAccess` & `ImageAccess`. +- Reimplement generic impl's for `BufferAccess`, `TypedBufferAccess` & `ImageAccess`. # Version 0.27.0 (2021-12-06) @@ -1164,7 +1164,7 @@ already needed khr_external_memory and khr_external_memory_fd. - **Breaking** (but unlikely) Vulkano-shaders now compiles to SPIR-V 1.0 by default. If your shader needs features only available in a higher version, you can specify the target version on the `shader!` macro with the new `vulkan_version: "major.minor"` and `spirv_version: "major.minor"` arguments. - **Breaking** Changes to how image sample counts are represented. - Instead of an integer, functions with a parameter for number of image samples now take a value of `SampleCount`, an enum with variants named `SampleN`, where `N` is a power-of-two integer. It can be converted to a Vulkan `SampleCountFlags`, and from an integer with `try_from`. - - `sample_counts` field is originaly represented as u32 type, which is now represented by `SampleCounts` struct-type which is a boolean collection of supported `sample_counts`. It can be converted to and from a Vulkan `SampleCountFlags`. + - `sample_counts` field is originally represented as u32 type, which is now represented by `SampleCounts` struct-type which is a boolean collection of supported `sample_counts`. It can be converted to and from a Vulkan `SampleCountFlags`. - **Breaking** Changes to shader interfaces and pipeline layouts. - The module `descriptor::pipeline_layout` has been renamed to `pipeline::layout`. - The trait `ShaderInterfaceDef` has been replaced by a simple struct `ShaderInterface`, and its `elements` method returns a slice instead of an iterator. This means you no longer need to define a new type for a shader interface. The accompanying type `ShaderInterfaceDefEntry` has been renamed to `ShaderInterfaceEntry` to match. The `ShaderInterfaceDefMatch` trait and `EmptyShaderInterfaceDef` struct have been removed. @@ -1394,7 +1394,7 @@ already needed khr_external_memory and khr_external_memory_fd. - **Breaking** Swapchain::new() now doesnt need to have the old_swapchain parameter anymore but requires the ColorSpace - **Breaking** Decouple descriptor sets from pipeline - **Breaking** Update Winit to 0.21.0 -- **Breaking** Add `host_cached` field to all `CpuAccessibleBuffer` initializers to allow the user to perfer host cached memory. +- **Breaking** Add `host_cached` field to all `CpuAccessibleBuffer` initializers to allow the user to prefer host cached memory. - **Breaking** Added `fullscreen_exclusive` field to `Swapchain` initializers to allow the user to specify how fullscreen exclusivity should be handled. + Swapchain methods added: `Swapchain::acquire_fullscreen_exclusive()`, `Swapchain::release_fullscreen_exclusive()`, and `Swapchain::is_fullscreen_exclusive()` - Add function `execute_commands_from_vec` to handle submission of multiple secondary command buffers. @@ -1403,9 +1403,9 @@ already needed khr_external_memory and khr_external_memory_fd. - Update MacOS dependency cocoa to 0.20 - Fixed code generated by `shader!` macro so that SSBO's are supported again (broken in 0.16.0). - Added Swapchain::surface() - which returns the saved surface -- Propogate new lines correctly in shader compile errors. +- Propagate new lines correctly in shader compile errors. - `Queue` and `QueueFamily` now implement `PartialEq` and `Eq` -- `Swapchain::acquire_next_image()`` now returns ``(image_id, suboptimal, aquire_future)`` +- `Swapchain::acquire_next_image()`` now returns ``(image_id, suboptimal, acquire_future)`` + *suboptimal indicates that the swapchain is usable, but should be recreated* - Fixed Join Future implementation to not submit joined command buffers twice. - The traits `GraphicsPipelineAbstract` and `DescriptorSet` now require `DeviceOwned`. @@ -1452,7 +1452,7 @@ This is an emergency breaking breaking change. It fixes Undefined Behaviour that # Version 0.12.0 (2019-05-24) - Update shaderc to 0.5. New shaderc has improved pre-built options for libshaderc that significantly reduce package build time and are appropriate for use in CI -- `QueueFamily::explicitly_supports_tranfers` only returns true if `vk::QUEUE_TRANSFER_BIT` is set instead of also always returning true. Removed `supports_transfers`. +- `QueueFamily::explicitly_supports_transfers` only returns true if `vk::QUEUE_TRANSFER_BIT` is set instead of also always returning true. Removed `supports_transfers`. - Update to winit 0.19 - Add support for `#include "..."` and `#include <...>` directives within source files. @@ -1473,7 +1473,7 @@ This is an emergency breaking breaking change. It fixes Undefined Behaviour that + `instance::Features` -> `device::Features` + `instance::DeviceExtensions` -> `device::DeviceExtensions` + `instance::RawDeviceExtensions` -> `device::RawDeviceExtensions` -- Added `vulkano_shaders::shader!` proc macro, use this instead of `vulkano_shader_deriver::VulkanoShaders`. +- Added `vulkano_shaders::shader!` proc macro, use this instead of `vulkano_shader_derive::VulkanoShaders`. - The entire `vulkano_shader_derive` crate is deprecated. - `vulkano_shaders::{reflect, compile, Error}` are no longer public. - Remove vulkano_shaders::build_glsl_shaders diff --git a/README.md b/README.md index 8dba9c67..4af47c1e 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,11 @@ To get started you are encouraged to use the following resources: examples (~50 lines of code) and then works up to rendering triangles and mandelbrots. The guide is currently outdated a little. We are planning to update it in the future, but it's a good place to start understanding the base building blocks of Vulkano API. - - Github [Issues](https://github.com/vulkano-rs/vulkano/issues) - Raise a topic, ask a question + - GitHub [Issues](https://github.com/vulkano-rs/vulkano/issues) - Raise a topic, ask a question or report a bug. The new topics there are watched regularly by maintainers and other community users. - Gitter [Chat](https://gitter.im/vulkano-rs/Lobby) - Another place to raise a question. However, - the chat is not maintained regularly at this moment. Better use Github Issues for this purpose. + the chat is not maintained regularly at this moment. Better use GitHub Issues for this purpose. ## Contributing diff --git a/examples/README.md b/examples/README.md index 00376547..7c826c77 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,6 @@ # Examples -**The examples shown here will not necessarily work for the latest stable release of Vulkano. By default, Github shows the most recent unstable revision, rather than the last stable release. You can switch Github to show the examples for stable releases as follows.** +**The examples shown here will not necessarily work for the latest stable release of Vulkano. By default, GitHub shows the most recent unstable revision, rather than the last stable release. You can switch GitHub to show the examples for stable releases as follows.** ## Selecting the version tag: diff --git a/examples/async-update/main.rs b/examples/async-update/main.rs index 265888bd..d11636ac 100644 --- a/examples/async-update/main.rs +++ b/examples/async-update/main.rs @@ -149,7 +149,7 @@ fn main() -> Result<(), impl Error> { // during the transfers either and the two tasks are truly asynchronous. // // For this, we need to find the queue family with the fewest queue flags set, since if the - // queue fmaily has more flags than `TRANSFER | SPARSE_BINDING`, that means it is not dedicated + // queue family has more flags than `TRANSFER | SPARSE_BINDING`, that means it is not dedicated // to transfer operations. let transfer_family_index = physical_device .queue_family_properties() @@ -157,12 +157,12 @@ fn main() -> Result<(), impl Error> { .enumerate() .filter(|(_, q)| { q.queue_flags.intersects(QueueFlags::TRANSFER) - // Queue familes dedicated to transfers are not required to support partial - // transfers of images, reported by a mininum granularity of [0, 0, 0]. If you need + // Queue families dedicated to transfers are not required to support partial + // transfers of images, reported by a minimum granularity of [0, 0, 0]. If you need // to do partial transfers of images like we do in this example, you therefore have // to make sure the queue family supports that. && q.min_image_transfer_granularity != [0; 3] - // Unlike queue familes for graphics and/or compute, queue familes dedicated to + // Unlike queue families for graphics and/or compute, queue families dedicated to // transfers don't have to support image transfers of arbitrary granularity. // Therefore, if you are going to use one, you have to either make sure the // granularity is granular enough for your needs, or you have to align your @@ -182,7 +182,7 @@ fn main() -> Result<(), impl Error> { ..Default::default() }]; - // It's possible that the physical device doesn't have any queue familes supporting + // It's possible that the physical device doesn't have any queue families supporting // transfers other than the graphics and/or compute queue family. In that case we must make // sure we don't request the same queue family twice. if transfer_family_index != graphics_family_index { @@ -623,7 +623,7 @@ fn main() -> Result<(), impl Error> { ( // Bind the uniform buffer designated for this frame. uniform_buffer_sets[image_index as usize].clone(), - // Bind the currenly most up-to-date texture. + // Bind the currently most up-to-date texture. sampler_sets[current_texture_index.load(Ordering::Acquire) as usize] .clone(), ), diff --git a/examples/dynamic-local-size/main.rs b/examples/dynamic-local-size/main.rs index a87c46a3..8a776cc0 100644 --- a/examples/dynamic-local-size/main.rs +++ b/examples/dynamic-local-size/main.rs @@ -99,7 +99,7 @@ fn main() { // We set `local_size_x` and `local_size_y` to be variables configurable values // through specialization constants. Values `1` and `2` both define a constant ID - // as well as a default value of 1 and 2 of the constants respecively. The + // as well as a default value of 1 and 2 of the constants respectively. The // `local_size_z = 1` here is an ordinary constant of the local size on the Z axis. // // Unfortunately current GLSL language capabilities doesn't let us define exact diff --git a/examples/indirect/main.rs b/examples/indirect/main.rs index 4aacb2b2..f77e4ee4 100644 --- a/examples/indirect/main.rs +++ b/examples/indirect/main.rs @@ -454,7 +454,7 @@ fn main() -> Result<(), impl Error> { // Pass the two buffers to the compute shader. let layout = &compute_pipeline.layout().set_layouts()[0]; - let cs_desciptor_set = DescriptorSet::new( + let cs_descriptor_set = DescriptorSet::new( descriptor_set_allocator.clone(), layout.clone(), [ @@ -485,7 +485,7 @@ fn main() -> Result<(), impl Error> { PipelineBindPoint::Compute, compute_pipeline.layout().clone(), 0, - cs_desciptor_set, + cs_descriptor_set, ) .unwrap(); diff --git a/examples/self-copy-buffer/main.rs b/examples/self-copy-buffer/main.rs index 0779f114..fe53c3b2 100644 --- a/examples/self-copy-buffer/main.rs +++ b/examples/self-copy-buffer/main.rs @@ -1,4 +1,4 @@ -// This example is a copy of `basic-compute-shaders.rs`, but initalizes half of the input buffer +// This example is a copy of `basic-compute-shaders.rs`, but initializes half of the input buffer // and then we use `copy_buffer_dimensions` to copy the first half of the input buffer to the // second half. @@ -147,7 +147,7 @@ fn main() { | MemoryTypeFilter::HOST_RANDOM_ACCESS, ..Default::default() }, - // We intitialize half of the array and leave the other half at 0, we will use the copy + // We initialize half of the array and leave the other half at 0, we will use the copy // command later to fill it. (0..65536u32).map(|n| if n < 65536 / 2 { n } else { 0 }), ) @@ -213,9 +213,9 @@ fn main() { let data_buffer_content = data_buffer.read().unwrap(); - // Here we have the same data in the two halfs of the buffer. + // Here we have the same data in the two halves of the buffer. for n in 0..65536 / 2 { - // The two halfs should have the same data. + // The two halves should have the same data. assert_eq!(data_buffer_content[n as usize], n * 12); assert_eq!(data_buffer_content[n as usize + 65536 / 2], n * 12); } diff --git a/examples/shader-types-derive/main.rs b/examples/shader-types-derive/main.rs index 906aeeb7..eca6772a 100644 --- a/examples/shader-types-derive/main.rs +++ b/examples/shader-types-derive/main.rs @@ -75,7 +75,7 @@ fn main() { assert_eq!( Bar { - // `Padded` implementes `From`, so you can construct it this way as well. + // `Padded` implements `From`, so you can construct it this way as well. y: [5.1, 6.2].into(), ..Default::default() }, diff --git a/examples/simple-particles/main.rs b/examples/simple-particles/main.rs index 04bfccba..67f9c803 100644 --- a/examples/simple-particles/main.rs +++ b/examples/simple-particles/main.rs @@ -1,5 +1,5 @@ // A minimal particle-sandbox to demonstrate a reasonable use-case for a device-local buffer. We -// gain significant runtime performance by writing the inital vertex values to the GPU using a +// gain significant runtime performance by writing the initial vertex values to the GPU using a // staging buffer and then copying the data to a device-local buffer to be accessed solely by the // GPU through the compute shader and as a vertex array. @@ -210,7 +210,7 @@ fn main() -> Result<(), impl Error> { // Storage buffer binding, which we optimize by using a DeviceLocalBuffer. layout (binding = 0) buffer VertexBuffer { - VertexData verticies[]; + VertexData vertices[]; }; // Allow push constants to define a parameters of compute. @@ -229,10 +229,10 @@ fn main() -> Result<(), impl Error> { void main() { const uint index = gl_GlobalInvocationID.x; - vec2 vel = verticies[index].vel; + vec2 vel = vertices[index].vel; // Update particle position according to velocity. - vec2 pos = verticies[index].pos + push.delta_time * vel; + vec2 pos = vertices[index].pos + push.delta_time * vel; // Bounce particle off screen-border. if (abs(pos.x) > 1.0) { @@ -260,8 +260,8 @@ fn main() -> Result<(), impl Error> { } // Set new values back into buffer. - verticies[index].pos = pos; - verticies[index].vel = vel * exp(friction * push.delta_time); + vertices[index].pos = pos; + vertices[index].vel = vel * exp(friction * push.delta_time); } ", } @@ -539,7 +539,7 @@ fn main() -> Result<(), impl Error> { let delta_time = now.duration_since(last_frame_time).unwrap().as_secs_f32(); last_frame_time = now; - // Create push contants to be passed to compute shader. + // Create push constants to be passed to compute shader. let push_constants = cs::PushConstants { attractor: [0.75 * (3. * time).cos(), 0.6 * (0.75 * time).sin()], attractor_strength: 1.2 * (2. * time).cos(), @@ -574,7 +574,7 @@ fn main() -> Result<(), impl Error> { let previous_future = match fences[previous_fence_index as usize].take() { // Ensure current frame is synchronized with previous. Some(fence) => fence.boxed(), - // Create new future to guarentee synchronization with (fake) previous frame. + // Create new future to guarantee synchronization with (fake) previous frame. None => sync::now(device.clone()).boxed(), }; diff --git a/examples/triangle-util/main.rs b/examples/triangle-util/main.rs index 3e80a9f8..3297b5a0 100644 --- a/examples/triangle-util/main.rs +++ b/examples/triangle-util/main.rs @@ -1,6 +1,6 @@ // Welcome to the triangle-util example! // -// This is almost exactly the same as the triange example, except that it uses utility functions +// This is almost exactly the same as the triangle example, except that it uses utility functions // to make life easier. // // This example assumes that you are already more or less familiar with graphics programming and diff --git a/vulkano/src/buffer/mod.rs b/vulkano/src/buffer/mod.rs index 80bda741..1caff316 100644 --- a/vulkano/src/buffer/mod.rs +++ b/vulkano/src/buffer/mod.rs @@ -8,7 +8,7 @@ //! Vulkano does not perform any specific marshalling of buffer data. The representation of the //! buffer in memory is identical between the CPU and GPU. Because the Rust compiler is allowed to //! reorder struct fields at will by default when using `#[repr(Rust)]`, it is advised to mark each -//! struct requiring imput assembly as `#[repr(C)]`. This forces Rust to follow the standard C +//! struct requiring input assembly as `#[repr(C)]`. This forces Rust to follow the standard C //! procedure. Each element is laid out in memory in the order of declaration and aligned to a //! multiple of their alignment. //! diff --git a/vulkano/src/buffer/subbuffer.rs b/vulkano/src/buffer/subbuffer.rs index 6b723a04..12c1b73e 100644 --- a/vulkano/src/buffer/subbuffer.rs +++ b/vulkano/src/buffer/subbuffer.rs @@ -957,7 +957,7 @@ impl BufferContentsLayout { } } - /// Creates a new `BufferContentsLayout` from a sized layout. This is inteded for use by the + /// Creates a new `BufferContentsLayout` from a sized layout. This is intended for use by the /// derive macro only. #[doc(hidden)] #[inline] @@ -974,7 +974,7 @@ impl BufferContentsLayout { } } - /// Creates a new `BufferContentsLayout` from a head and element layout. This is inteded for + /// Creates a new `BufferContentsLayout` from a head and element layout. This is intended for /// use by the derive macro only. #[doc(hidden)] #[inline] @@ -1056,7 +1056,7 @@ impl BufferContentsLayout { /// the nearest multiple of the alignment of the element type and aligning the head to the /// alignment of the element type if there is a sized part. Doesn't do anything if there is no /// sized part. Returns [`None`] if the new head size would exceed [`DeviceLayout::MAX_SIZE`]. - /// This is inteded for use by the derive macro only. + /// This is intended for use by the derive macro only. #[doc(hidden)] #[inline] pub const fn pad_to_alignment(&self) -> Option { diff --git a/vulkano/src/command_buffer/allocator.rs b/vulkano/src/command_buffer/allocator.rs index a662cfb6..15e19f69 100644 --- a/vulkano/src/command_buffer/allocator.rs +++ b/vulkano/src/command_buffer/allocator.rs @@ -391,7 +391,7 @@ impl Entry { // there will be 2 references to the pool (one here and one in the allocation) and so // the pool won't be returned to the reserve when deallocating. However, since there // are no other allocations alive, there would be no other allocations that could - // return it to the reserve. To avoid dropping the pool unneccessarily, we simply + // return it to the reserve. To avoid dropping the pool unnecessarily, we simply // continue using it. In the case where there are other references, we drop ours, at // which point an allocation still holding a reference will be able to put the pool // into the reserve when deallocated. diff --git a/vulkano/src/command_buffer/sys.rs b/vulkano/src/command_buffer/sys.rs index 9b302cb0..4d6f4969 100644 --- a/vulkano/src/command_buffer/sys.rs +++ b/vulkano/src/command_buffer/sys.rs @@ -334,7 +334,7 @@ pub struct RawCommandBuffer { // `RawRecordingCommandBuffer` is `!Send + !Sync` so that the implementation of // `CommandBufferAllocator::allocate` can assume that a command buffer in the recording state // doesn't leave the thread it was allocated on. However, as the safety contract states, -// `CommandBufferAllocator::deallocate` must acccount for the possibility that a command buffer is +// `CommandBufferAllocator::deallocate` must account for the possibility that a command buffer is // moved between threads after the recording is finished, and thus deallocated from another thread. // That's why this is sound. unsafe impl Send for RawCommandBuffer {} diff --git a/vulkano/src/descriptor_set/allocator.rs b/vulkano/src/descriptor_set/allocator.rs index 256f3007..872e21ad 100644 --- a/vulkano/src/descriptor_set/allocator.rs +++ b/vulkano/src/descriptor_set/allocator.rs @@ -451,7 +451,7 @@ impl VariableEntry { // 2 references to the pool (one here and one in the allocation) and so the pool won't // be returned to the reserve when deallocating. However, since there are no other // allocations alive, there would be no other allocations that could return it to the - // reserve. To avoid dropping the pool unneccessarily, we simply continue using it. In + // reserve. To avoid dropping the pool unnecessarily, we simply continue using it. In // the case where there are other references, we drop ours, at which point an // allocation still holding a reference will be able to put the pool into the reserve // when deallocated. If the user created a reference themself that will most certainly diff --git a/vulkano/src/descriptor_set/layout.rs b/vulkano/src/descriptor_set/layout.rs index 29476dfd..a064aa2f 100644 --- a/vulkano/src/descriptor_set/layout.rs +++ b/vulkano/src/descriptor_set/layout.rs @@ -302,7 +302,7 @@ pub struct DescriptorSetLayoutCreateInfo { /// Specifies how to create the descriptor set layout. pub flags: DescriptorSetLayoutCreateFlags, - /// The bindings of the desriptor set layout. These are specified according to binding number. + /// The bindings of the descriptor set layout. These are specified according to binding number. /// /// It is generally advisable to keep the binding numbers low. Higher binding numbers may /// use more memory inside Vulkan. diff --git a/vulkano/src/image/mod.rs b/vulkano/src/image/mod.rs index 6f6a1276..563f2181 100644 --- a/vulkano/src/image/mod.rs +++ b/vulkano/src/image/mod.rs @@ -25,7 +25,7 @@ //! //! In the vulkano library, images that have memory bound to them are represented by [`Image`]. You //! can [create an `Image` directly] by providing a memory allocator and all the info for the image -//! and allocation you want to create. This should satisify most use cases. The more low-level use +//! and allocation you want to create. This should satisfy most use cases. The more low-level use //! cases such as importing memory for the image are described below. //! //! You can create an [`ImageView`] from any `Image`. diff --git a/vulkano/src/lib.rs b/vulkano/src/lib.rs index eb87ff58..a9e24eb3 100644 --- a/vulkano/src/lib.rs +++ b/vulkano/src/lib.rs @@ -206,7 +206,7 @@ impl Packed24_8 { } } -// Allow refering to crate by its name to work around limitations of proc-macros +// Allow referring to crate by its name to work around limitations of proc-macros // in doctests. // See https://github.com/rust-lang/cargo/issues/9886 // and https://github.com/bkchr/proc-macro-crate/issues/10 diff --git a/vulkano/src/memory/allocator/mod.rs b/vulkano/src/memory/allocator/mod.rs index 44d4462a..251c2c11 100644 --- a/vulkano/src/memory/allocator/mod.rs +++ b/vulkano/src/memory/allocator/mod.rs @@ -511,7 +511,7 @@ impl MemoryTypeFilter { /// because the memory is only written once before being consumed by the device and becoming /// outdated, it doesn't matter that the data is potentially transferred over the PCIe bus /// since it only happens once. Since this is only a preference, if you have some requirements - /// such as the memory being [`HOST_VISIBLE`], those requirements will take precendence. + /// such as the memory being [`HOST_VISIBLE`], those requirements will take precedence. /// /// For memory that the host doesn't access, and the device doesn't access directly, you may /// still prefer device-local memory if the memory is used regularly. For instance, an image diff --git a/vulkano/src/memory/allocator/suballocator/mod.rs b/vulkano/src/memory/allocator/suballocator/mod.rs index 8fd3de76..f4a8ca6b 100644 --- a/vulkano/src/memory/allocator/suballocator/mod.rs +++ b/vulkano/src/memory/allocator/suballocator/mod.rs @@ -366,7 +366,7 @@ impl From for SuballocationType { } } -/// Checks if resouces A and B share a page. +/// Checks if resources A and B share a page. /// /// > **Note**: Assumes `a_offset + a_size > 0` and `a_offset + a_size <= b_offset`. fn are_blocks_on_same_page( diff --git a/vulkano/src/memory/device_memory.rs b/vulkano/src/memory/device_memory.rs index 10b73198..ad6b9a95 100644 --- a/vulkano/src/memory/device_memory.rs +++ b/vulkano/src/memory/device_memory.rs @@ -764,7 +764,7 @@ impl DeviceMemory { Ok(()) } - /// Retrieves the amount of lazily-allocated memory that is currently commited to this + /// Retrieves the amount of lazily-allocated memory that is currently committed to this /// memory object. /// /// The device may change this value at any time, and the returned value may be diff --git a/vulkano/src/range_map.rs b/vulkano/src/range_map.rs index fea87dd6..ab0f8e20 100644 --- a/vulkano/src/range_map.rs +++ b/vulkano/src/range_map.rs @@ -154,7 +154,7 @@ where .take(2) .filter(|(start, Entry { end, value: _ })| { // Does the candidate range either overlap - // or immediately preceed the range to insert? + // or immediately precede the range to insert? // (Remember that it might actually cover the _whole_ // range to insert and then some.) (*start..end).touches(&(&range.start..&range.end)) diff --git a/vulkano/src/shader/spirv/mod.rs b/vulkano/src/shader/spirv/mod.rs index 2fc6891a..0e9bfff9 100644 --- a/vulkano/src/shader/spirv/mod.rs +++ b/vulkano/src/shader/spirv/mod.rs @@ -430,7 +430,7 @@ impl Spirv { /// /// # Panics /// - /// - Panics if `id` is not defined in this module. This can in theory only happpen if you are + /// - Panics if `id` is not defined in this module. This can in theory only happen if you are /// mixing `Id`s from different modules. #[inline] pub fn id(&self, id: Id) -> &IdInfo { @@ -441,7 +441,7 @@ impl Spirv { /// /// # Panics /// - /// - Panics if `id` is not defined in this module. This can in theory only happpen if you are + /// - Panics if `id` is not defined in this module. This can in theory only happen if you are /// mixing `Id`s from different modules. #[inline] pub fn function(&self, id: Id) -> &FunctionInfo { diff --git a/vulkano/src/swapchain/surface.rs b/vulkano/src/swapchain/surface.rs index c11d8c7d..5f16f24e 100644 --- a/vulkano/src/swapchain/surface.rs +++ b/vulkano/src/swapchain/surface.rs @@ -1440,7 +1440,7 @@ impl Surface { /// Resizes the sublayer bounds on iOS. /// It may not be necessary if original window size matches device's, but often it does not. - /// Thus this should be called after a resize has occurred abd swapchain has been recreated. + /// Thus this should be called after a resize has occurred and swapchain has been recreated. /// /// On iOS, we've created CAMetalLayer as a sublayer. However, when the view changes size, /// its sublayers are not automatically resized, and we must resize