diff --git a/src/back/glsl/features.rs b/src/back/glsl/features.rs index 4aac9b2e67..b1fff4d4bc 100644 --- a/src/back/glsl/features.rs +++ b/src/back/glsl/features.rs @@ -64,8 +64,7 @@ impl FeaturesManager { } /// Checks that all required [`Features`] are available for the specified - /// [`Version`](super::Version) otherwise returns an - /// [`Error::MissingFeatures`](super::Error::MissingFeatures) + /// [`Version`] otherwise returns an [`Error::MissingFeatures`]. pub fn check_availability(&self, version: Version) -> BackendResult { // Will store all the features that are unavailable let mut missing = Features::empty(); @@ -245,7 +244,7 @@ impl<'a, W> Writer<'a, W> { /// /// # Errors /// If the version doesn't support any of the needed [`Features`] a - /// [`Error::MissingFeatures`](super::Error::MissingFeatures) will be returned + /// [`Error::MissingFeatures`] will be returned pub(super) fn collect_required_features(&mut self) -> BackendResult { let ep_info = self.info.get_entry_point(self.entry_point_idx as usize); diff --git a/src/back/glsl/mod.rs b/src/back/glsl/mod.rs index 5f24fd651f..37d3303c7a 100644 --- a/src/back/glsl/mod.rs +++ b/src/back/glsl/mod.rs @@ -327,7 +327,7 @@ impl IdGenerator { /// Helper wrapper used to get a name for a varying /// /// Varying have different naming schemes depending on their binding: -/// - Varyings with builtin bindings get the from [`glsl_built_in`](glsl_built_in). +/// - Varyings with builtin bindings get the from [`glsl_built_in`]. /// - Varyings with location bindings are named `_S_location_X` where `S` is a /// prefix identifying which pipeline stage the varying connects, and `X` is /// the location. @@ -4050,7 +4050,7 @@ impl<'a, W: Write> Writer<'a, W> { } } -/// Structure returned by [`glsl_scalar`](glsl_scalar) +/// Structure returned by [`glsl_scalar`] /// /// It contains both a prefix used in other types and the full type name struct ScalarString<'a> { @@ -4062,7 +4062,7 @@ struct ScalarString<'a> { /// Helper function that returns scalar related strings /// -/// Check [`ScalarString`](ScalarString) for the information provided +/// Check [`ScalarString`] for the information provided /// /// # Errors /// If a [`Float`](crate::ScalarKind::Float) with an width that isn't 4 or 8 diff --git a/src/front/glsl/ast.rs b/src/front/glsl/ast.rs index 138a227676..0548fc25e5 100644 --- a/src/front/glsl/ast.rs +++ b/src/front/glsl/ast.rs @@ -377,7 +377,7 @@ impl ParameterQualifier { } } - /// Converts from a parameter qualifier into a [`ExprPos`](ExprPos) + /// Converts from a parameter qualifier into a [`ExprPos`] pub const fn as_pos(&self) -> ExprPos { match *self { ParameterQualifier::Out | ParameterQualifier::InOut => ExprPos::Lhs, diff --git a/src/front/glsl/context.rs b/src/front/glsl/context.rs index 0eceb24e4d..a54e718aa9 100644 --- a/src/front/glsl/context.rs +++ b/src/front/glsl/context.rs @@ -396,20 +396,21 @@ impl<'a> Context<'a> { Ok(()) } - /// Returns a [`StmtContext`](StmtContext) to be used in parsing and lowering + /// Returns a [`StmtContext`] to be used in parsing and lowering /// /// # Panics - /// - If more than one [`StmtContext`](StmtContext) are active at the same - /// time or if the previous call didn't use it in lowering. + /// + /// - If more than one [`StmtContext`] are active at the same time or if the + /// previous call didn't use it in lowering. #[must_use] pub fn stmt_ctx(&mut self) -> StmtContext { self.stmt_ctx.take().unwrap() } - /// Lowers a [`HirExpr`](HirExpr) which might produce a [`Expression`](Expression). + /// Lowers a [`HirExpr`] which might produce a [`Expression`]. /// - /// consumes a [`StmtContext`](StmtContext) returning it to the context so - /// that it can be used again later. + /// consumes a [`StmtContext`] returning it to the context so that it can be + /// used again later. pub fn lower( &mut self, mut stmt: StmtContext, @@ -426,10 +427,10 @@ impl<'a> Context<'a> { } /// Similar to [`lower`](Self::lower) but returns an error if the expression - /// returns void (ie. doesn't produce a [`Expression`](Expression)). + /// returns void (ie. doesn't produce a [`Expression`]). /// - /// consumes a [`StmtContext`](StmtContext) returning it to the context so - /// that it can be used again later. + /// consumes a [`StmtContext`] returning it to the context so that it can be + /// used again later. pub fn lower_expect( &mut self, mut stmt: StmtContext, @@ -1518,7 +1519,7 @@ impl Index> for Context<'_> { #[derive(Debug)] pub struct StmtContext { /// A arena of high level expressions which can be lowered through a - /// [`Context`](Context) to naga's [`Expression`](crate::Expression)s + /// [`Context`] to Naga's [`Expression`]s pub hir_exprs: Arena, } diff --git a/src/front/glsl/mod.rs b/src/front/glsl/mod.rs index 4ce0dc4783..49624a9433 100644 --- a/src/front/glsl/mod.rs +++ b/src/front/glsl/mod.rs @@ -38,8 +38,9 @@ type Result = std::result::Result; /// Per-shader options passed to [`parse`](Frontend::parse). /// -/// The [`From`](From) trait is implemented for [`ShaderStage`](ShaderStage) to -/// provide a quick way to create a Options instance. +/// The [`From`] trait is implemented for [`ShaderStage`] to provide a quick way +/// to create an `Options` instance. +/// /// ```rust /// # use naga::ShaderStage; /// # use naga::front::glsl::Options; @@ -69,7 +70,7 @@ impl From for Options { /// Additional information about the GLSL shader. /// /// Stores additional information about the GLSL shader which might not be -/// stored in the shader [`Module`](Module). +/// stored in the shader [`Module`]. #[derive(Debug)] pub struct ShaderMetadata { /// The GLSL version specified in the shader through the use of the @@ -79,7 +80,7 @@ pub struct ShaderMetadata { /// `#version` preprocessor directive. pub profile: Profile, /// The shader stage in the pipeline, passed to the [`parse`](Frontend::parse) - /// method via the [`Options`](Options) struct. + /// method via the [`Options`] struct. pub stage: ShaderStage, /// The workgroup size for compute shaders, defaults to `[1; 3]` for @@ -125,17 +126,17 @@ impl Default for ShaderMetadata { /// The `Frontend` is the central structure of the GLSL frontend. /// -/// To instantiate a new `Frontend` the [`Default`](Default) trait is used, so a +/// To instantiate a new `Frontend` the [`Default`] trait is used, so a /// call to the associated function [`Frontend::default`](Frontend::default) will /// return a new `Frontend` instance. /// /// To parse a shader simply call the [`parse`](Frontend::parse) method with a -/// [`Options`](Options) struct and a [`&str`](str) holding the glsl code. +/// [`Options`] struct and a [`&str`](str) holding the glsl code. /// /// The `Frontend` also provides the [`metadata`](Frontend::metadata) to get some /// further information about the previously parsed shader, like version and /// extensions used (see the documentation for -/// [`ShaderMetadata`](ShaderMetadata) to see all the returned information) +/// [`ShaderMetadata`] to see all the returned information) /// /// # Example usage /// ```rust @@ -187,8 +188,8 @@ impl Frontend { self.layouter.clear(); } - /// Parses a shader either outputting a shader [`Module`](Module) or a list - /// of [`Error`](Error)s. + /// Parses a shader either outputting a shader [`Module`] or a list of + /// [`Error`]s. /// /// Multiple calls using the same `Frontend` and different shaders are supported. pub fn parse( @@ -216,10 +217,9 @@ impl Frontend { } } - /// Returns additional information about the parsed shader which might not be - /// stored in the [`Module`](Module), see the documentation for - /// [`ShaderMetadata`](ShaderMetadata) for more information about the - /// returned data. + /// Returns additional information about the parsed shader which might not + /// be stored in the [`Module`], see the documentation for + /// [`ShaderMetadata`] for more information about the returned data. /// /// # Notes /// diff --git a/src/front/glsl/offset.rs b/src/front/glsl/offset.rs index 21481372b5..2d41778522 100644 --- a/src/front/glsl/offset.rs +++ b/src/front/glsl/offset.rs @@ -20,12 +20,12 @@ use crate::{proc::Alignment, Handle, Type, TypeInner, UniqueArena}; /// Struct with information needed for defining a struct member. /// -/// Returned by [`calculate_offset`](calculate_offset) +/// Returned by [`calculate_offset`]. #[derive(Debug)] pub struct TypeAlignSpan { /// The handle to the type, this might be the same handle passed to - /// [`calculate_offset`](calculate_offset) or a new such a new array type - /// with a different stride set. + /// [`calculate_offset`] or a new such a new array type with a different + /// stride set. pub ty: Handle, /// The alignment required by the type. pub align: Alignment, @@ -33,11 +33,11 @@ pub struct TypeAlignSpan { pub span: u32, } -/// Returns the type, alignment and span of a struct member according to a [`StructLayout`](StructLayout). +/// Returns the type, alignment and span of a struct member according to a [`StructLayout`]. /// -/// The functions returns a [`TypeAlignSpan`](TypeAlignSpan) which has a `ty` member -/// this should be used as the struct member type because for example arrays may have to -/// change the stride and as such need to have a different type. +/// The functions returns a [`TypeAlignSpan`] which has a `ty` member this +/// should be used as the struct member type because for example arrays may have +/// to change the stride and as such need to have a different type. pub fn calculate_offset( mut ty: Handle, meta: Span,