pub struct MaterialInstanceDescriptor {
pub material: RawAssetHandle,
pub params: Vec<(&'static str, ParamValue)>,
}Expand description
One instance’s full set of parameter values, by name. Resolve each
name against the base material’s MaterialDescriptor::binding_index
when building the actual bind group, in your own Asset::upload.
Fields§
§material: RawAssetHandle§params: Vec<(&'static str, ParamValue)>Implementations§
Source§impl MaterialInstanceDescriptor
impl MaterialInstanceDescriptor
pub fn new(material: RawAssetHandle) -> Self
pub fn with_texture(self, name: &'static str, handle: RawAssetHandle) -> Self
pub fn with_texture_array( self, name: &'static str, handle: RawAssetHandle, ) -> Self
pub fn with_cubemap(self, name: &'static str, handle: RawAssetHandle) -> Self
pub fn with_sampler(self, name: &'static str, kind: SamplerKind) -> Self
pub fn with_float(self, name: &'static str, value: f32) -> Self
pub fn with_vec4(self, name: &'static str, value: [f32; 4]) -> Self
pub fn with_bytes(self, name: &'static str, bytes: Vec<u8>) -> Self
Auto Trait Implementations§
impl Freeze for MaterialInstanceDescriptor
impl RefUnwindSafe for MaterialInstanceDescriptor
impl Send for MaterialInstanceDescriptor
impl Sync for MaterialInstanceDescriptor
impl Unpin for MaterialInstanceDescriptor
impl UnsafeUnpin for MaterialInstanceDescriptor
impl UnwindSafe for MaterialInstanceDescriptor
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