export class WebgpuRenderPipeline extends WebgpuPipeline { /** * Returns the index format a render pipeline depends on. Only a strip topology uses it, as * the strip index format of the pipeline - for any other topology it takes no part, so that * meshes of 16 and 32 bit indices share a pipeline. * * @param {number} primitiveType - The primitive type. * @param {number|undefined} ibFormat - The index buffer format. * @returns {number|undefined} The index format for a strip topology, undefined otherwise. */ static stripIndexFormat(primitiveType: number, ibFormat: number | undefined): number | undefined; lookupHashes: Uint32Array; lookupHashesFloat: Float32Array; /** * The cache of vertex buffer layouts * * @type {WebgpuVertexBufferLayout} */ vertexBufferLayout: WebgpuVertexBufferLayout; /** * The cache of render pipelines * * @type {Map} */ cache: Map; /** * @param {object} primitive - The primitive. * @param {VertexFormat} vertexFormat0 - The first vertex format. * @param {VertexFormat} vertexFormat1 - The second vertex format. * @param {number|undefined} ibFormat - The index buffer format. * @param {Shader} shader - The shader. * @param {RenderTarget} renderTarget - The render target. * @param {BindGroupFormat[]} bindGroupFormats - An array of bind group formats. * @param {BlendState} blendState - The blend state. * @param {DepthState} depthState - The depth state. * @param {number} cullMode - The cull mode. * @param {boolean} stencilEnabled - Whether stencil is enabled. * @param {StencilParameters} stencilFront - The stencil state for front faces. * @param {StencilParameters} stencilBack - The stencil state for back faces. * @param {number} frontFace - The front face. * @param {boolean} alphaToCoverage - Whether alpha to coverage is requested. * @returns {GPURenderPipeline} Returns the render pipeline. * @private */ private get; getBlend(blendState: any): { color: { operation: string; srcFactor: string; dstFactor: string; }; alpha: { operation: string; srcFactor: string; dstFactor: string; }; }; /** * Alpha to coverage is part of the immutable pipeline state on WebGPU, and the spec only allows * it when the render target is multi-sampled and its first color attachment uses a blendable * format with an alpha channel. A material is not tied to a single render target - the same one * can be rendered into a multi-sampled forward pass, a single-sampled pass, or a depth-only * shadow pass with no color attachment at all - so the flag is dropped where it cannot be used * instead of failing the pipeline creation. This matches WebGL, where enabling * SAMPLE_ALPHA_TO_COVERAGE on a single-sampled framebuffer is a no-op rather than an error. * * @param {boolean} alphaToCoverage - The requested alpha to coverage state. * @param {RenderTarget} renderTarget - The render target. * @returns {boolean} Returns true if alpha to coverage can be enabled for the render target. * @private */ private getAlphaToCoverage; /** * @param {DepthState} depthState - The depth state. * @param {RenderTarget} renderTarget - The render target. * @param {boolean} stencilEnabled - Whether stencil is enabled. * @param {StencilParameters} stencilFront - The stencil state for front faces. * @param {StencilParameters} stencilBack - The stencil state for back faces. * @param {string} primitiveTopology - The primitive topology. * @returns {object} Returns the depth stencil state. * @private */ private getDepthStencil; create(primitiveTopology: any, ibFormat: any, shader: any, renderTarget: any, pipelineLayout: any, blendState: any, depthState: any, vertexBufferLayout: any, cullMode: any, stencilEnabled: any, stencilFront: any, stencilBack: any, frontFace: any, alphaToCoverageEnabled: any): any; } import { WebgpuPipeline } from './webgpu-pipeline.js'; import { WebgpuVertexBufferLayout } from './webgpu-vertex-buffer-layout.js'; declare class CacheEntry { /** * Render pipeline * * @type {GPURenderPipeline} * @private */ private pipeline; /** * The full array of hashes used to lookup the pipeline, used in case of hash collision. * * @type {Uint32Array} */ hashes: Uint32Array; } export {};