pub struct MetalShader {
pub includes: Vec<String>,
pub using_namespaces: Vec<String>,
pub structs: Vec<MetalStruct>,
pub functions: Vec<MetalFunction>,
pub constants: Vec<(MetalType, String, MetalExpr)>,
}Expand description
Top-level Metal shader module representing a single .metal file.
Fields§
§includes: Vec<String>#include headers (just names, e.g. "metal_stdlib")
using_namespaces: Vec<String>using namespace directives (e.g. "metal")
structs: Vec<MetalStruct>Struct definitions
functions: Vec<MetalFunction>All functions (device helpers + shader entry points)
constants: Vec<(MetalType, String, MetalExpr)>Raw constant definitions emitted at file scope
Implementations§
Source§impl MetalShader
impl MetalShader
Sourcepub fn add_include(self, header: impl Into<String>) -> Self
pub fn add_include(self, header: impl Into<String>) -> Self
Add an include header name.
Sourcepub fn add_namespace(self, ns: impl Into<String>) -> Self
pub fn add_namespace(self, ns: impl Into<String>) -> Self
Add a using namespace directive.
Sourcepub fn add_struct(self, s: MetalStruct) -> Self
pub fn add_struct(self, s: MetalStruct) -> Self
Add a struct definition.
Sourcepub fn add_function(self, f: MetalFunction) -> Self
pub fn add_function(self, f: MetalFunction) -> Self
Add a function.
Trait Implementations§
Source§impl Clone for MetalShader
impl Clone for MetalShader
Source§fn clone(&self) -> MetalShader
fn clone(&self) -> MetalShader
Returns a duplicate 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 MetalShader
impl Debug for MetalShader
Source§impl Default for MetalShader
impl Default for MetalShader
Source§impl PartialEq for MetalShader
impl PartialEq for MetalShader
impl StructuralPartialEq for MetalShader
Auto Trait Implementations§
impl Freeze for MetalShader
impl RefUnwindSafe for MetalShader
impl Send for MetalShader
impl Sync for MetalShader
impl Unpin for MetalShader
impl UnsafeUnpin for MetalShader
impl UnwindSafe for MetalShader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more