Struct librashader_preprocess::ShaderSource
source · pub struct ShaderSource {
pub vertex: String,
pub fragment: String,
pub name: Option<String>,
pub parameters: FastHashMap<String, ShaderParameter>,
pub format: ImageFormat,
}Expand description
The source file for a single shader pass.
Fields§
§vertex: StringThe source contents for the vertex shader.
fragment: StringThe source contents for the fragment shader.
name: Option<String>The alias of the shader if available.
parameters: FastHashMap<String, ShaderParameter>The list of shader parameters found in the shader source.
format: ImageFormatThe image format the shader expects.
Implementations§
source§impl ShaderSource
impl ShaderSource
sourcepub fn load(path: impl AsRef<Path>) -> Result<ShaderSource, PreprocessError>
pub fn load(path: impl AsRef<Path>) -> 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 copy 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
source§fn eq(&self, other: &ShaderSource) -> bool
fn eq(&self, other: &ShaderSource) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for ShaderSource
Auto Trait Implementations§
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