diff --git a/src/front/glsl/builtins.rs b/src/front/glsl/builtins.rs index 5928e86c5e..ef98e47ea1 100644 --- a/src/front/glsl/builtins.rs +++ b/src/front/glsl/builtins.rs @@ -536,7 +536,7 @@ fn inject_standard_builtins( | "floatBitsToInt" | "floatBitsToUint" | "dFdx" | "dFdxFine" | "dFdxCoarse" | "dFdy" | "dFdyFine" | "dFdyCoarse" | "fwidth" | "fwidthFine" | "fwidthCoarse" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -587,7 +587,7 @@ fn inject_standard_builtins( } "intBitsToFloat" | "uintBitsToFloat" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -611,7 +611,7 @@ fn inject_standard_builtins( } "pow" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -633,7 +633,7 @@ fn inject_standard_builtins( } "abs" | "sign" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims // bit 2 - float/sint for bits in 0..0b1000 { let size = match bits & 0b11 { @@ -682,7 +682,7 @@ fn inject_standard_builtins( // bits layout // bit 0 - int/uint - // bit 1 trough 2 - dims + // bit 1 through 2 - dims for bits in 0..0b1000 { let kind = match bits & 0b1 { 0b0 => Sk::Sint, @@ -796,7 +796,7 @@ fn inject_standard_builtins( "atan" => { // bits layout // bit 0 - atan/atan2 - // bit 1 trough 2 - dims + // bit 1 through 2 - dims for bits in 0..0b1000 { let fun = match bits & 0b1 { 0b0 => MathFunction::Atan, @@ -827,7 +827,7 @@ fn inject_standard_builtins( } "all" | "any" | "not" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b11 { let size = match bits { 0b00 => VectorSize::Bi, @@ -916,8 +916,8 @@ fn inject_standard_builtins( } "min" | "max" => { // bits layout - // bit 0 trough 1 - scalar kind - // bit 2 trough 4 - dims + // bit 0 through 1 - scalar kind + // bit 2 through 4 - dims for bits in 0..0b11100 { let kind = match bits & 0b11 { 0b00 => Sk::Float, @@ -957,8 +957,8 @@ fn inject_standard_builtins( } "mix" => { // bits layout - // bit 0 trough 1 - dims - // bit 2 trough 4 - types + // bit 0 through 1 - dims + // bit 2 through 4 - types // // 0b10011 is the last element since splatted single elements // were already added @@ -1002,8 +1002,8 @@ fn inject_standard_builtins( } "clamp" => { // bits layout - // bit 0 trough 1 - float/int/uint - // bit 2 trough 3 - dims + // bit 0 through 1 - float/int/uint + // bit 2 through 3 - dims // bit 4 - splatted // // 0b11010 is the last element since splatted single elements @@ -1053,7 +1053,7 @@ fn inject_double_builtin(declaration: &mut FunctionDeclaration, module: &mut Mod match name { "abs" | "sign" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1080,7 +1080,7 @@ fn inject_double_builtin(declaration: &mut FunctionDeclaration, module: &mut Mod } "min" | "max" => { // bits layout - // bit 0 trough 2 - dims + // bit 0 through 2 - dims for bits in 0..0b111 { let (size, second_size) = match bits { 0b000 => (None, None), @@ -1115,8 +1115,8 @@ fn inject_double_builtin(declaration: &mut FunctionDeclaration, module: &mut Mod } "mix" => { // bits layout - // bit 0 trough 1 - dims - // bit 2 trough 3 - splatted/boolean + // bit 0 through 1 - dims + // bit 2 through 3 - splatted/boolean // // 0b1010 is the last element since splatted with single elements // is equal to normal single elements @@ -1159,7 +1159,7 @@ fn inject_double_builtin(declaration: &mut FunctionDeclaration, module: &mut Mod } "clamp" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims // bit 2 - splatted // // 0b110 is the last element since splatted with single elements @@ -1231,7 +1231,7 @@ fn inject_common_builtin( "ceil" | "round" | "roundEven" | "floor" | "fract" | "trunc" | "sqrt" | "inversesqrt" | "normalize" | "length" | "isinf" | "isnan" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1272,7 +1272,7 @@ fn inject_common_builtin( } "dot" | "reflect" | "distance" | "ldexp" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1307,7 +1307,7 @@ fn inject_common_builtin( } "transpose" => { // bits layout - // bit 0 trough 3 - dims + // bit 0 through 3 - dims for bits in 0..0b1001 { let (rows, columns) = match bits { 0b0000 => (VectorSize::Bi, VectorSize::Bi), @@ -1333,7 +1333,7 @@ fn inject_common_builtin( } "inverse" | "determinant" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b11 { let (rows, columns) = match bits { 0b00 => (VectorSize::Bi, VectorSize::Bi), @@ -1359,7 +1359,7 @@ fn inject_common_builtin( } "mod" | "step" => { // bits layout - // bit 0 trough 2 - dims + // bit 0 through 2 - dims for bits in 0..0b111 { let (size, second_size) = match bits { 0b000 => (None, None), @@ -1404,7 +1404,7 @@ fn inject_common_builtin( } "modf" | "frexp" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1478,7 +1478,7 @@ fn inject_common_builtin( } "outerProduct" => { // bits layout - // bit 0 trough 3 - dims + // bit 0 through 3 - dims for bits in 0..0b1001 { let (size1, size2) = match bits { 0b0000 => (VectorSize::Bi, VectorSize::Bi), @@ -1512,7 +1512,7 @@ fn inject_common_builtin( } "faceforward" | "fma" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1545,7 +1545,7 @@ fn inject_common_builtin( } "refract" => { // bits layout - // bit 0 trough 1 - dims + // bit 0 through 1 - dims for bits in 0..0b100 { let size = match bits { 0b00 => None, @@ -1580,7 +1580,7 @@ fn inject_common_builtin( } "smoothstep" => { // bit 0 - splatted - // bit 1 trough 2 - dims + // bit 1 through 2 - dims for bits in 0..0b1000 { let splatted = bits & 0b1 == 0b1; let size = match bits >> 1 { @@ -2391,7 +2391,7 @@ pub fn sampled_to_depth( // Copy the handle to allow borrowing the `ctx` again let ty = *ty; - // If the image was passed trough a function argument we also need to change + // If the image was passed through a function argument we also need to change // the corresponding parameter if let Expression::FunctionArgument(i) = ctx[image] { ctx.parameters[i as usize] = ty; diff --git a/src/front/glsl/context.rs b/src/front/glsl/context.rs index 4fa6393efb..6d33ef9f6c 100644 --- a/src/front/glsl/context.rs +++ b/src/front/glsl/context.rs @@ -1035,7 +1035,7 @@ impl Context { } ExprPos::AccessBase { constant_index } => { // If the index isn't constant all accesses backed by a constant base need - // to be done trough a proxy local variable, since constants have a non + // to be done through a proxy local variable, since constants have a non // pointer type which is required for dynamic indexing if !constant_index { if let Some((constant, ty)) = var.constant { @@ -1591,11 +1591,11 @@ impl Index> for Context { /// Helper struct passed when parsing expressions /// -/// This struct should only be obtained trough [`stmt_ctx`](Context::stmt_ctx) +/// This struct should only be obtained through [`stmt_ctx`](Context::stmt_ctx) /// and only one of these may be active at any time per context. #[derive(Debug)] pub struct StmtContext { - /// A arena of high level expressions which can be lowered trough a + /// A arena of high level expressions which can be lowered through a /// [`Context`](Context) to naga's [`Expression`](crate::Expression)s pub hir_exprs: Arena, } diff --git a/src/front/glsl/functions.rs b/src/front/glsl/functions.rs index 7c6408674e..1f24d404d2 100644 --- a/src/front/glsl/functions.rs +++ b/src/front/glsl/functions.rs @@ -660,7 +660,7 @@ impl Frontend { // conversions used for querying the best overload let mut new_conversions = vec![Conversion::None; args.len()]; - // Loop trough the overload parameters and check if the current overload is better + // Loop through the overload parameters and check if the current overload is better // compared to the previous best overload. for (i, overload_parameter) in overload.parameters.iter().enumerate() { let call_argument = &args[i]; @@ -875,7 +875,7 @@ impl Frontend { let mut arguments = Vec::with_capacity(args.len()); let mut proxy_writes = Vec::new(); - // Iterate trough the function call arguments applying transformations as needed + // Iterate through the function call arguments applying transformations as needed for (((parameter_info, call_argument), expr), parameter) in parameters_info .iter() .zip(&args) diff --git a/src/front/glsl/mod.rs b/src/front/glsl/mod.rs index b799293e5d..a1aa4622d3 100644 --- a/src/front/glsl/mod.rs +++ b/src/front/glsl/mod.rs @@ -73,10 +73,10 @@ impl From for Options { /// stored in the shader [`Module`](Module). #[derive(Debug)] pub struct ShaderMetadata { - /// The GLSL version specified in the shader trough the use of the + /// The GLSL version specified in the shader through the use of the /// `#version` preprocessor directive. pub version: u16, - /// The GLSL profile specified in the shader trough the use of the + /// The GLSL profile specified in the shader through the use of the /// `#version` preprocessor directive. pub profile: Profile, /// The shader stage in the pipeline, passed to the [`parse`](Frontend::parse) diff --git a/src/front/glsl/parser/declarations.rs b/src/front/glsl/parser/declarations.rs index 3ae22559a7..9085469dda 100644 --- a/src/front/glsl/parser/declarations.rs +++ b/src/front/glsl/parser/declarations.rs @@ -388,7 +388,7 @@ impl<'source> ParsingContext<'source> { // If program execution has reached here then this will be a // init_declarator_list - // token_falltrough will have a token that was already bumped + // token_fallthrough will have a token that was already bumped if let Some(ty) = ty { let mut ctx = DeclarationContext { qualifiers, diff --git a/src/front/glsl/parser/functions.rs b/src/front/glsl/parser/functions.rs index 93988f82fe..e6c86ad6d6 100644 --- a/src/front/glsl/parser/functions.rs +++ b/src/front/glsl/parser/functions.rs @@ -286,7 +286,7 @@ impl<'source> ParsingContext<'source> { // to have any cases. if let Some(case) = cases.last_mut() { // GLSL requires that the last case not be empty, so we check - // that here and produce an error otherwise (fall_trough must + // that here and produce an error otherwise (fall_through must // also be checked because `break`s count as statements but // they aren't added to the body) if case.body.is_empty() && case.fall_through { @@ -299,9 +299,9 @@ impl<'source> ParsingContext<'source> { } // GLSL allows the last case to not have any `break` statement, - // this would mark it as fall trough but naga's IR requires that - // the last case must not be fall trough, so we mark need to mark - // the last case as not fall trough always. + // this would mark it as fall through but naga's IR requires that + // the last case must not be fall through, so we mark need to mark + // the last case as not fall through always. case.fall_through = false; }