1 line
23 KiB
Plaintext
1 line
23 KiB
Plaintext
{"version":3,"file":"PipelineSystem.mjs","sources":["../../../../../src/rendering/renderers/gpu/pipeline/PipelineSystem.ts"],"sourcesContent":["import { ExtensionType } from '../../../../extensions/Extensions';\nimport { warn } from '../../../../utils/logging/warn';\nimport { ensureAttributes } from '../../gl/shader/program/ensureAttributes';\nimport { STENCIL_MODES } from '../../shared/state/const';\nimport { createIdFromString } from '../../shared/utils/createIdFromString';\nimport { GpuStencilModesToPixi } from '../state/GpuStencilModesToPixi';\n\nimport type { Topology } from '../../shared/geometry/const';\nimport type { Geometry } from '../../shared/geometry/Geometry';\nimport type { State } from '../../shared/state/State';\nimport type { System } from '../../shared/system/System';\nimport type { GPU } from '../GpuDeviceSystem';\nimport type { GpuRenderTarget } from '../renderTarget/GpuRenderTarget';\nimport type { GpuProgram } from '../shader/GpuProgram';\nimport type { StencilState } from '../state/GpuStencilModesToPixi';\nimport type { WebGPURenderer } from '../WebGPURenderer';\n\nconst topologyStringToId = {\n 'point-list': 0,\n 'line-list': 1,\n 'line-strip': 2,\n 'triangle-list': 3,\n 'triangle-strip': 4,\n};\n\n// geometryLayouts = 256; // 8 bits // 256 states // value 0-255;\n// shaderKeys = 256; // 8 bits // 256 states // value 0-255;\n// state = 64; // 6 bits // 64 states // value 0-63;\n// blendMode = 32; // 5 bits // 32 states // value 0-31;\n// topology = 8; // 3 bits // 8 states // value 0-7;\nfunction getGraphicsStateKey(\n geometryLayout: number,\n shaderKey: number,\n state: number,\n blendMode: number,\n topology: number,\n): number\n{\n return (geometryLayout << 24) // Allocate the 8 bits for geometryLayouts at the top\n | (shaderKey << 16) // Next 8 bits for shaderKeys\n | (state << 10) // 6 bits for state\n | (blendMode << 5) // 5 bits for blendMode\n | topology; // And 3 bits for topology at the least significant position\n}\n\n// colorMask = 16;// 4 bits // 16 states // value 0-15;\n// stencilState = 8; // 3 bits // 8 states // value 0-7;\n// renderTarget = 1; // 2 bit // 3 states // value 0-3; // none, stencil, depth, depth-stencil\n// multiSampleCount = 1; // 1 bit // 2 states // value 0-1;\nfunction getGlobalStateKey(\n stencilStateId: number,\n multiSampleCount: number,\n colorMask: number,\n renderTarget: number,\n): number\n{\n return (colorMask << 6) // Allocate the 4 bits for colorMask at the top\n | (stencilStateId << 3) // Next 3 bits for stencilStateId\n | (renderTarget << 1) // 2 bits for renderTarget\n | multiSampleCount; // And 1 bit for multiSampleCount at the least significant position\n}\n\ntype PipeHash = Record<number, GPURenderPipeline>;\n\n/**\n * A system that creates and manages the GPU pipelines.\n *\n * Caching Mechanism: At its core, the system employs a two-tiered caching strategy to minimize\n * the redundant creation of GPU pipelines (or \"pipes\"). This strategy is based on generating unique\n * keys that represent the state of the graphics settings and the specific requirements of the\n * item being rendered. By caching these pipelines, subsequent draw calls with identical configurations\n * can reuse existing pipelines instead of generating new ones.\n *\n * State Management: The system differentiates between \"global\" state properties (like color masks\n * and stencil masks, which do not change frequently) and properties that may vary between draw calls\n * (such as geometry, shaders, and blend modes). Unique keys are generated for both these categories\n * using getStateKey for global state and getGraphicsStateKey for draw-specific settings. These keys are\n * then then used to caching the pipe. The next time we need a pipe we can check\n * the cache by first looking at the state cache and then the pipe cache.\n * @memberof rendering\n */\nexport class PipelineSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGPUSystem],\n name: 'pipeline',\n } as const;\n private readonly _renderer: WebGPURenderer;\n\n protected CONTEXT_UID: number;\n\n private _moduleCache: Record<string, GPUShaderModule> = Object.create(null);\n private _bufferLayoutsCache: Record<number, GPUVertexBufferLayout[]> = Object.create(null);\n private readonly _bindingNamesCache: Record<string, Record<string, string>> = Object.create(null);\n\n private _pipeCache: PipeHash = Object.create(null);\n private readonly _pipeStateCaches: Record<number, PipeHash> = Object.create(null);\n\n private _gpu: GPU;\n private _stencilState: StencilState;\n\n private _stencilMode: STENCIL_MODES;\n private _colorMask = 0b1111;\n private _multisampleCount = 1;\n private _depthStencilAttachment: 0 | 1;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n this.setStencilMode(STENCIL_MODES.DISABLED);\n\n this._updatePipeHash();\n }\n\n public setMultisampleCount(multisampleCount: number): void\n {\n if (this._multisampleCount === multisampleCount) return;\n\n this._multisampleCount = multisampleCount;\n\n this._updatePipeHash();\n }\n\n public setRenderTarget(renderTarget: GpuRenderTarget)\n {\n this._multisampleCount = renderTarget.msaaSamples;\n this._depthStencilAttachment = renderTarget.descriptor.depthStencilAttachment ? 1 : 0;\n\n this._updatePipeHash();\n }\n\n public setColorMask(colorMask: number): void\n {\n if (this._colorMask === colorMask) return;\n\n this._colorMask = colorMask;\n\n this._updatePipeHash();\n }\n\n public setStencilMode(stencilMode: STENCIL_MODES): void\n {\n if (this._stencilMode === stencilMode) return;\n\n this._stencilMode = stencilMode;\n this._stencilState = GpuStencilModesToPixi[stencilMode];\n\n this._updatePipeHash();\n }\n\n public setPipeline(geometry: Geometry, program: GpuProgram, state: State, passEncoder: GPURenderPassEncoder): void\n {\n const pipeline = this.getPipeline(geometry, program, state);\n\n passEncoder.setPipeline(pipeline);\n }\n\n public getPipeline(\n geometry: Geometry,\n program: GpuProgram,\n state: State,\n topology?: Topology,\n ): GPURenderPipeline\n {\n if (!geometry._layoutKey)\n {\n ensureAttributes(geometry, program.attributeData);\n\n // prepare the geometry for the pipeline\n this._generateBufferKey(geometry);\n }\n\n topology = topology || geometry.topology;\n\n // now we have set the Ids - the key is different...\n // eslint-disable-next-line max-len\n const key = getGraphicsStateKey(\n geometry._layoutKey,\n program._layoutKey,\n state.data,\n state._blendModeId,\n topologyStringToId[topology],\n );\n\n if (this._pipeCache[key]) return this._pipeCache[key];\n\n this._pipeCache[key] = this._createPipeline(geometry, program, state, topology);\n\n return this._pipeCache[key];\n }\n\n private _createPipeline(geometry: Geometry, program: GpuProgram, state: State, topology: Topology): GPURenderPipeline\n {\n const device = this._gpu.device;\n\n const buffers = this._createVertexBufferLayouts(geometry, program);\n\n const blendModes = this._renderer.state.getColorTargets(state);\n\n blendModes[0].writeMask = this._stencilMode === STENCIL_MODES.RENDERING_MASK_ADD ? 0 : this._colorMask;\n\n const layout = this._renderer.shader.getProgramData(program).pipeline;\n\n const descriptor: GPURenderPipelineDescriptor = {\n // TODO later check if its helpful to create..\n // layout,\n vertex: {\n module: this._getModule(program.vertex.source),\n entryPoint: program.vertex.entryPoint,\n // geometry..\n buffers,\n },\n fragment: {\n module: this._getModule(program.fragment.source),\n entryPoint: program.fragment.entryPoint,\n targets: blendModes,\n },\n primitive: {\n topology,\n cullMode: state.cullMode,\n },\n layout,\n multisample: {\n count: this._multisampleCount,\n },\n // depthStencil,\n label: `PIXI Pipeline`,\n };\n\n // only apply if the texture has stencil or depth\n if (this._depthStencilAttachment)\n {\n // mask states..\n descriptor.depthStencil = {\n ...this._stencilState,\n format: 'depth24plus-stencil8',\n depthWriteEnabled: state.depthTest,\n depthCompare: state.depthTest ? 'less' : 'always',\n };\n }\n\n const pipeline = device.createRenderPipeline(descriptor);\n\n return pipeline;\n }\n\n private _getModule(code: string): GPUShaderModule\n {\n return this._moduleCache[code] || this._createModule(code);\n }\n\n private _createModule(code: string): GPUShaderModule\n {\n const device = this._gpu.device;\n\n this._moduleCache[code] = device.createShaderModule({\n code,\n });\n\n return this._moduleCache[code];\n }\n\n private _generateBufferKey(geometry: Geometry): number\n {\n const keyGen = [];\n let index = 0;\n // generate a key..\n\n const attributeKeys = Object.keys(geometry.attributes).sort();\n\n for (let i = 0; i < attributeKeys.length; i++)\n {\n const attribute = geometry.attributes[attributeKeys[i]];\n\n keyGen[index++] = attribute.offset;\n keyGen[index++] = attribute.format;\n keyGen[index++] = attribute.stride;\n keyGen[index++] = attribute.instance;\n }\n\n const stringKey = keyGen.join('|');\n\n geometry._layoutKey = createIdFromString(stringKey, 'geometry');\n\n return geometry._layoutKey;\n }\n\n private _generateAttributeLocationsKey(program: GpuProgram): number\n {\n const keyGen = [];\n let index = 0;\n // generate a key..\n\n const attributeKeys = Object.keys(program.attributeData).sort();\n\n for (let i = 0; i < attributeKeys.length; i++)\n {\n const attribute = program.attributeData[attributeKeys[i]];\n\n keyGen[index++] = attribute.location;\n }\n\n const stringKey = keyGen.join('|');\n\n program._attributeLocationsKey = createIdFromString(stringKey, 'programAttributes');\n\n return program._attributeLocationsKey;\n }\n\n /**\n * Returns a hash of buffer names mapped to bind locations.\n * This is used to bind the correct buffer to the correct location in the shader.\n * @param geometry - The geometry where to get the buffer names\n * @param program - The program where to get the buffer names\n * @returns An object of buffer names mapped to the bind location.\n */\n public getBufferNamesToBind(geometry: Geometry, program: GpuProgram): Record<string, string>\n {\n const key = (geometry._layoutKey << 16) | program._attributeLocationsKey;\n\n if (this._bindingNamesCache[key]) return this._bindingNamesCache[key];\n\n const data = this._createVertexBufferLayouts(geometry, program);\n\n // now map the data to the buffers..\n const bufferNamesToBind: Record<string, string> = Object.create(null);\n\n const attributeData = program.attributeData;\n\n for (let i = 0; i < data.length; i++)\n {\n for (const j in attributeData)\n {\n if (attributeData[j].location === i)\n {\n bufferNamesToBind[i] = j;\n break;\n }\n }\n }\n\n this._bindingNamesCache[key] = bufferNamesToBind;\n\n return bufferNamesToBind;\n }\n\n private _createVertexBufferLayouts(geometry: Geometry, program: GpuProgram): GPUVertexBufferLayout[]\n {\n if (!program._attributeLocationsKey) this._generateAttributeLocationsKey(program);\n\n const key = (geometry._layoutKey << 16) | program._attributeLocationsKey;\n\n if (this._bufferLayoutsCache[key])\n {\n return this._bufferLayoutsCache[key];\n }\n\n const vertexBuffersLayout: GPUVertexBufferLayout[] = [];\n\n geometry.buffers.forEach((buffer) =>\n {\n const bufferEntry: GPUVertexBufferLayout = {\n arrayStride: 0,\n stepMode: 'vertex',\n attributes: [],\n };\n\n const bufferEntryAttributes = bufferEntry.attributes as GPUVertexAttribute[];\n\n for (const i in program.attributeData)\n {\n const attribute = geometry.attributes[i];\n\n if ((attribute.divisor ?? 1) !== 1)\n {\n // TODO: Maybe emulate divisor with storage_buffers/float_textures?\n // For now just issue a warning\n warn(`Attribute ${i} has an invalid divisor value of '${attribute.divisor}'. `\n + 'WebGPU only supports a divisor value of 1');\n }\n\n if (attribute.buffer === buffer)\n {\n bufferEntry.arrayStride = attribute.stride;\n bufferEntry.stepMode = attribute.instance ? 'instance' : 'vertex';\n\n bufferEntryAttributes.push({\n shaderLocation: program.attributeData[i].location,\n offset: attribute.offset,\n format: attribute.format,\n });\n }\n }\n\n if (bufferEntryAttributes.length)\n {\n vertexBuffersLayout.push(bufferEntry);\n }\n });\n\n this._bufferLayoutsCache[key] = vertexBuffersLayout;\n\n return vertexBuffersLayout;\n }\n\n private _updatePipeHash(): void\n {\n const key = getGlobalStateKey(\n this._stencilMode,\n this._multisampleCount,\n this._colorMask,\n this._depthStencilAttachment\n );\n\n if (!this._pipeStateCaches[key])\n {\n this._pipeStateCaches[key] = Object.create(null);\n }\n\n this._pipeCache = this._pipeStateCaches[key];\n }\n\n public destroy(): void\n {\n (this._renderer as null) = null;\n this._bufferLayoutsCache = null;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAiBA,MAAM,kBAAqB,GAAA;AAAA,EACvB,YAAc,EAAA,CAAA;AAAA,EACd,WAAa,EAAA,CAAA;AAAA,EACb,YAAc,EAAA,CAAA;AAAA,EACd,eAAiB,EAAA,CAAA;AAAA,EACjB,gBAAkB,EAAA,CAAA;AACtB,CAAA,CAAA;AAOA,SAAS,mBACL,CAAA,cAAA,EACA,SACA,EAAA,KAAA,EACA,WACA,QAEJ,EAAA;AACI,EAAA,OAAQ,kBAAkB,EAClB,GAAA,SAAA,IAAa,KACb,KAAS,IAAA,EAAA,GACT,aAAa,CACd,GAAA,QAAA,CAAA;AACX,CAAA;AAMA,SAAS,iBACL,CAAA,cAAA,EACA,gBACA,EAAA,SAAA,EACA,YAEJ,EAAA;AACI,EAAA,OAAQ,SAAa,IAAA,CAAA,GACb,cAAkB,IAAA,CAAA,GAClB,gBAAgB,CACjB,GAA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