pub struct CompileOptions(/* private fields */);Expand description
Options for compiling shader source code.
C++ equivalent: MTL::CompileOptions
Implementations§
Source§impl CompileOptions
impl CompileOptions
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create new compile options.
C++ equivalent: static CompileOptions* alloc()->init()
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Create a CompileOptions from a raw pointer.
§Safety
The pointer must be a valid Metal compile options object.
Sourcepub fn fast_math_enabled(&self) -> bool
pub fn fast_math_enabled(&self) -> bool
Get whether fast math is enabled.
C++ equivalent: bool fastMathEnabled() const
Sourcepub fn set_fast_math_enabled(&self, enabled: bool)
pub fn set_fast_math_enabled(&self, enabled: bool)
Set whether fast math is enabled.
C++ equivalent: void setFastMathEnabled(bool)
Sourcepub fn language_version(&self) -> LanguageVersion
pub fn language_version(&self) -> LanguageVersion
Get the language version.
C++ equivalent: LanguageVersion languageVersion() const
Sourcepub fn set_language_version(&self, version: LanguageVersion)
pub fn set_language_version(&self, version: LanguageVersion)
Set the language version.
C++ equivalent: void setLanguageVersion(LanguageVersion)
Sourcepub fn preserve_invariance(&self) -> bool
pub fn preserve_invariance(&self) -> bool
Get whether to preserve invariance.
C++ equivalent: bool preserveInvariance() const
Sourcepub fn set_preserve_invariance(&self, preserve: bool)
pub fn set_preserve_invariance(&self, preserve: bool)
Set whether to preserve invariance.
C++ equivalent: void setPreserveInvariance(bool)
Sourcepub fn optimization_level(&self) -> LibraryOptimizationLevel
pub fn optimization_level(&self) -> LibraryOptimizationLevel
Get the optimization level.
C++ equivalent: LibraryOptimizationLevel optimizationLevel() const
Sourcepub fn set_optimization_level(&self, level: LibraryOptimizationLevel)
pub fn set_optimization_level(&self, level: LibraryOptimizationLevel)
Set the optimization level.
C++ equivalent: void setOptimizationLevel(MTL::LibraryOptimizationLevel)
Sourcepub fn math_mode(&self) -> MathMode
pub fn math_mode(&self) -> MathMode
Get the math mode.
C++ equivalent: MathMode mathMode() const
Sourcepub fn set_math_mode(&self, mode: MathMode)
pub fn set_math_mode(&self, mode: MathMode)
Set the math mode.
C++ equivalent: void setMathMode(MTL::MathMode)
Sourcepub fn math_floating_point_functions(&self) -> MathFloatingPointFunctions
pub fn math_floating_point_functions(&self) -> MathFloatingPointFunctions
Get the math floating point functions precision.
C++ equivalent: MathFloatingPointFunctions mathFloatingPointFunctions() const
Sourcepub fn set_math_floating_point_functions(
&self,
funcs: MathFloatingPointFunctions,
)
pub fn set_math_floating_point_functions( &self, funcs: MathFloatingPointFunctions, )
Set the math floating point functions precision.
C++ equivalent: void setMathFloatingPointFunctions(MTL::MathFloatingPointFunctions)
Sourcepub fn compile_symbol_visibility(&self) -> CompileSymbolVisibility
pub fn compile_symbol_visibility(&self) -> CompileSymbolVisibility
Get the compile symbol visibility.
C++ equivalent: CompileSymbolVisibility compileSymbolVisibility() const
Sourcepub fn set_compile_symbol_visibility(&self, visibility: CompileSymbolVisibility)
pub fn set_compile_symbol_visibility(&self, visibility: CompileSymbolVisibility)
Set the compile symbol visibility.
C++ equivalent: void setCompileSymbolVisibility(MTL::CompileSymbolVisibility)
Sourcepub fn library_type(&self) -> LibraryType
pub fn library_type(&self) -> LibraryType
Get the library type.
C++ equivalent: LibraryType libraryType() const
Sourcepub fn set_library_type(&self, lib_type: LibraryType)
pub fn set_library_type(&self, lib_type: LibraryType)
Set the library type.
C++ equivalent: void setLibraryType(MTL::LibraryType)
Sourcepub fn install_name(&self) -> Option<String>
pub fn install_name(&self) -> Option<String>
Get the install name (for dynamic libraries).
C++ equivalent: NS::String* installName() const
Sourcepub fn set_install_name(&self, name: &str)
pub fn set_install_name(&self, name: &str)
Set the install name (for dynamic libraries).
C++ equivalent: void setInstallName(const NS::String*)
Sourcepub fn allow_referencing_undefined_symbols(&self) -> bool
pub fn allow_referencing_undefined_symbols(&self) -> bool
Get whether to allow referencing undefined symbols.
C++ equivalent: bool allowReferencingUndefinedSymbols() const
Sourcepub fn set_allow_referencing_undefined_symbols(&self, allow: bool)
pub fn set_allow_referencing_undefined_symbols(&self, allow: bool)
Set whether to allow referencing undefined symbols.
C++ equivalent: void setAllowReferencingUndefinedSymbols(bool)
Sourcepub fn enable_logging(&self) -> bool
pub fn enable_logging(&self) -> bool
Get whether logging is enabled.
C++ equivalent: bool enableLogging() const
Sourcepub fn set_enable_logging(&self, enable: bool)
pub fn set_enable_logging(&self, enable: bool)
Set whether logging is enabled.
C++ equivalent: void setEnableLogging(bool)
Sourcepub fn max_total_threads_per_threadgroup(&self) -> UInteger
pub fn max_total_threads_per_threadgroup(&self) -> UInteger
Get the maximum total threads per threadgroup.
C++ equivalent: NS::UInteger maxTotalThreadsPerThreadgroup() const
Sourcepub fn set_max_total_threads_per_threadgroup(&self, count: UInteger)
pub fn set_max_total_threads_per_threadgroup(&self, count: UInteger)
Set the maximum total threads per threadgroup.
C++ equivalent: void setMaxTotalThreadsPerThreadgroup(NS::UInteger)
Sourcepub fn required_threads_per_threadgroup(&self) -> Size
pub fn required_threads_per_threadgroup(&self) -> Size
Get the required threads per threadgroup.
C++ equivalent: Size requiredThreadsPerThreadgroup() const
Sourcepub fn set_required_threads_per_threadgroup(&self, size: Size)
pub fn set_required_threads_per_threadgroup(&self, size: Size)
Set the required threads per threadgroup.
C++ equivalent: void setRequiredThreadsPerThreadgroup(MTL::Size)
Sourcepub fn preprocessor_macros_raw(&self) -> *mut c_void
pub fn preprocessor_macros_raw(&self) -> *mut c_void
Get the preprocessor macros dictionary.
Returns the dictionary of preprocessor macros as a raw pointer.
Use mtl_foundation::Dictionary to work with the returned value.
C++ equivalent: NS::Dictionary* preprocessorMacros() const
Sourcepub unsafe fn set_preprocessor_macros_raw(&self, dict: *const c_void)
pub unsafe fn set_preprocessor_macros_raw(&self, dict: *const c_void)
Set the preprocessor macros dictionary.
Takes a raw pointer to an NSDictionary containing the preprocessor macros.
C++ equivalent: void setPreprocessorMacros(const NS::Dictionary*)
§Safety
The dictionary pointer must be valid or null.