Struct luminance::pipeline::PipelineState [−][src]
#[non_exhaustive]pub struct PipelineState {
pub clear_color: Option<[f32; 4]>,
pub clear_depth: Option<f32>,
pub clear_stencil: Option<i32>,
pub viewport: Viewport,
pub srgb_enabled: bool,
pub clear_scissor: Option<ScissorRegion>,
}
Expand description
Various customization options for pipelines.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.clear_color: Option<[f32; 4]>
Color to use when clearing color buffers.
Set this to Some(color)
to use that color to clear the Framebuffer
when running a PipelineGate
. Set it
to None
not to clear the framebuffer when running the PipelineGate
.
An example of not setting the clear color is if you want to accumulate renders in a Framebuffer
(for instance
for a paint-like application).
clear_depth: Option<f32>
Depth value to use when clearing the depth buffer.
Set this to Some(depth)
to use that depth to clear the Framebuffer
depth buffer.
clear_stencil: Option<i32>
Stencil value to use when clearing the stencil buffer.
Set this to Some(stencil)
to use that stencil to clear the Framebuffer
stencil buffer.
viewport: Viewport
Viewport to use when rendering.
srgb_enabled: bool
Whether sRGB support should be enabled.
When this is set to true
, shader outputs that go in Framebuffer
for each of the color slots have sRGB pixel
formats are assumed to be in the linear RGB color space. The pipeline will then convert that linear color outputs
to sRGB to be stored in the Framebuffer
.
Typical examples are when you are rendering into an image that is to be displayed to on screen: the
Framebuffer
can use sRGB color pixel formats and the shader doesn’t have to worry about converting from linear
color space into sRGB color space, as the pipeline will do that for you.
clear_scissor: Option<ScissorRegion>
Whether to use scissor test when clearing buffers.
Implementations
Create a default PipelineState
.
See the documentation of the Default
for further details.
Set the clear color.
Get the clear depth, if any.
Set the clear depth.
Get the clear stencil, if any.
Set the clear stencil.
Set the viewport.
Check whether sRGB linearization is enabled.
Enable sRGB linearization.
Get the scissor configuration, if any.
Set the scissor configuration.
Trait Implementations
Default PipelineState
:
- Clear color is
Some([0., 0., 0., 1.])
. - Depth value is
Some(1.)
. - Stencil value is
Some(0)
. - The viewport uses the whole framebuffer’s.
- sRGB encoding is disabled.
- No scissor test is performed.
Auto Trait Implementations
impl RefUnwindSafe for PipelineState
impl Send for PipelineState
impl Sync for PipelineState
impl Unpin for PipelineState
impl UnwindSafe for PipelineState
Blanket Implementations
Mutably borrows from an owned value. Read more