Skip to content

Commit

Permalink
Fix typos and introduce a workflow (#2537)
Browse files Browse the repository at this point in the history
* Fix typos and introduce a workflow

* Revert vk.xml

* Update .typos.toml

* fix typos config
  • Loading branch information
szepeviktor authored Jun 30, 2024
1 parent e949e35 commit 0773648
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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
14 changes: 14 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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`.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
12 changes: 6 additions & 6 deletions examples/async-update/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ 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()
.iter()
.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
Expand All @@ -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 {
Expand Down Expand Up @@ -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(),
),
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic-local-size/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/indirect/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
[
Expand Down Expand Up @@ -485,7 +485,7 @@ fn main() -> Result<(), impl Error> {
PipelineBindPoint::Compute,
compute_pipeline.layout().clone(),
0,
cs_desciptor_set,
cs_descriptor_set,
)
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions examples/self-copy-buffer/main.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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 }),
)
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/shader-types-derive/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn main() {

assert_eq!(
Bar {
// `Padded<T, N>` implementes `From<T>`, so you can construct it this way as well.
// `Padded<T, N>` implements `From<T>`, so you can construct it this way as well.
y: [5.1, 6.2].into(),
..Default::default()
},
Expand Down
16 changes: 8 additions & 8 deletions examples/simple-particles/main.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
}
",
}
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
};

Expand Down
2 changes: 1 addition & 1 deletion examples/triangle-util/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion vulkano/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//!
Expand Down
Loading

0 comments on commit 0773648

Please sign in to comment.