Struct wgpu::BlendComponent
source · [−]#[repr(C)]pub struct BlendComponent {
pub src_factor: BlendFactor,
pub dst_factor: BlendFactor,
pub operation: BlendOperation,
}
Expand description
Describes a blend component of a BlendState
.
Corresponds to WebGPU GPUBlendComponent
.
Fields
src_factor: BlendFactor
Multiplier for the source, which is produced by the fragment shader.
dst_factor: BlendFactor
Multiplier for the destination, which is stored in the target.
operation: BlendOperation
The binary operation applied to the source and destination, multiplied by their respective factors.
Implementations
sourceimpl BlendComponent
impl BlendComponent
sourcepub const REPLACE: BlendComponent = Self{src_factor: BlendFactor::One,
dst_factor: BlendFactor::Zero,
operation: BlendOperation::Add,}
pub const REPLACE: BlendComponent = Self{src_factor: BlendFactor::One, dst_factor: BlendFactor::Zero, operation: BlendOperation::Add,}
Default blending state that replaces destination with the source.
sourcepub const OVER: BlendComponent = Self{src_factor: BlendFactor::One,
dst_factor: BlendFactor::OneMinusSrcAlpha,
operation: BlendOperation::Add,}
pub const OVER: BlendComponent = Self{src_factor: BlendFactor::One, dst_factor: BlendFactor::OneMinusSrcAlpha, operation: BlendOperation::Add,}
Blend state of (1 * src) + ((1 - src_alpha) * dst)
sourcepub fn uses_constant(&self) -> bool
pub fn uses_constant(&self) -> bool
Returns true if the state relies on the constant color, which is set independently on a render command encoder.
Trait Implementations
sourceimpl Clone for BlendComponent
impl Clone for BlendComponent
sourcefn clone(&self) -> BlendComponent
fn clone(&self) -> BlendComponent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BlendComponent
impl Debug for BlendComponent
sourceimpl Default for BlendComponent
impl Default for BlendComponent
sourcefn default() -> BlendComponent
fn default() -> BlendComponent
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for BlendComponent
impl<'de> Deserialize<'de> for BlendComponent
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<BlendComponent, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BlendComponent, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for BlendComponent
impl Hash for BlendComponent
sourceimpl PartialEq<BlendComponent> for BlendComponent
impl PartialEq<BlendComponent> for BlendComponent
sourcefn eq(&self, other: &BlendComponent) -> bool
fn eq(&self, other: &BlendComponent) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BlendComponent) -> bool
fn ne(&self, other: &BlendComponent) -> bool
This method tests for !=
.
sourceimpl Serialize for BlendComponent
impl Serialize for BlendComponent
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BlendComponent
impl Eq for BlendComponent
impl StructuralEq for BlendComponent
impl StructuralPartialEq for BlendComponent
Auto Trait Implementations
impl RefUnwindSafe for BlendComponent
impl Send for BlendComponent
impl Sync for BlendComponent
impl Unpin for BlendComponent
impl UnwindSafe for BlendComponent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.