pub enum LoadOp {
Clear,
Load,
}Expand description
What a render pass attachment does with the contents it already holds before the pass draws anything.
Replaces the "clear" / "load" string literals that
GpuRenderPassColorAttachment.loadOp and
GpuRenderPassDepthStencilAttachment.depthLoadOp accept. A typo in a
string literal is a silent runtime failure (the browser rejects the pass
and the frame renders nothing); a typo in a variant is a compile error.
Variants§
Clear
Overwrite the attachment with its clear value before drawing.
The clear value is ColorAttachment::clear for color
attachments and DepthStencilAttachment::depth_clear for
depth-stencil attachments. WebGPU requires the clear value to be
present whenever this variant is used, which is why the clear
fields on those two structs are Option and paired with a
non-optional load op rather than with Option<&'static str>
defaults resolved by heuristic.
Load
Keep the attachment’s existing contents and draw over them.
The clear value must be absent; any value present is ignored.