From 529aaf4f3fd1f40cb7dea4fbfd484d544b7b60ed Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 26 Sep 2024 02:04:55 +0700 Subject: [PATCH] Reduce typo count. (#18) --- CHANGELOG.md | 2 +- .../rustc_codegen_spirv/src/builder/builder_methods.rs | 6 +++--- crates/rustc_codegen_spirv/src/codegen_cx/constant.rs | 4 ++-- crates/rustc_codegen_spirv/src/codegen_cx/entry.rs | 2 +- crates/rustc_codegen_spirv/src/linker/duplicates.rs | 2 +- crates/rustc_codegen_spirv/src/linker/inline.rs | 4 ++-- crates/rustc_codegen_spirv/src/linker/mem2reg.rs | 6 +++--- crates/rustc_codegen_spirv/src/linker/mod.rs | 2 +- crates/rustc_codegen_spirv/src/linker/peephole_opts.rs | 2 +- crates/rustc_codegen_spirv/src/linker/specializer.rs | 10 +++++----- .../src/linker/spirt_passes/diagnostics.rs | 2 +- .../rustc_codegen_spirv/src/spirv_type_constraints.rs | 4 ++-- crates/rustc_codegen_spirv/src/symbols.rs | 2 +- crates/spirv-builder/src/watch.rs | 2 +- crates/spirv-std/src/arch.rs | 2 +- crates/spirv-std/src/byte_addressable_buffer.rs | 4 ++-- crates/spirv-std/src/image/params.rs | 2 +- docs/src/attributes.md | 2 +- docs/src/codegen-args.md | 2 +- docs/src/rfcs/001-resource-binding-syntax.md | 6 +++--- docs/src/testing.md | 2 +- docs/src/writing-shader-crates.md | 4 ++-- examples/runners/ash/src/main.rs | 6 +++--- tests/src/main.rs | 2 +- tests/ui/arch/all.rs | 2 +- tests/ui/arch/any.rs | 2 +- tests/ui/lang/consts/nested-ref.rs | 2 +- tests/ui/lang/consts/shallow-ref.rs | 2 +- tests/ui/lang/core/mem/create_unitialized_memory.rs | 2 +- tests/ui/lang/core/ref/member_ref_arg-broken.rs | 2 +- tests/ui/lang/core/ref/member_ref_arg.rs | 2 +- 31 files changed, 48 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b63ba5323..18fcf8e4d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -280,7 +280,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PR#612](https://github.com/EmbarkStudios/rust-gpu/pull/612) added `is_helper_invocation` to `spirv-std` - [PR#624](https://github.com/EmbarkStudios/rust-gpu/pull/624) added `OpTypeSampler` and `OpTypeAccelerationStructureKHR` support to inline `asm!` - [PR#622](https://github.com/EmbarkStudios/rust-gpu/pull/622) added the ability to query entry-point names from `spirv-builder` -- [PR#630](https://github.com/EmbarkStudios/rust-gpu/pull/630) added a more convenient API to `spirv-builder`, for requesting extensions and/or capabilties +- [PR#630](https://github.com/EmbarkStudios/rust-gpu/pull/630) added a more convenient API to `spirv-builder`, for requesting extensions and/or capabilities - [PR#629](https://github.com/EmbarkStudios/rust-gpu/pull/629) added an optimization to convert N identical scalar (e.g. arithmetic) ops, into one N-wide vector op (as e.g. `glam` only emits the former) - [PR#596](https://github.com/EmbarkStudios/rust-gpu/pull/596) added a `RuntimeArray` type to `spirv-val`, to represent SPIR-V `OpRuntimeArray`s - [PR#635](https://github.com/EmbarkStudios/rust-gpu/pull/635) added several `spirv-builder` options for controlling `spirv-val` flags diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index 71e53a9785..b8841b45a8 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -578,7 +578,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }) .collect(); - // Special-case field accesses through a `pointercast`, to accesss the + // Special-case field accesses through a `pointercast`, to access the // right field in the original type, for the `Logical` addressing model. let ptr = ptr.strip_ptrcasts(); let ptr_id = ptr.def(self); @@ -1378,8 +1378,8 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { ); self.icmp(IntPredicate::IntEQ, rhs_lt_zero, result_gt_lhs) } else { - // for unsigned addition, overflow occured if the result is less than any of the operands. - // for subtraction, overflow occured if the result is greater. + // for unsigned addition, overflow occurred if the result is less than any of the operands. + // for subtraction, overflow occurred if the result is greater. self.icmp( if is_add { IntPredicate::IntULT diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index a6b9b4f634..4ab26f317e 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -503,8 +503,8 @@ impl<'tcx> CodegenCx<'tcx> { ), }; // alloc_id is not needed by read_scalar, so we just use 0. If the context - // refers to a pointer, read_scalar will find the the actual alloc_id. It - // only uses the input alloc_id in the case that the scalar is uninitilized + // refers to a pointer, read_scalar will find the actual alloc_id. It + // only uses the input alloc_id in the case that the scalar is uninitialized // as part of the error output // tldr, the pointer here is only needed for the offset let value = match alloc.inner().read_scalar( diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index f04080b88b..2489e2ea79 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -663,7 +663,7 @@ impl<'tcx> CodegenCx<'tcx> { // (e.g. Vulkan has specific rules for builtin storage classes). // Emit `OpName` in the simple case of a pattern that's just a variable - // name (e.g. "foo" for `foo: Vec3`). While `OpName` is *not* suppposed + // name (e.g. "foo" for `foo: Vec3`). While `OpName` is *not* supposed // to be semantic, OpenGL and some tooling rely on it for reflection. if let hir::PatKind::Binding(_, _, ident, _) = &hir_param.pat.kind { self.emit_global() diff --git a/crates/rustc_codegen_spirv/src/linker/duplicates.rs b/crates/rustc_codegen_spirv/src/linker/duplicates.rs index 3ca05022f0..af2b91a1c3 100644 --- a/crates/rustc_codegen_spirv/src/linker/duplicates.rs +++ b/crates/rustc_codegen_spirv/src/linker/duplicates.rs @@ -20,7 +20,7 @@ pub fn remove_duplicate_extensions(module: &mut Module) { }); } -pub fn remove_duplicate_capablities(module: &mut Module) { +pub fn remove_duplicate_capabilities(module: &mut Module) { let mut set = FxHashSet::default(); module.capabilities.retain(|inst| { inst.class.opcode != Op::Capability || set.insert(inst.operands[0].unwrap_capability()) diff --git a/crates/rustc_codegen_spirv/src/linker/inline.rs b/crates/rustc_codegen_spirv/src/linker/inline.rs index 717a73f85b..295e3e79b2 100644 --- a/crates/rustc_codegen_spirv/src/linker/inline.rs +++ b/crates/rustc_codegen_spirv/src/linker/inline.rs @@ -125,7 +125,7 @@ pub fn inline(sess: &Session, module: &mut Module) -> super::Result<()> { } let header = module.header.as_mut().unwrap(); - // FIXME(eddyb) clippy false positive (seperate `map` required for borrowck). + // FIXME(eddyb) clippy false positive (separate `map` required for borrowck). #[allow(clippy::map_unwrap_or)] let mut inliner = Inliner { op_type_void_id: module @@ -807,7 +807,7 @@ impl Inliner<'_, '_> { .. } = *self; - // HACK(eddyb) this is terrible, but we have to deal with it becasue of + // HACK(eddyb) this is terrible, but we have to deal with it because of // how this inliner is outside-in, instead of inside-out, meaning that // context builds up "outside" of the callee blocks, inside the caller. let mut enclosing_inlined_frames = SmallVec::<[_; 8]>::new(); diff --git a/crates/rustc_codegen_spirv/src/linker/mem2reg.rs b/crates/rustc_codegen_spirv/src/linker/mem2reg.rs index 2f93e2b340..628be71c8d 100644 --- a/crates/rustc_codegen_spirv/src/linker/mem2reg.rs +++ b/crates/rustc_codegen_spirv/src/linker/mem2reg.rs @@ -229,11 +229,11 @@ fn collect_access_chains( Some(VarInfo { ty: *pointer_to_pointee.get(&inst.result_type.unwrap()).unwrap(), indices: { - let mut base_indicies = base.indices.clone(); + let mut base_indices = base.indices.clone(); for op in inst.operands.iter().skip(1) { - base_indicies.push(*constants.get(&op.id_ref_any().unwrap())?); + base_indices.push(*constants.get(&op.id_ref_any().unwrap())?); } - base_indicies + base_indices }, }) } diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs index baeb9d2815..1dffd724db 100644 --- a/crates/rustc_codegen_spirv/src/linker/mod.rs +++ b/crates/rustc_codegen_spirv/src/linker/mod.rs @@ -204,7 +204,7 @@ pub fn link( { let _timer = sess.timer("link_remove_duplicates"); duplicates::remove_duplicate_extensions(&mut output); - duplicates::remove_duplicate_capablities(&mut output); + duplicates::remove_duplicate_capabilities(&mut output); duplicates::remove_duplicate_ext_inst_imports(&mut output); duplicates::remove_duplicate_types(&mut output); // jb-todo: strip identical OpDecoration / OpDecorationGroups diff --git a/crates/rustc_codegen_spirv/src/linker/peephole_opts.rs b/crates/rustc_codegen_spirv/src/linker/peephole_opts.rs index fbfd4f9fd8..447028f671 100644 --- a/crates/rustc_codegen_spirv/src/linker/peephole_opts.rs +++ b/crates/rustc_codegen_spirv/src/linker/peephole_opts.rs @@ -70,7 +70,7 @@ pub fn composite_construct(types: &FxHashMap, function: &mut let index = cur_inst.operands[2].unwrap_literal_int32() as usize; if index >= components.len() { // Theoretically shouldn't happen, as it's invalid SPIR-V if the index is out - // of bounds, but just stop optimizing instead of panicing here. + // of bounds, but just stop optimizing instead of panicking here. break; } if components[index].is_none() { diff --git a/crates/rustc_codegen_spirv/src/linker/specializer.rs b/crates/rustc_codegen_spirv/src/linker/specializer.rs index 61f65967c8..5f548d9c87 100644 --- a/crates/rustc_codegen_spirv/src/linker/specializer.rs +++ b/crates/rustc_codegen_spirv/src/linker/specializer.rs @@ -77,7 +77,7 @@ impl) -> fmt::Result> fmt::Display for FmtBy { } pub trait Specialization { - /// Return `true` if the specializer should replace every occurence of + /// Return `true` if the specializer should replace every occurrence of /// `operand` with some other inferred `Operand`. fn specialize_operand(&self, operand: &Operand) -> bool; @@ -1903,7 +1903,7 @@ impl<'a, S: Specialization> InferCx<'a, S> { ); } - // HACK(eddyb) workaround for `OpFunction`, see earlier HACK commment. + // HACK(eddyb) workaround for `OpFunction`, see earlier HACK comment. if let Some(ret_ty) = record_fn_ret_ty { let (ret_ty, _) = InferOperand::from_operand_and_generic_args( &Operand::IdRef(ret_ty), @@ -1929,7 +1929,7 @@ impl<'a, S: Specialization> InferCx<'a, S> { ); ( Some(type_of_result), - // HACK(eddyb) workaround for `OpFunction`, see earlier HACK commment. + // HACK(eddyb) workaround for `OpFunction`, see earlier HACK comment. match inst.class.opcode { Op::Function => all_generic_args, _ => rest, @@ -1942,7 +1942,7 @@ impl<'a, S: Specialization> InferCx<'a, S> { let debug_dump_if_enabled = |cx: &Self, prefix| { if cx.specializer.debug { let result_type = match inst.class.opcode { - // HACK(eddyb) workaround for `OpFunction`, see earlier HACK commment. + // HACK(eddyb) workaround for `OpFunction`, see earlier HACK comment. Op::Function => Some( InferOperand::from_operand_and_generic_args( &Operand::IdRef(inst.result_type.unwrap()), @@ -1976,7 +1976,7 @@ impl<'a, S: Specialization> InferCx<'a, S> { // If we have some instruction signatures for `inst`, enforce them. if let Some(sigs) = spirv_type_constraints::instruction_signatures(inst.class.opcode) { - // HACK(eddyb) workaround for `OpFunction`, see earlier HACK commment. + // HACK(eddyb) workaround for `OpFunction`, see earlier HACK comment. // (specifically, `type_of_result` isn't *Result Type* for `OpFunction`) assert_ne!(inst.class.opcode, Op::Function); diff --git a/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs b/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs index 4c4cbbc4bb..4ccdc7218c 100644 --- a/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs +++ b/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs @@ -257,7 +257,7 @@ impl UseOrigin<'_> { inst: ext_inst, } => { // FIXME(eddyb) inefficient (ideally the `InternedStr` - // shoudl be available), but this is the error case. + // should be available), but this is the error case. assert_eq!(&cx[ext_set], &custom_insts::CUSTOM_EXT_INST_SET[..]); CustomOp::decode(ext_inst) diff --git a/crates/rustc_codegen_spirv/src/spirv_type_constraints.rs b/crates/rustc_codegen_spirv/src/spirv_type_constraints.rs index b4e180f913..5d2d623998 100644 --- a/crates/rustc_codegen_spirv/src/spirv_type_constraints.rs +++ b/crates/rustc_codegen_spirv/src/spirv_type_constraints.rs @@ -109,7 +109,7 @@ pub enum TyPat<'a> { /// Index the composite type matched by the inner pattern (like a `Var`) /// by all of the value operands of the instruction which don't have their /// types consumed explicitly, i.e. the indices operands correspond to - /// the `TyListPat::Any` part of the the `inputs` of the `InstSig`, + /// the `TyListPat::Any` part of the `inputs` of the `InstSig`, /// e.g. in `sig! { (_, T, _, ..) -> IndexComposite(T) }`, the output type /// has to be identical to the result of indexing `T` by all the value /// operands *other than* the first 3. @@ -758,7 +758,7 @@ pub fn instruction_signatures(op: Op) -> Option<&'static [InstSig<'static>]> { | Op::TraceNV | Op::TypeAccelerationStructureNV | Op::ExecuteCallableNV => { - // NOTE(eddyb) Some KHR variants are aliased to the the NV instructions. + // NOTE(eddyb) Some KHR variants are aliased to the NV instructions. // reserved!(SPV_NV_ray_tracing) } // SPV_NV_cooperative_matrix diff --git a/crates/rustc_codegen_spirv/src/symbols.rs b/crates/rustc_codegen_spirv/src/symbols.rs index f7038a0472..f6436099c8 100644 --- a/crates/rustc_codegen_spirv/src/symbols.rs +++ b/crates/rustc_codegen_spirv/src/symbols.rs @@ -211,7 +211,7 @@ const EXECUTION_MODES: &[(&str, ExecutionMode, ExecutionModeExtraDim)] = { ("vertex_order_cw", VertexOrderCw, None), ("vertex_order_ccw", VertexOrderCcw, None), ("pixel_center_integer", PixelCenterInteger, None), - ("orgin_upper_left", OriginUpperLeft, None), + ("origin_upper_left", OriginUpperLeft, None), ("origin_lower_left", OriginLowerLeft, None), ("early_fragment_tests", EarlyFragmentTests, None), ("point_mode", PointMode, None), diff --git a/crates/spirv-builder/src/watch.rs b/crates/spirv-builder/src/watch.rs index 44b92d7317..051adf7f6e 100644 --- a/crates/spirv-builder/src/watch.rs +++ b/crates/spirv-builder/src/watch.rs @@ -25,7 +25,7 @@ impl SpirvBuilder { path } else { let (tx, rx) = sync_channel(0); - // Fall back to watching from the crate root if the inital compilation fails + // Fall back to watching from the crate root if the initial compilation fails let mut watcher = notify::recommended_watcher(move |event: notify::Result| match event { Ok(e) => match e.kind { diff --git a/crates/spirv-std/src/arch.rs b/crates/spirv-std/src/arch.rs index dc061c7a00..c5fde66167 100644 --- a/crates/spirv-std/src/arch.rs +++ b/crates/spirv-std/src/arch.rs @@ -1,4 +1,4 @@ -//! SPIR-V Instrinics +//! SPIR-V Intrinsics //! //! This module is intended as a low level abstraction over SPIR-V instructions. //! These functions will typically map to a single instruction, and will perform diff --git a/crates/spirv-std/src/byte_addressable_buffer.rs b/crates/spirv-std/src/byte_addressable_buffer.rs index 216ef027f8..f22cfe7ff9 100644 --- a/crates/spirv-std/src/byte_addressable_buffer.rs +++ b/crates/spirv-std/src/byte_addressable_buffer.rs @@ -44,11 +44,11 @@ unsafe fn buffer_store_intrinsic( } /// `ByteAddressableBuffer` is an untyped blob of data, allowing loads and stores of arbitrary -/// basic data types at arbitrary indicies. However, all data must be aligned to size 4, each +/// basic data types at arbitrary indices. However, all data must be aligned to size 4, each /// element within the data (e.g. struct fields) must have a size and alignment of a multiple of 4, /// and the `byte_index` passed to load and store must be a multiple of 4 (`byte_index` will be /// rounded down to the nearest multiple of 4). So, it's not technically a *byte* addressable -/// buffer, but rather a *word* buffer, but this naming and behavior was inhereted from HLSL (where +/// buffer, but rather a *word* buffer, but this naming and behavior was inherited from HLSL (where /// it's UB to pass in an index not a multiple of 4). #[repr(transparent)] pub struct ByteAddressableBuffer<'a> { diff --git a/crates/spirv-std/src/image/params.rs b/crates/spirv-std/src/image/params.rs index e64b9e2d93..c67873da8e 100644 --- a/crates/spirv-std/src/image/params.rs +++ b/crates/spirv-std/src/image/params.rs @@ -4,7 +4,7 @@ use crate::{integer::Integer, scalar::Scalar, vector::Vector, vector::VectorTrun /// Marker trait for arguments that accept single scalar values or vectors /// of scalars. Defines 2-, 3- and 4-component vector types based on the sample type. pub trait SampleType: Scalar { - /// The default vector/scalar of ths sample type + /// The default vector/scalar of this sample type type SampleResult: Default; /// A 2-component vector of this sample type diff --git a/docs/src/attributes.md b/docs/src/attributes.md index 627f3d752f..6917e5a473 100644 --- a/docs/src/attributes.md +++ b/docs/src/attributes.md @@ -121,7 +121,7 @@ used to override them later ("specializing" the shader): * note: WebGPU calls them ["pipeline-overridable constants"](https://gpuweb.github.io/gpuweb/wgsl/#pipeline-overridable) * in OpenCL: [via `clSetProgramSpecializationConstant()` calls, before `clBuildProgram()`](https://registry.khronos.org/OpenCL/sdk/3.0/docs/man/html/clSetProgramSpecializationConstant.html) -If a "specialization constant" is not overriden, it falls back to its *default* +If a "specialization constant" is not overridden, it falls back to its *default* value, which is either user-specified (via `default = ...`), or `0` otherwise. While only "specialization constants" of type `u32` are currently supported, it's diff --git a/docs/src/codegen-args.md b/docs/src/codegen-args.md index 77b357efcf..d1f610366d 100644 --- a/docs/src/codegen-args.md +++ b/docs/src/codegen-args.md @@ -53,7 +53,7 @@ While most of those flags are usually only exposed through higher-level `spirv-b ## Debugging "codegen args" flags/options -As mentioned above, these form the bulk of "codegen args", but keep in mind the list is not exhaustive and you will want to cehck the full list with e.g. `RUSTGPU_CODEGEN_ARGS="--help"`. +As mentioned above, these form the bulk of "codegen args", but keep in mind the list is not exhaustive and you will want to check the full list with e.g. `RUSTGPU_CODEGEN_ARGS="--help"`. ### `--dump-mir DIR` diff --git a/docs/src/rfcs/001-resource-binding-syntax.md b/docs/src/rfcs/001-resource-binding-syntax.md index dcbd8f3edd..dc8f889f16 100644 --- a/docs/src/rfcs/001-resource-binding-syntax.md +++ b/docs/src/rfcs/001-resource-binding-syntax.md @@ -22,7 +22,7 @@ In recent years most Desktop platforms have switched to loading resource descrip | Maximum number of Samplers in all descriptor tables per shader stage| 16| full heap| full heap ### Vulkan -On the other hand in Vulkan resource descriptor binding is designed in such a way that it can accomodate hardware that still relies on descriptor slots instead of memory, because still a lot of such hardware exists in the wild. Especially in the Mobile space. +On the other hand in Vulkan resource descriptor binding is designed in such a way that it can accommodate hardware that still relies on descriptor slots instead of memory, because still a lot of such hardware exists in the wild. Especially in the Mobile space. There are some constraints that currently exist when it comes to binding resources to shaders that we may need to take into account, Vulkan has `maxBoundDescriptorSets` for example (between 4 and 32). However for the sake of argument we'll ignore these practical limitations for now. @@ -163,7 +163,7 @@ fn main(inputs: &ShadingInputs, indirect_lighting: &IndirectLighting) { # Suggestion -I think the most ergonomic and future proof binding method would be to have descriptors in structs, bound to the entrypoint. This allows us some nice, even more ergonomic upsides later on (when support is more widely available) where we can put data members in these structs as well. And along with this, we can have very egonomic CPU side code as well, where we can keep shader invocation looking like a function call for a large part, instead of having to manually bind to slots again. +I think the most ergonomic and future proof binding method would be to have descriptors in structs, bound to the entrypoint. This allows us some nice, even more ergonomic upsides later on (when support is more widely available) where we can put data members in these structs as well. And along with this, we can have very ergonomic CPU side code as well, where we can keep shader invocation looking like a function call for a large part, instead of having to manually bind to slots again. # Prior art @@ -186,7 +186,7 @@ ConstantBuffer c[10000] : register(b0); In DirectX12 the feature of Root Signatures got added that is essentially a new domain specific language to set up the layout / calling convention of the shader; specified in a string. -Note the the two examples don't match necessarily. +Note the two examples don't match necessarily. ```hlsl #define MyRS1 "RootFlags( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | " \ diff --git a/docs/src/testing.md b/docs/src/testing.md index 5e1b2c5245..40ad1378e2 100644 --- a/docs/src/testing.md +++ b/docs/src/testing.md @@ -17,7 +17,7 @@ how to configure it, and add new tests. ### Blessing Tests -You will occassionally need to "bless" the output from UI tests to update the +You will occasionally need to "bless" the output from UI tests to update the normalised output, you can do this by passing a `--bless` flag to `cargo compiletest`. diff --git a/docs/src/writing-shader-crates.md b/docs/src/writing-shader-crates.md index fd51ab2d72..7ef6c991ae 100644 --- a/docs/src/writing-shader-crates.md +++ b/docs/src/writing-shader-crates.md @@ -36,7 +36,7 @@ If you're writing a bigger application and you want to integrate SPIR-V shader crates to display, it's recommended to use `spirv-builder` in a build script. 1. Copy the [`rust-toolchain.toml`] file to your project. (You must use the same - version of Rust as `rust-gpu`. Utimately, the build will fail with a nice + version of Rust as `rust-gpu`. Ultimately, the build will fail with a nice error message when you don't use the exact same version) 2. Reference `spirv-builder` in your Cargo.toml: ```toml @@ -156,7 +156,7 @@ crate-type = ["dylib"] spirv-std = { version = "0.9" } ``` -Make sure your shader code uses the `no_std` attribute and makes the `spirv` attribute visibile in the global scope. Then, you're ready to write your first shader. Here's a very simple fragment shader called `main_fs` as an example that outputs the color red: +Make sure your shader code uses the `no_std` attribute and makes the `spirv` attribute visible in the global scope. Then, you're ready to write your first shader. Here's a very simple fragment shader called `main_fs` as an example that outputs the color red: ```rust,norun #![no_std] diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index 6c9180da4e..0edfa8daad 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -141,12 +141,12 @@ pub fn main() { )], ); - let (compiler_sender, compiler_reciever) = sync_channel(1); + let (compiler_sender, compiler_receiver) = sync_channel(1); event_loop .run(move |event, event_loop_window_target| match event { Event::AboutToWait { .. } => { - match compiler_reciever.try_recv() { + match compiler_receiver.try_recv() { Err(TryRecvError::Empty) => { if ctx.rendering_paused { let vk::Extent2D { width, height } = ctx.base.surface_resolution(); @@ -166,7 +166,7 @@ pub fn main() { ctx.rebuild_pipelines(vk::PipelineCache::null()); } Err(TryRecvError::Disconnected) => { - panic!("compiler reciever disconnected unexpectedly"); + panic!("compiler receiver disconnected unexpectedly"); } }; } diff --git a/tests/src/main.rs b/tests/src/main.rs index daeaa62bee..7b48e14185 100644 --- a/tests/src/main.rs +++ b/tests/src/main.rs @@ -387,7 +387,7 @@ fn rust_flags(codegen_backend_path: &Path) -> String { .join(" ") } -/// Convience function to map process failure to results in Rust. +/// Convenience function to map process failure to results in Rust. fn map_status_to_result(status: std::process::ExitStatus) -> io::Result<()> { match status.success() { true => Ok(()), diff --git a/tests/ui/arch/all.rs b/tests/ui/arch/all.rs index 472a2d82a0..18967b0d87 100644 --- a/tests/ui/arch/all.rs +++ b/tests/ui/arch/all.rs @@ -9,7 +9,7 @@ use spirv_std::{scalar::Scalar, vector::Vector, vector::VectorOrScalar}; /// HACK(shesp). Rust doesn't allow us to declare regular (tuple-)structs containing `bool` members /// as `#[repl(simd)]`. But we need this for `spirv_std::arch::any()` and `spirv_std::arch::all()` /// to work. -/// Fortunaly, this requirement isn't checked on generic structs, so we have a way to work around +/// Fortunately, this requirement isn't checked on generic structs, so we have a way to work around /// it (for now at least) #[repr(simd)] struct Vec2(T, T); diff --git a/tests/ui/arch/any.rs b/tests/ui/arch/any.rs index c61928fed9..7d03403c77 100644 --- a/tests/ui/arch/any.rs +++ b/tests/ui/arch/any.rs @@ -9,7 +9,7 @@ use spirv_std::{scalar::Scalar, vector::Vector, vector::VectorOrScalar}; /// HACK(shesp). Rust doesn't allow us to declare regular (tuple-)structs containing `bool` members /// as `#[repl(simd)]`. But we need this for `spirv_std::arch::any()` and `spirv_std::arch::all()` /// to work. -/// Fortunaly, this requirement isn't checked on generic structs, so we have a way to work around +/// Fortunately, this requirement isn't checked on generic structs, so we have a way to work around /// it (for now at least) #[repr(simd)] struct Vec2(T, T); diff --git a/tests/ui/lang/consts/nested-ref.rs b/tests/ui/lang/consts/nested-ref.rs index 5aac28150c..293325475c 100644 --- a/tests/ui/lang/consts/nested-ref.rs +++ b/tests/ui/lang/consts/nested-ref.rs @@ -1,5 +1,5 @@ // Test `&'static &'static T` constants where the `T` values don't themselves -// contain references, and where the `T` values aren't immediatelly loaded from. +// contain references, and where the `T` values aren't immediately loaded from. // build-pass // compile-flags: -C target-feature=+VariablePointers diff --git a/tests/ui/lang/consts/shallow-ref.rs b/tests/ui/lang/consts/shallow-ref.rs index 65210659e6..e0d8094e13 100644 --- a/tests/ui/lang/consts/shallow-ref.rs +++ b/tests/ui/lang/consts/shallow-ref.rs @@ -1,5 +1,5 @@ // Test `&'static T` constants where the `T` values don't themselves contain -// references, and where the `T` values aren't immediatelly loaded from. +// references, and where the `T` values aren't immediately loaded from. // build-pass diff --git a/tests/ui/lang/core/mem/create_unitialized_memory.rs b/tests/ui/lang/core/mem/create_unitialized_memory.rs index 3edc57aab6..6eef32d8a6 100644 --- a/tests/ui/lang/core/mem/create_unitialized_memory.rs +++ b/tests/ui/lang/core/mem/create_unitialized_memory.rs @@ -1,4 +1,4 @@ -// Test creating unitialized memory. +// Test creating uninitialized memory. // build-pass use spirv_std::spirv; diff --git a/tests/ui/lang/core/ref/member_ref_arg-broken.rs b/tests/ui/lang/core/ref/member_ref_arg-broken.rs index 3a4e19c185..e0f13873ba 100644 --- a/tests/ui/lang/core/ref/member_ref_arg-broken.rs +++ b/tests/ui/lang/core/ref/member_ref_arg-broken.rs @@ -14,7 +14,7 @@ struct S { } // NOTE(eddyb) `#[inline(never)]` is for blocking inlining at the e.g. MIR level, -// whereas any Rust-GPU-specific legalization will intentially ignore it. +// whereas any Rust-GPU-specific legalization will intentionally ignore it. #[inline(never)] fn f(x: &u32) -> u32 { diff --git a/tests/ui/lang/core/ref/member_ref_arg.rs b/tests/ui/lang/core/ref/member_ref_arg.rs index ba1e0bc34f..fdf6b1b356 100644 --- a/tests/ui/lang/core/ref/member_ref_arg.rs +++ b/tests/ui/lang/core/ref/member_ref_arg.rs @@ -8,7 +8,7 @@ struct S { } // NOTE(eddyb) `#[inline(never)]` is for blocking inlining at the e.g. MIR level, -// whereas any Rust-GPU-specific legalization will intentially ignore it. +// whereas any Rust-GPU-specific legalization will intentionally ignore it. #[inline(never)] fn f(x: &u32) {}