Struct shaderc::CompileOptions
[−]
[src]
pub struct CompileOptions { /* fields omitted */ }
An opaque object managing options to compilation.
Methods
impl CompileOptions
[src]
fn new() -> Option<CompileOptions>
Returns a default-initialized compilation options object.
The default options are: * Target environment: Vulkan * Source language: GLSL
A return of None
indicates that there was an error initializing
the underlying options object.
fn clone(&self) -> Option<CompileOptions>
Returns a copy of the given compilation options object.
A return of None
indicates that there was an error copying
the underlying options object.
fn set_target_env(&mut self, env: TargetEnv, version: u32)
Sets the target enviroment to env
, affecting which warnings or errors
will be issued.
The default is Vulkan if not set.
version
will be used for distinguishing between different versions
of the target environment. "0" is the only supported value right now.
fn set_source_language(&mut self, language: SourceLanguage)
Sets the source language.
The default is GLSL if not set.
fn set_forced_version_profile(&mut self, version: u32, profile: GlslProfile)
Forces the GLSL language version
and profile
.
The version number is the same as would appear in the #version
directive in the source. Version and profile specified here
overrides the #version
directive in the source code. Use
GlslProfile::None
for GLSL versions that do not define profiles,
e.g., version below 150.
fn set_limit(&mut self, limit: Limit, value: i32)
Sets the resource limit
to the given value
.
fn add_macro_definition(&mut self, name: &str, value: Option<&str>)
Adds a predefined macro to the compilation options.
This has the same effect as passing -Dname=value
to the command-line
compiler. If value
is None
, it has the same effect as passing
-Dname
to the command-line compiler. If a macro definition with the
same name has previously been added, the value is replaced with the
new value.
fn set_optimization_level(&mut self, level: OptimizationLevel)
Sets the optimization level to level
.
If mulitple invocations for this method, only the last one takes effect.
fn set_generate_debug_info(&mut self)
Sets the compiler mode to generate debug information in the output.
fn set_suppress_warnings(&mut self)
Sets the compiler mode to suppress warnings.
This overrides warnings-as-errors mode: when both suppress-warnings and warnings-as-errors modes are turned on, warning messages will be inhibited, and will not be emitted as error messages.
fn set_warnings_as_errors(&mut self)
Sets the compiler mode to treat all warnings as errors.
Note that the suppress-warnings mode overrides this.