doc: improve docs
This commit is contained in:
parent
8856a78eb8
commit
090e268c4a
|
@ -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 <https://github.com/libretro/RetroArch/pull/15023> 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.
|
||||
|
|
|
@ -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<K, V> =
|
||||
halfbrown::SizedHashMap<K, V, core::hash::BuildHasherDefault<rustc_hash::FxHasher>, 32>;
|
||||
|
||||
/// A string with small string optimizations up to 23 bytes.
|
||||
pub type ShortString = smartstring::SmartString<smartstring::LazyCompact>;
|
||||
|
||||
pub use halfbrown;
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -41,8 +41,8 @@ pub trait CompileShader<T: OutputTarget> {
|
|||
/// 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<T: OutputTarget, C, S>:
|
||||
CompileShader<
|
||||
T,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -12,7 +12,7 @@ impl UniformScalar for u32 {}
|
|||
pub trait BindUniform<C, T, D> {
|
||||
/// 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<()>;
|
||||
|
|
Loading…
Reference in a new issue