/** * WebGPU offscreen render target — the WebGPU counterpart of the WebGL * FBO-backed {@link WebGLRenderTarget}, used by the post-effect chain * through the shared {@link RenderTargetPool}. * * Owns one color `GPUTexture` (renderable AND sampleable — the whole point * of a post-effect target) in the renderer's preferred canvas format, so * pipelines keyed on that format serve canvas and offscreen passes alike. * The depth-stencil attachment is NOT per-target: every pass shares the * renderer's canvas-sized depth-stencil texture (targets in this flow are * canvas-sized, only one pass is open at a time — and sharing the stencil * means a mask active around a post-effect renderable keeps clipping its * offscreen content, which is what masks promise). * * Under the recording model "binding" a target is a pass break: draws * recorded after {@link WebGPURenderer#setRenderTarget} land in a new pass * whose color attachment is this texture. Mid-frame resize/destroy retire * the texture (a texture referenced by recorded draws must not be * destroyed before submit). * @augments RenderTarget * @category Rendering */ export default class WebGPURenderTarget extends RenderTarget { /** * @param {import("../webgpu/webgpu_renderer.js").default} renderer - the owning renderer * @param {number} width - width in pixels * @param {number} height - height in pixels */ constructor(renderer: import("../webgpu/webgpu_renderer.js").default, width: number, height: number, options?: {}); renderer: import("../webgpu/webgpu_renderer.js").default; /** * MSAA sample count for scene rasterization into this target * (1 = single-sampled). When > 1 the target owns a multisampled * color texture that passes rasterize into and resolve into * `texture` at every pass end — so anything sampling the target * always sees resolved pixels. * @type {number} */ sampleCount: number; /** @type {GPUTexture|null} */ texture: GPUTexture | null; /** @type {GPUTextureView|null} */ colorView: GPUTextureView | null; /** the multisampled render half, when sampleCount > 1 @type {GPUTexture|null} */ msaaTexture: GPUTexture | null; /** @type {GPUTextureView|null} */ msaaView: GPUTextureView | null; /** * bumped whenever the backing texture is reallocated — cached bind * groups referencing the old view key on this * @type {number} */ generation: number; materialBindGroup: GPUBindGroup | null; materialBindGroupGeneration: number; pendingClear: boolean; /** * Synchronous readback is impossible under WebGPU — use * {@link WebGPURenderTarget#readPixels}. * @throws {Error} always * @override */ override getImageData(): void; /** * Asynchronously read back this target's pixels. * @param {number} [x=0] - x of the top-left corner * @param {number} [y=0] - y of the top-left corner * @param {number} [width=this.width] - width of the area to read * @param {number} [height=this.height] - height of the area to read * @returns {Promise} the pixel data (RGBA order) */ readPixels(x?: number, y?: number, width?: number, height?: number): Promise; } import RenderTarget from "./rendertarget.ts"; //# sourceMappingURL=webgpurendertarget.d.ts.map