/** * By default rendering goes through a 4x multisampled attachment (guaranteed * to be supported by WebGPU) that is resolved into the canvas, so geometric * edges of triangulated marks get antialiased without per-shader work. * `wgOptions.sampleCount = 1` renders directly into the canvas instead. */ export declare const defaultSampleCount = 4; /** WebGPU render attachments only support 1 or 4 samples portably. */ export declare function normalizeSampleCount(value: number): number; export declare function preferredColorFormat(): GPUTextureFormat; export declare function createRenderPipeline(name: string, device: GPUDevice, shader: GPUShaderModule, format: GPUTextureFormat, sampleCount: number, buffers: GPUVertexBufferLayout[], blend: GPUBlendState, fragmentEntryPoint?: string): GPURenderPipeline; /** * A pipeline's bind group layout at `index`. Every bind group made for the * pipeline needs it, and asking the pipeline makes a new one each time. */ export declare function bindGroupLayout(pipeline: GPURenderPipeline, index: number): GPUBindGroupLayout; /** A texture's default view, made once rather than for every pass or bind group. */ export declare function viewOf(texture: GPUTexture): GPUTextureView; /** * The group 0 bind group every mark pipeline takes: the shared uniform block * and the clip path's coverage. * * The mask is not optional. Every shader built on `uniformBlock` declares it * and every fragment entry reads it, so a call that left it out would build a * bind group short of an entry the layout has, and WebGPU throws out the whole * command buffer for that: the frame comes out blank and the reason goes to * `onuncapturederror` rather than failing anything. `clipMaskView` hands back * a placeholder where there is no clip, so there is always one to pass. */ export declare function createUniformBindGroup(name: string, device: GPUDevice, pipeline: GPURenderPipeline, uniforms: GPUBuffer, clipMask: GPUTextureView): GPUBindGroup; /** The bilinear, edge-clamped sampler text and gradient ramps read through. */ export declare function linearSampler(device: GPUDevice): GPUSampler; /** The group 1 bind group of a textured pipeline: its sampler and its texture. */ export declare function textureBindGroup(device: GPUDevice, label: string, pipeline: GPURenderPipeline, sampler: GPUSampler, view: GPUTextureView): GPUBindGroup; /** A texture an image or a rasterized label is copied into. */ export declare function imageTexture(device: GPUDevice, label: string, width: number, height: number, mipLevelCount?: number): GPUTexture; /** * Copies a region of a canvas or bitmap into a texture, kept premultiplied. * Straight alpha turns a fully transparent texel black, and filtering then * drags the colour next to it toward that, darkening the edge. The shaders * divide the alpha back out after sampling. */ export declare function uploadImage(device: GPUDevice, source: HTMLCanvasElement | ImageBitmap, texture: GPUTexture, width: number, height: number, origin?: [x: number, y: number], mipLevel?: number): void;