Skip to main content

Module presets

Module presets 

Source
Available on crate feature presets only.
Expand description

Parsing and usage of shader presets.

This module 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 as input to create a filter chain.

librashader’s preset parser has been tested against all presets in the slang-shaders repository to generally good compatibility. However, the preset parser requires all referenced paths to resolve to a canonical, existing path relative to the preset file. The handful of shaders that fail to parse due to this or other reasons are listed at BROKEN_SHADERS.md.

Modules§

context
Shader preset wildcard replacement context handling.

Structs§

LoadedResource
A resource for a shader preset, fully loaded into memory.
ParameterMeta
Configuration options for a shader parameter.
PassMeta
Meta information about a shader pass.
PathReference
A reference to a resource on disk.
Scale2D
2D quad scaling parameters.
Scaling
Framebuffer scaling parameters.
ShaderFeatures
Enable feature flags for shaders.
ShaderPreset
A shader preset including all specified parameters, textures, and paths to specified shaders.
ShaderPresetPack
A fully loaded-in-memory shader preset, with all paths resolved to data.
TextureBuffer
A buffer holding RGBA image bytes.
TextureMeta
Configuration options for a lookup texture used in the shader.
WildcardContext
A preset wildcard context.

Enums§

ParseErrorKind
The kind of error that may occur in parsing.
ParsePresetError
Error type for preset parsing.
ScaleFactor
The scaling factor for framebuffer scaling.
ScaleType
The scaling type for the shader pass.
ShaderSourceLanguage
The language that the shader sources are in.

Traits§

LoadableResource
Trait for a resource that is loadable from disk.
PresetColorSpace
Query the output color space of a shader preset.

Functions§

get_parameter_meta
Get full parameter metadata from a shader preset.

Type Aliases§

PassConfig
The configuration for a single shader pass.
PassResource
The loaded resource information for the source code of a shader pass.
TextureConfig
Configuration options for a lookup texture used in the shader.
TextureResource
The loaded texture resource for a shader preset.