Skip to content

Commit

Permalink
[glsl-in, glsl-out] Fix warnings about redundant doc link targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Oct 16, 2023
1 parent d71f254 commit 13e2479
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
5 changes: 2 additions & 3 deletions src/back/glsl/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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> {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/front/glsl/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 11 additions & 10 deletions src/front/glsl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -1518,7 +1519,7 @@ impl Index<Handle<Expression>> 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<HirExpr>,
}

Expand Down
26 changes: 13 additions & 13 deletions src/front/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ type Result<T> = std::result::Result<T, Error>;

/// 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;
Expand Down Expand Up @@ -69,7 +70,7 @@ impl From<ShaderStage> 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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
///
Expand Down
14 changes: 7 additions & 7 deletions src/front/glsl/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ 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<Type>,
/// The alignment required by the type.
pub align: Alignment,
/// The size of the type.
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<Type>,
meta: Span,
Expand Down

0 comments on commit 13e2479

Please sign in to comment.