pub struct MultisampleState {
    pub rasterization_samples: SampleCount,
    pub sample_shading: Option<f32>,
    pub sample_mask: [u32; 2],
    pub alpha_to_coverage_enable: bool,
    pub alpha_to_one_enable: bool,
    pub _ne: NonExhaustive,
}
Expand description

State of the multisampling.

Fields§

§rasterization_samples: SampleCount

The number of rasterization samples to take per pixel. The GPU will pick this many different locations within each pixel and assign to each of these locations a different depth value. The depth and stencil test will then be run for each sample.

The default value is SampleCount::Sample1.

§sample_shading: Option<f32>

Controls the proportion (between 0.0 and 1.0) of the samples that will be run through the fragment shader.

If the value is 1.0, then all sub-pixel samples will run through the shader and get a different value. If the value is 0.5, about half of the samples will run through the shader and the other half will get their values from the ones which went through the shader.

If set to Some, the sample_rate_shading feature must be enabled on the device.

The default value is None.

§sample_mask: [u32; 2]

A mask of bits that is ANDed with the coverage mask of each set of rasterization_samples samples. Only the first rasterization_samples / 32 bits are used, the rest is ignored.

The default value is [u32::MAX; 2].

§alpha_to_coverage_enable: bool

Controls whether the alpha value of the fragment will be used in an implementation-defined way to determine which samples get disabled or not. For example if the alpha value is 0.5, then about half of the samples will be discarded. If you render to a multisample image, this means that the color will end up being mixed with whatever color was underneath, which gives the same effect as alpha blending.

The default value is false.

§alpha_to_one_enable: bool

Controls whether the alpha value of all the samples will be forced to 1.0 (or the maximum possible value) after the effects of alpha_to_coverage have been applied.

If set to true, the alpha_to_one feature must be enabled on the device.

The default value is false.

§_ne: NonExhaustive

Implementations§

source§

impl MultisampleState

source

pub fn new() -> MultisampleState

👎Deprecated since 0.34.0: use MultisampleState::default instead

Creates a MultisampleState with multisampling disabled.

Trait Implementations§

source§

impl Clone for MultisampleState

source§

fn clone(&self) -> MultisampleState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MultisampleState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MultisampleState

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for MultisampleState

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.