Struct librashader_reflect::front::GlslangCompilation
source · pub struct GlslangCompilation { /* private fields */ }Expand description
A reflectable shader compilation via glslang (shaderc).
Implementations§
source§impl GlslangCompilation
impl GlslangCompilation
sourcepub fn compile(source: &ShaderSource) -> Result<Self, ShaderCompileError>
pub fn compile(source: &ShaderSource) -> Result<Self, ShaderCompileError>
Tries to compile SPIR-V from the provided shader source.
Trait Implementations§
source§impl Clone for GlslangCompilation
impl Clone for GlslangCompilation
source§fn clone(&self) -> GlslangCompilation
fn clone(&self) -> GlslangCompilation
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 GlslangCompilation
impl Debug for GlslangCompilation
source§impl<'de> Deserialize<'de> for GlslangCompilation
impl<'de> Deserialize<'de> for GlslangCompilation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromCompilation<GlslangCompilation> for GLSL
impl FromCompilation<GlslangCompilation> for GLSL
§type Context = CrossGlslContext
type Context = CrossGlslContext
Additional context returned by the compiler after compilation.
§type Output = impl CompileShader<<GLSL as FromCompilation<GlslangCompilation>>::Target, Options = Version, Context = <GLSL as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
type Output = impl CompileShader<<GLSL as FromCompilation<GlslangCompilation>>::Target, Options = Version, Context = <GLSL as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
The output type after conversion.
source§fn from_compilation(
compile: GlslangCompilation
) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
fn from_compilation( compile: GlslangCompilation ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
Tries to convert the input object into an object ready for compilation.
source§impl FromCompilation<GlslangCompilation> for HLSL
impl FromCompilation<GlslangCompilation> for HLSL
§type Options = Option<ShaderModel>
type Options = Option<ShaderModel>
Options provided to the compiler.
§type Context = CrossHlslContext
type Context = CrossHlslContext
Additional context returned by the compiler after compilation.
§type Output = impl CompileShader<<HLSL as FromCompilation<GlslangCompilation>>::Target, Options = <HLSL as FromCompilation<GlslangCompilation>>::Options, Context = <HLSL as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
type Output = impl CompileShader<<HLSL as FromCompilation<GlslangCompilation>>::Target, Options = <HLSL as FromCompilation<GlslangCompilation>>::Options, Context = <HLSL as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
The output type after conversion.
source§fn from_compilation(
compile: GlslangCompilation
) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
fn from_compilation( compile: GlslangCompilation ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
Tries to convert the input object into an object ready for compilation.
source§impl FromCompilation<GlslangCompilation> for SPIRV
impl FromCompilation<GlslangCompilation> for SPIRV
§type Output = impl CompileShader<<SPIRV as FromCompilation<GlslangCompilation>>::Target, Options = <SPIRV as FromCompilation<GlslangCompilation>>::Options, Context = <SPIRV as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
type Output = impl CompileShader<<SPIRV as FromCompilation<GlslangCompilation>>::Target, Options = <SPIRV as FromCompilation<GlslangCompilation>>::Options, Context = <SPIRV as FromCompilation<GlslangCompilation>>::Context> + ReflectShader
The output type after conversion.
source§fn from_compilation(
compile: GlslangCompilation
) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
fn from_compilation( compile: GlslangCompilation ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
Tries to convert the input object into an object ready for compilation.
source§impl Serialize for GlslangCompilation
impl Serialize for GlslangCompilation
source§impl TryFrom<&ShaderSource> for GlslangCompilation
impl TryFrom<&ShaderSource> for GlslangCompilation
source§fn try_from(source: &ShaderSource) -> Result<Self, Self::Error>
fn try_from(source: &ShaderSource) -> Result<Self, Self::Error>
Tries to compile SPIR-V from the provided shader source.
§type Error = ShaderCompileError
type Error = ShaderCompileError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl RefUnwindSafe for GlslangCompilation
impl Send for GlslangCompilation
impl Sync for GlslangCompilation
impl Unpin for GlslangCompilation
impl UnwindSafe for GlslangCompilation
Blanket Implementations§
source§impl<T> ShaderCompilation for Twhere
T: for<'a> TryFrom<&'a ShaderSource, Error = ShaderCompileError>,
impl<T> ShaderCompilation for Twhere T: for<'a> TryFrom<&'a ShaderSource, Error = ShaderCompileError>,
source§fn compile(source: &ShaderSource) -> Result<T, ShaderCompileError>
fn compile(source: &ShaderSource) -> Result<T, ShaderCompileError>
Compile the input shader source file into a compilation unit.