05f65ddebaa25f145e1489e32e1754b60a751ccf879c5ffcca644b494279be6e.json 4.8 KB

1
  1. {"ast":null,"code":"import { FrameGraphTask } from \"../../frameGraphTask.js\";\n/**\n * Task which generates mipmaps for a texture.\n */\nexport class FrameGraphGenerateMipMapsTask extends FrameGraphTask {\n /**\n * Constructs a new FrameGraphGenerateMipMapsTask.\n * @param name The name of the task.\n * @param frameGraph The frame graph the task belongs to.\n */\n constructor(name, frameGraph) {\n super(name, frameGraph);\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\n }\n record() {\n if (this.destinationTexture === undefined) {\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);\n }\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);\n if (!outputTextureDescription.options.createMipMaps) {\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);\n }\n const pass = this._frameGraph.addRenderPass(this.name);\n pass.setRenderTarget(this.outputTexture);\n pass.setExecuteFunc(context => {\n context.generateMipMaps();\n });\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\n passDisabled.setRenderTarget(this.outputTexture);\n passDisabled.setExecuteFunc(_context => {});\n }\n}","map":{"version":3,"names":["FrameGraphTask","FrameGraphGenerateMipMapsTask","constructor","name","frameGraph","outputTexture","_frameGraph","textureManager","createDanglingHandle","record","destinationTexture","undefined","Error","resolveDanglingHandle","outputTextureDescription","getTextureDescription","options","createMipMaps","pass","addRenderPass","setRenderTarget","setExecuteFunc","context","generateMipMaps","passDisabled","_context"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Tasks/Texture/generateMipMapsTask.js"],"sourcesContent":["import { FrameGraphTask } from \"../../frameGraphTask.js\";\n/**\n * Task which generates mipmaps for a texture.\n */\nexport class FrameGraphGenerateMipMapsTask extends FrameGraphTask {\n /**\n * Constructs a new FrameGraphGenerateMipMapsTask.\n * @param name The name of the task.\n * @param frameGraph The frame graph the task belongs to.\n */\n constructor(name, frameGraph) {\n super(name, frameGraph);\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\n }\n record() {\n if (this.destinationTexture === undefined) {\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);\n }\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);\n if (!outputTextureDescription.options.createMipMaps) {\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);\n }\n const pass = this._frameGraph.addRenderPass(this.name);\n pass.setRenderTarget(this.outputTexture);\n pass.setExecuteFunc((context) => {\n context.generateMipMaps();\n });\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\n passDisabled.setRenderTarget(this.outputTexture);\n passDisabled.setExecuteFunc((_context) => { });\n }\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,yBAAyB;AACxD;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,SAASD,cAAc,CAAC;EAC9D;AACJ;AACA;AACA;AACA;EACIE,WAAWA,CAACC,IAAI,EAAEC,UAAU,EAAE;IAC1B,KAAK,CAACD,IAAI,EAAEC,UAAU,CAAC;IACvB,IAAI,CAACC,aAAa,GAAG,IAAI,CAACC,WAAW,CAACC,cAAc,CAACC,oBAAoB,CAAC,CAAC;EAC/E;EACAC,MAAMA,CAAA,EAAG;IACL,IAAI,IAAI,CAACC,kBAAkB,KAAKC,SAAS,EAAE;MACvC,MAAM,IAAIC,KAAK,CAAC,iCAAiC,IAAI,CAACT,IAAI,kCAAkC,CAAC;IACjG;IACA,IAAI,CAACG,WAAW,CAACC,cAAc,CAACM,qBAAqB,CAAC,IAAI,CAACR,aAAa,EAAE,IAAI,CAACK,kBAAkB,CAAC;IAClG,MAAMI,wB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