pub struct PassDescriptor {
pub clear: Option<[f32; 4]>,
pub samples: u32,
pub viewport: Option<PassViewport>,
}Expand description
How a pass is configured, beyond the draws themselves.
Grouped rather than passed as loose parameters so later pass-level state — stencil, depth, damage regions — extends this without changing every backend’s signature.
Fields§
§clear: Option<[f32; 4]>Clear to this color first, or preserve the target’s contents.
samples: u32MSAA sample count. 1 disables multisampling.
Rendering is multisampled and resolved into the target, so the target itself stays single-sampled and directly readable.
viewport: Option<PassViewport>Where this pass’s clip space lands in the target, if not the whole of it.
None maps clip space onto the target exactly, which is what every
pass wants whose geometry was recorded against the target it renders
into. A pass whose geometry was recorded against a larger space sets
this to crop instead of scale — see PassViewport.
Implementations§
Source§impl PassDescriptor
impl PassDescriptor
pub fn clear(color: [f32; 4]) -> Self
Sourcepub fn with_viewport(self, viewport: PassViewport) -> Self
pub fn with_viewport(self, viewport: PassViewport) -> Self
Land this pass’s clip space on part of the target rather than all of it.