pub struct ColorAttachment {
pub view: Option<JsValue>,
pub resolve_target: Option<JsValue>,
pub clear: Option<Color>,
pub load_op: LoadOp,
pub store_op: StoreOp,
}Expand description
One color attachment of a render pass.
Replaces the historical RenderPassColorAttachment. The two Option<&'static str>
load and store ops disappear: a LoadOp and a StoreOp say
directly what the old optional strings inferred, and a clear color is
the engine’s own Color rather than a bare (f64, f64, f64, f64)
tuple whose channel order had to be re-checked at every call site.
Fields§
§view: Option<JsValue>The texture view to draw into, or None to let the renderer use
the swap-chain view (or the MSAA intermediate view when
antialiasing is on).
resolve_target: Option<JsValue>The destination view that a multisampled attachment resolves into,
or None when multisampling is disabled. The renderer substitutes
the swap-chain view when this is None but the attachment is
multisampled.
clear: Option<Color>The color to overwrite the attachment with when load_op is
LoadOp::Clear. None means no clear, so load_op must then be
LoadOp::Load.
load_op: LoadOpWhat to do with the attachment’s existing contents before drawing.
store_op: StoreOpWhat to do with the attachment’s contents once the pass ends.