logo
pub struct MultisampleState {
    pub sample_shading: Option<f32>,
    pub alpha_to_coverage_enable: bool,
    pub alpha_to_one_enable: bool,
}
Expand description

State of the multisampling.

Fields

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.

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.

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.

Implementations

Creates a MultisampleState with multisampling disabled.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.