{"ast":null,"code":"/**\n * @internal\n * @experimental\n */\nexport class FrameGraphRenderTarget {\n constructor(name, textureManager, renderTargets, renderTargetDepth) {\n this._isBackBuffer = false;\n this.name = name;\n this._textureManager = textureManager;\n this._renderTargets = renderTargets === undefined ? undefined : Array.isArray(renderTargets) ? renderTargets : [renderTargets];\n this._renderTargetDepth = renderTargetDepth;\n }\n get renderTargetWrapper() {\n if (this._isBackBuffer) {\n return undefined;\n }\n if (!this._renderTargetWrapper) {\n var _this$_renderTargets$, _this$_renderTargets, _textureDescription$o;\n const engine = this._textureManager.engine;\n // _renderTargets and _renderTargetDepth cannot both be undefined\n const textureHandle = this._renderTargets === undefined ? this._renderTargetDepth : this._renderTargets[0];\n if (this._textureManager.isBackbuffer(textureHandle)) {\n this._isBackBuffer = true;\n return undefined;\n }\n const textureDescription = this._textureManager.getTextureDescription(textureHandle);\n const creationOptionsForTexture = {\n textureCount: (_this$_renderTargets$ = (_this$_renderTargets = this._renderTargets) === null || _this$_renderTargets === void 0 ? void 0 : _this$_renderTargets.length) !== null && _this$_renderTargets$ !== void 0 ? _this$_renderTargets$ : 0,\n generateDepthBuffer: false,\n label: this.name,\n samples: (_textureDescription$o = textureDescription.options.samples) !== null && _textureDescription$o !== void 0 ? _textureDescription$o : 1,\n dontCreateTextures: true\n };\n this._renderTargetWrapper = engine.createMultipleRenderTarget(textureDescription.size, creationOptionsForTexture, true);\n for (let i = 0; i < creationOptionsForTexture.textureCount; i++) {\n const handle = this._renderTargets[i];\n const texture = this._textureManager.getTextureFromHandle(handle);\n if (!texture) {\n throw new Error(`FrameGraphRenderTarget.renderTargetWrapper: Failed to get texture from handle. handle: ${handle}, name: ${this.name}, index: ${i}, renderTargets: ${this._renderTargets}`);\n }\n this._renderTargetWrapper.setTexture(texture, i, false);\n }\n if (this._renderTargetDepth !== undefined) {\n this._renderTargetWrapper.setDepthStencilTexture(this._textureManager.getTextureFromHandle(this._renderTargetDepth), false);\n }\n }\n return this._renderTargetWrapper;\n }\n equals(other) {\n const src = this._renderTargets;\n const dst = other._renderTargets;\n if (src !== undefined && dst !== undefined) {\n if (src.length !== dst.length) {\n return false;\n }\n for (let i = 0; i < src.length; i++) {\n if (src[i] !== dst[i]) {\n return false;\n }\n }\n } else if (src === undefined && dst !== undefined || src !== undefined && dst === undefined) {\n return false;\n }\n return this._renderTargetDepth === other._renderTargetDepth;\n }\n}","map":{"version":3,"names":["FrameGraphRenderTarget","constructor","name","textureManager","renderTargets","renderTargetDepth","_isBackBuffer","_textureManager","_renderTargets","undefined","Array","isArray","_renderTargetDepth","renderTargetWrapper","_renderTargetWrapper","_this$_renderTargets$","_this$_renderTargets","_textureDescription$o","engine","textureHandle","isBackbuffer","textureDescription","getTextureDescription","creationOptionsForTexture","textureCount","length","generateDepthBuffer","label","samples","options","dontCreateTextures","createMultipleRenderTarget","size","i","handle","texture","getTextureFromHandle","Error","setTexture","setDepthStencilTexture","equals","other","src","dst"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/frameGraphRenderTarget.js"],"sourcesContent":["/**\n * @internal\n * @experimental\n */\nexport class FrameGraphRenderTarget {\n constructor(name, textureManager, renderTargets, renderTargetDepth) {\n this._isBackBuffer = false;\n this.name = name;\n this._textureManager = textureManager;\n this._renderTargets = renderTargets === undefined ? undefined : Array.isArray(renderTargets) ? renderTargets : [renderTargets];\n this._renderTargetDepth = renderTargetDepth;\n }\n get renderTargetWrapper() {\n if (this._isBackBuffer) {\n return undefined;\n }\n if (!this._renderTargetWrapper) {\n const engine = this._textureManager.engine;\n // _renderTargets and _renderTargetDepth cannot both be undefined\n const textureHandle = this._renderTargets === undefined ? this._renderTargetDepth : this._renderTargets[0];\n if (this._textureManager.isBackbuffer(textureHandle)) {\n this._isBackBuffer = true;\n return undefined;\n }\n const textureDescription = this._textureManager.getTextureDescription(textureHandle);\n const creationOptionsForTexture = {\n textureCount: this._renderTargets?.length ?? 0,\n generateDepthBuffer: false,\n label: this.name,\n samples: textureDescription.options.samples ?? 1,\n dontCreateTextures: true,\n };\n this._renderTargetWrapper = engine.createMultipleRenderTarget(textureDescription.size, creationOptionsForTexture, true);\n for (let i = 0; i < creationOptionsForTexture.textureCount; i++) {\n const handle = this._renderTargets[i];\n const texture = this._textureManager.getTextureFromHandle(handle);\n if (!texture) {\n throw new Error(`FrameGraphRenderTarget.renderTargetWrapper: Failed to get texture from handle. handle: ${handle}, name: ${this.name}, index: ${i}, renderTargets: ${this._renderTargets}`);\n }\n this._renderTargetWrapper.setTexture(texture, i, false);\n }\n if (this._renderTargetDepth !== undefined) {\n this._renderTargetWrapper.setDepthStencilTexture(this._textureManager.getTextureFromHandle(this._renderTargetDepth), false);\n }\n }\n return this._renderTargetWrapper;\n }\n equals(other) {\n const src = this._renderTargets;\n const dst = other._renderTargets;\n if (src !== undefined && dst !== undefined) {\n if (src.length !== dst.length) {\n return false;\n }\n for (let i = 0; i < src.length; i++) {\n if (src[i] !== dst[i]) {\n return false;\n }\n }\n }\n else if ((src === undefined && dst !== undefined) || (src !== undefined && dst === undefined)) {\n return false;\n }\n return this._renderTargetDepth === other._renderTargetDepth;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,sBAAsB,CAAC;EAChCC,WAAWA,CAACC,IAAI,EAAEC,cAAc,EAAEC,aAAa,EAAEC,iBAAiB,EAAE;IAChE,IAAI,CAACC,aAAa,GAAG,KAAK;IAC1B,IAAI,CAACJ,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACK,eAAe,GAAGJ,cAAc;IACrC,IAAI,CAACK,cAAc,GAAGJ,aAAa,KAAKK,SAAS,GAAGA,SAAS,GAAGC,KAAK,CAACC,OAAO,CAACP,aAAa,CAAC,GAAGA,aAAa,GAAG,CAACA,aAAa,CAAC;IAC9H,IAAI,CAACQ,kBAAkB,GAAGP,iBAAiB;EAC/C;EACA,IAAIQ,mBAAmBA,CAAA,EAAG;IACtB,IAAI,IAAI,CAACP,aAAa,EAAE;MACpB,OA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