webgpu-impl-render-targets
Installation
SKILL.md
WebGPU Render Targets
Configure the GPURenderPassDescriptor attachments a render pass writes into: the
canvas color target, extra color targets for MRT, a depth-stencil buffer, and MSAA.
Quick Reference
Color attachment fields (colorAttachments[] entries):
| Field | Type | Required | Notes |
|---|---|---|---|
view |
GPUTextureView |
yes | Texture subresource written by the pass |
loadOp |
"clear" | "load" |
yes | "clear" resets to clearValue; "load" keeps contents |
storeOp |
"store" | "discard" |
yes | "store" writes results back; "discard" drops them |
clearValue |
{r,g,b,a} or [r,g,b,a] |
no | Consumed ONLY when loadOp is "clear"; default {0,0,0,0} |
resolveTarget |
GPUTextureView |
no | MSAA resolve destination; single-sample view |
depthSlice |
number | no | Index of a 3D-texture slice to render into |
Depth-stencil attachment fields (depthStencilAttachment):