use crate::error::ShaderCompileError; use librashader_preprocess::ShaderSource; mod shaderc; pub use crate::front::shaderc::GlslangCompilation; /// Trait for types that can compile shader sources into a compilation unit. pub trait ShaderCompilation: Sized { /// Compile the input shader source file into a compilation unit. fn compile(source: &ShaderSource) -> Result; } impl TryFrom<&'a ShaderSource, Error = ShaderCompileError>> ShaderCompilation for T { fn compile(source: &ShaderSource) -> Result { source.try_into() } }