pub struct ShaderSource {
pub vertex: String,
pub fragment: String,
pub name: Option<ShortString>,
pub parameters: FastHashMap<ShortString, ShaderParameter>,
pub format: ImageFormat,
}
Expand description
The source file for a single shader pass.
Fields§
§vertex: String
The source contents for the vertex shader.
fragment: String
The source contents for the fragment shader.
name: Option<ShortString>
The alias of the shader if available.
parameters: FastHashMap<ShortString, ShaderParameter>
The list of shader parameters found in the shader source.
format: ImageFormat
The image format the shader expects.
Implementations§
Source§impl ShaderSource
impl ShaderSource
Sourcepub fn load(
path: impl AsRef<Path>,
features: ShaderFeatures,
) -> Result<ShaderSource, PreprocessError>
pub fn load( path: impl AsRef<Path>, features: ShaderFeatures, ) -> Result<ShaderSource, PreprocessError>
Load the source file at the given path, resolving includes relative to the location of the source file.
Trait Implementations§
Source§impl Clone for ShaderSource
impl Clone for ShaderSource
Source§fn clone(&self) -> ShaderSource
fn clone(&self) -> ShaderSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ShaderSource
impl Debug for ShaderSource
Source§impl PartialEq for ShaderSource
impl PartialEq for ShaderSource
impl StructuralPartialEq for ShaderSource
Auto Trait Implementations§
impl Freeze for ShaderSource
impl RefUnwindSafe for ShaderSource
impl Send for ShaderSource
impl Sync for ShaderSource
impl Unpin for ShaderSource
impl UnwindSafe for ShaderSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more