{"ast":null,"code":"import { WebGPUCacheRenderPipeline } from \"./webgpuCacheRenderPipeline.js\";\n/** @internal */\nclass NodeState {\n constructor() {\n this.values = {};\n }\n count() {\n let countNode = 0,\n countPipeline = this.pipeline ? 1 : 0;\n for (const value in this.values) {\n const node = this.values[value];\n const [childCountNodes, childCoundPipeline] = node.count();\n countNode += childCountNodes;\n countPipeline += childCoundPipeline;\n countNode++;\n }\n return [countNode, countPipeline];\n }\n}\n/** @internal */\nexport class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline {\n static GetNodeCounts() {\n const counts = WebGPUCacheRenderPipelineTree._Cache.count();\n return {\n nodeCount: counts[0],\n pipelineCount: counts[1]\n };\n }\n static _GetPipelines(node, pipelines, curPath, curPathLen) {\n if (node.pipeline) {\n const path = curPath.slice();\n path.length = curPathLen;\n pipelines.push(path);\n }\n for (const value in node.values) {\n const nnode = node.values[value];\n curPath[curPathLen] = parseInt(value);\n WebGPUCacheRenderPipelineTree._GetPipelines(nnode, pipelines, curPath, curPathLen + 1);\n }\n }\n static GetPipelines() {\n const pipelines = [];\n WebGPUCacheRenderPipelineTree._GetPipelines(WebGPUCacheRenderPipelineTree._Cache, pipelines, [], 0);\n return pipelines;\n }\n static ResetCache() {\n WebGPUCacheRenderPipelineTree._Cache = new NodeState();\n }\n reset() {\n this._nodeStack = [];\n this._nodeStack[0] = WebGPUCacheRenderPipelineTree._Cache;\n super.reset();\n }\n _getRenderPipeline(param) {\n let node = this._nodeStack[this._stateDirtyLowestIndex];\n for (let i = this._stateDirtyLowestIndex; i < this._statesLength; ++i) {\n let nn = node.values[this._states[i]];\n if (!nn) {\n nn = new NodeState();\n node.values[this._states[i]] = nn;\n }\n node = nn;\n this._nodeStack[i + 1] = node;\n }\n param.token = node;\n param.pipeline = node.pipeline;\n }\n _setRenderPipeline(param) {\n param.token.pipeline = param.pipeline;\n }\n}\nWebGPUCacheRenderPipelineTree._Cache = new NodeState();","map":{"version":3,"names":["WebGPUCacheRenderPipeline","NodeState","constructor","values","count","countNode","countPipeline","pipeline","value","node","childCountNodes","childCoundPipeline","WebGPUCacheRenderPipelineTree","GetNodeCounts","counts","_Cache","nodeCount","pipelineCount","_GetPipelines","pipelines","curPath","curPathLen","path","slice","length","push","nnode","parseInt","GetPipelines","ResetCache","reset","_nodeStack","_getRenderPipeline","param","_stateDirtyLowestIndex","i","_statesLength","nn","_states","token","_setRenderPipeline"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipelineTree.js"],"sourcesContent":["import { WebGPUCacheRenderPipeline } from \"./webgpuCacheRenderPipeline.js\";\n/** @internal */\nclass NodeState {\n constructor() {\n this.values = {};\n }\n count() {\n let countNode = 0, countPipeline = this.pipeline ? 1 : 0;\n for (const value in this.values) {\n const node = this.values[value];\n const [childCountNodes, childCoundPipeline] = node.count();\n countNode += childCountNodes;\n countPipeline += childCoundPipeline;\n countNode++;\n }\n return [countNode, countPipeline];\n }\n}\n/** @internal */\nexport class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline {\n static GetNodeCounts() {\n const counts = WebGPUCacheRenderPipelineTree._Cache.count();\n return { nodeCount: counts[0], pipelineCount: counts[1] };\n }\n static _GetPipelines(node, pipelines, curPath, curPathLen) {\n if (node.pipeline) {\n const path = curPath.slice();\n path.length = curPathLen;\n pipelines.push(path);\n }\n for (const value in node.values) {\n const nnode = node.values[value];\n curPath[curPathLen] = parseInt(value);\n WebGPUCacheRenderPipelineTree._GetPipelines(nnode, pipelines, curPath, curPathLen + 1);\n }\n }\n static GetPipelines() {\n const pipelines = [];\n WebGPUCacheRenderPipelineTree._GetPipelines(WebGPUCacheRenderPipelineTree._Cache, pipelines, [], 0);\n return pipelines;\n }\n static ResetCache() {\n WebGPUCacheRenderPipelineTree._Cache = new NodeState();\n }\n reset() {\n this._nodeStack = [];\n this._nodeStack[0] = WebGPUCacheRenderPipelineTree._Cache;\n super.reset();\n }\n _getRenderPipeline(param) {\n let node = this._nodeStack[this._stateDirtyLowestIndex];\n for (let i = this._stateDirtyLowestIndex; i < this._statesLength; ++i) {\n let nn = node.values[this._states[i]];\n if (!nn) {\n nn = new NodeState();\n node.values[this._states[i]] = nn;\n }\n node = nn;\n this._nodeStack[i + 1] = node;\n }\n param.token = node;\n param.pipeline = node.pipeline;\n }\n _setRenderPipeline(param) {\n param.token.pipeline = param.pipeline;\n }\n}\nWebGPUCacheRenderPipelineTree._Cache = new NodeState();\n"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,gCAAgC;AAC1E;AACA,MAAMC,SAAS,CAAC;EACZC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;EACpB;EACAC,KAAKA,CAAA,EAAG;IACJ,IAAIC,SAAS,GAAG,CAAC;MAAEC,aAAa,GAAG,IAAI,CAACC,QAAQ,GAAG,CAAC,GAAG,CAAC;IACxD,KAAK,MAAMC,KAAK,IAAI,IAAI,CAACL,MAAM,EAAE;MAC7B,MAAMM,IAAI,GAAG,IAAI,CAACN,MAAM,CAACK,KAAK,CAAC;MAC/B,MAAM,CAACE,eAAe,EAAEC,kBAAkB,CAAC,GAAGF,IAAI,CAACL,KAAK,CAAC,CAAC;MAC1DC,SAAS,IAAIK,eAAe;MAC5BJ,aAAa,IAAIK,kBAAkB;MACnCN,SAAS,EAAE;IACf;IACA,OAAO,CAACA,SAAS,EAAEC,aAAa,CAAC;EACrC;AACJ;AACA;AACA,OAAO,MAAMM,6BAA6B,SAASZ,yBAAyB,CAAC;EACzE,OAAOa,aAAaA,CAAA,EAAG;IACnB,MAAMC,MAAM,GAAGF,6BAA6B,CAACG,MAAM,CAACX,KAAK,CAAC,CAAC;IAC3D,OAAO;MAAEY,SAAS,EAAEF,MAAM,CAAC,CAAC,CAAC;MAAEG,aAAa,EAAEH,MAAM,CAAC,CAAC;IAAE,CAAC;EAC7D;EACA,OAAOI,aAAaA,CAACT,IAAI,EAAEU,SAAS,EAAEC,OAA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