API

Interface RenderTargetDescriptor

Describes a render target — what attachments to create, not the GPU objects themselves. GPU textures are allocated later by buildRenderTarget.

interface RenderTargetDescriptor {
    depthClearValue?: number;
    depthCompare?: GPUCompareFunction;
    dFormat?: GPUTextureFormat;
    format?: GPUTextureFormat;
    lbl?: string;
    samples: number;
    size:
        | SurfaceContext
        | RenderTargetSurfaceSize
        | { height: number; width: number };
}
Index
depthClearValue?: number

Depth clear value. Defaults to reverse-Z far depth 0. Standard-Z targets normally use 1.

depthCompare?: GPUCompareFunction

Depth compare for pipelines targeting this RT. Defaults to reverse-Z "greater-equal".

dFormat?: GPUTextureFormat

Depth/stencil attachment format (e.g. "depth24plus-stencil8"). Omit for a color-only target (e.g. the swapchain).

format?: GPUTextureFormat

Color attachment texture format (e.g. "bgra8unorm", "rgba16float"). Omit for a depth-only target.

lbl?: string

Debug label applied to the allocated GPU color/depth textures.

samples: number

MSAA sample count: 1 = single-sample (no multisampling), 4 = 4x MSAA.

size:
    | SurfaceContext
    | RenderTargetSurfaceSize
    | { height: number; width: number }

A SurfaceContext for full surface dimensions, { surface, scale } for scaled live dimensions, or explicit { width, height } device pixels. Surface-backed sizes are re-resolved on every buildRenderTarget.