From 090e268c4a74104ae17e3c99c49b8779e1597a4c Mon Sep 17 00:00:00 2001 From: chyyran Date: Fri, 6 Sep 2024 22:32:02 -0400 Subject: [PATCH] doc: improve docs --- librashader-capi/src/wildcard.rs | 2 +- librashader-common/src/map.rs | 6 +++--- librashader-preprocess/src/lib.rs | 4 ++-- librashader-presets/src/lib.rs | 2 +- librashader-reflect/src/back/mod.rs | 4 ++-- librashader-reflect/src/reflect/semantics.rs | 2 +- librashader-runtime/src/uniforms.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/librashader-capi/src/wildcard.rs b/librashader-capi/src/wildcard.rs index 90d9ef8..571e694 100644 --- a/librashader-capi/src/wildcard.rs +++ b/librashader-capi/src/wildcard.rs @@ -25,7 +25,7 @@ extern_fn! { /// /// These automatically inferred variables, as well as all other variables can be overridden with /// `libra_preset_ctx_set_param`, but the expected string values must be provided. - /// See https://github.com/libretro/RetroArch/pull/15023 for a list of expected string values. + /// See for a list of expected string values. /// /// No variables can be removed once added to the context, however subsequent calls to set the same /// variable will overwrite the expected variable. diff --git a/librashader-common/src/map.rs b/librashader-common/src/map.rs index 2b1c72b..1fdb01c 100644 --- a/librashader-common/src/map.rs +++ b/librashader-common/src/map.rs @@ -1,8 +1,8 @@ -/// Fast optimized hash map type for small sets. +/// A hashmap optimized for small sets of size less than 32 with a fast hash implementation. +/// +/// Used widely for shader reflection. pub type FastHashMap = halfbrown::SizedHashMap, 32>; /// A string with small string optimizations up to 23 bytes. pub type ShortString = smartstring::SmartString; - -pub use halfbrown; diff --git a/librashader-preprocess/src/lib.rs b/librashader-preprocess/src/lib.rs index f977cd9..dcb4df7 100644 --- a/librashader-preprocess/src/lib.rs +++ b/librashader-preprocess/src/lib.rs @@ -2,9 +2,9 @@ //! //! This crate contains facilities and types for resolving `#include` directives in `.slang` //! into a single compilation unit. `#pragma` directives are also parsed and resolved as -//! [`ShaderParameter`](crate::ShaderParameter) structs. +//! [`ShaderParameter`] structs. //! -//! The resulting [`ShaderSource`](crate::ShaderSource) can then be passed into a +//! The resulting [`ShaderSource`]can then be passed into a //! reflection target for reflection and compilation into the target shader format. //! //! Re-exported as [`librashader::preprocess`](https://docs.rs/librashader/latest/librashader/preprocess/index.html). diff --git a/librashader-presets/src/lib.rs b/librashader-presets/src/lib.rs index 4a9e347..04e52f7 100644 --- a/librashader-presets/src/lib.rs +++ b/librashader-presets/src/lib.rs @@ -3,7 +3,7 @@ //! This crate contains facilities and types for parsing `.slangp` shader presets files. //! //! Shader presets contain shader and texture parameters, and the order in which to apply a set of -//! shaders in a filter chain. A librashader runtime takes a resulting [`ShaderPreset`](crate::ShaderPreset) +//! shaders in a filter chain. A librashader runtime takes a resulting [`ShaderPreset`] //! as input to create a filter chain. //! //! Re-exported as [`librashader::presets`](https://docs.rs/librashader/latest/librashader/presets/index.html). diff --git a/librashader-reflect/src/back/mod.rs b/librashader-reflect/src/back/mod.rs index fce028f..01ae71c 100644 --- a/librashader-reflect/src/back/mod.rs +++ b/librashader-reflect/src/back/mod.rs @@ -41,8 +41,8 @@ pub trait CompileShader { /// Marker trait for combinations of targets and compilations that can be reflected and compiled /// successfully. /// -/// This trait is automatically implemented for reflected outputs that have [`FromCompilation`](crate::back::FromCompilation) implement -/// for a given target that also implement [`CompileShader`](crate::back::CompileShader) for that target. +/// This trait is automatically implemented for reflected outputs that have [`FromCompilation`] implement +/// for a given target that also implement [`CompileShader`] for that target. pub trait CompileReflectShader: CompileShader< T, diff --git a/librashader-reflect/src/reflect/semantics.rs b/librashader-reflect/src/reflect/semantics.rs index ca4c4c2..8e84b43 100644 --- a/librashader-reflect/src/reflect/semantics.rs +++ b/librashader-reflect/src/reflect/semantics.rs @@ -455,7 +455,7 @@ pub struct ShaderSemantics { /// The binding of a uniform after the shader has been linked. /// -/// Used in combination with [`MemberOffset`](crate::reflect::semantics::MemberOffset) to keep track +/// Used in combination with [`MemberOffset`] to keep track /// of semantics at each frame pass. #[derive(Debug, Clone, Eq, Hash, PartialEq)] pub enum UniformBinding { diff --git a/librashader-runtime/src/uniforms.rs b/librashader-runtime/src/uniforms.rs index fe4a378..67054f1 100644 --- a/librashader-runtime/src/uniforms.rs +++ b/librashader-runtime/src/uniforms.rs @@ -12,7 +12,7 @@ impl UniformScalar for u32 {} pub trait BindUniform { /// Bind the given value to the shader uniforms given the input context. /// - /// A `BindUniform` implementation should not write to a backing buffer from a [`UniformStorage`](crate::uniforms::UniformStorage). + /// A `BindUniform` implementation should not write to a backing buffer from a [`UniformStorage`]. /// If the binding is successful and no writes to a backing buffer is necessary, this function should return `Some(())`. /// If this function returns `None`, then the value will instead be written to the backing buffer. fn bind_uniform(block: UniformMemberBlock, value: T, ctx: C, device: &D) -> Option<()>;