pub trait Compiler<'a>: Sized {
// Required methods
fn set_uint(
self,
option: spvc_compiler_option,
value: c_uint,
) -> Result<Self>;
fn set_bool(self, option: spvc_compiler_option, value: bool) -> Result<Self>;
fn raw_compile(self) -> Result<&'a CStr>;
// Provided methods
fn force_temporary(self, force_temporary: bool) -> Result<Self> { ... }
fn flatten_multidimensional_arrays(
self,
flatten_multidimensional_arrays: bool,
) -> Result<Self> { ... }
fn fixup_depth_convention(
self,
fixup_depth_convention: bool,
) -> Result<Self> { ... }
fn flip_vertex_y(self, flip_vertex_y: bool) -> Result<Self> { ... }
fn emit_line_directives(self, emit_line_directives: bool) -> Result<Self> { ... }
fn enable_storage_image_qualifier_deduction(
self,
enable_storage_image_qualifier_deduction: bool,
) -> Result<Self> { ... }
fn force_zero_initialized_variables(
self,
force_zero_initialized_variables: bool,
) -> Result<Self> { ... }
fn compile(self) -> Result<String> { ... }
}Expand description
A SPIRV-Cross compiler to an unkown target.
Required Methods§
Sourcefn set_uint(self, option: spvc_compiler_option, value: c_uint) -> Result<Self>
fn set_uint(self, option: spvc_compiler_option, value: c_uint) -> Result<Self>
Sets the compiler’s option property to the specified integer value.
Sourcefn set_bool(self, option: spvc_compiler_option, value: bool) -> Result<Self>
fn set_bool(self, option: spvc_compiler_option, value: bool) -> Result<Self>
Sets the compiler’s option property to the specified boolean value.
Sourcefn raw_compile(self) -> Result<&'a CStr>
fn raw_compile(self) -> Result<&'a CStr>
Compiles the program with the specified options, returning a reference to the context’s resulting C string.
This method is usefull if you want to avoid extra allocations, or intend to pass the result to another C function.
Provided Methods§
fn force_temporary(self, force_temporary: bool) -> Result<Self>
fn flatten_multidimensional_arrays( self, flatten_multidimensional_arrays: bool, ) -> Result<Self>
fn fixup_depth_convention(self, fixup_depth_convention: bool) -> Result<Self>
fn flip_vertex_y(self, flip_vertex_y: bool) -> Result<Self>
fn emit_line_directives(self, emit_line_directives: bool) -> Result<Self>
fn enable_storage_image_qualifier_deduction( self, enable_storage_image_qualifier_deduction: bool, ) -> Result<Self>
fn force_zero_initialized_variables( self, force_zero_initialized_variables: bool, ) -> Result<Self>
Sourcefn compile(self) -> Result<String>
fn compile(self) -> Result<String>
Compiles the program with the specified options, returning a UTF-8 encoded copy of the result.
This method makes use of CStr::to_string_lossy, so if the resulting source code returns invalid UTF-8, it will be replaced with the REPLACEMENT_CHARACTER (�).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<'a> Compiler<'a> for GenericCompiler<'a>
impl<'a> Compiler<'a> for GlslCompiler<'a>
glsl only.impl<'a> Compiler<'a> for HlslCompiler<'a>
hlsl only.impl<'a> Compiler<'a> for MslCompiler<'a>
msl only.