{"ast":null,"code":"import { InternalTexture } from \"../../../Materials/Textures/internalTexture.js\";\nimport { WebGPUEngine } from \"../../webgpuEngine.js\";\nimport { GetExponentOfTwo } from \"../../../Misc/tools.functions.js\";\nWebGPUEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {\n const texture = new InternalTexture(this, 4 /* InternalTextureSource.Dynamic */);\n texture.baseWidth = width;\n texture.baseHeight = height;\n if (generateMipMaps) {\n width = this.needPOTTextures ? GetExponentOfTwo(width, this._caps.maxTextureSize) : width;\n height = this.needPOTTextures ? GetExponentOfTwo(height, this._caps.maxTextureSize) : height;\n }\n texture.width = width;\n texture.height = height;\n texture.isReady = false;\n texture.generateMipMaps = generateMipMaps;\n texture.samplingMode = samplingMode;\n this.updateTextureSamplingMode(samplingMode, texture);\n this._internalTexturesCache.push(texture);\n if (width && height) {\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n return texture;\n};\nWebGPUEngine.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = false, format, forceBindTexture, allowGPUOptimization) {\n var _texture$_hardwareTex;\n if (!texture) {\n return;\n }\n const width = source.width,\n height = source.height;\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!((_texture$_hardwareTex = texture._hardwareTexture) !== null && _texture$_hardwareTex !== void 0 && _texture$_hardwareTex.underlyingResource)) {\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n this._textureHelper.updateTexture(source, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture);\n }\n texture._dynamicTextureSource = source;\n texture._premulAlpha = premulAlpha;\n texture.invertY = invertY || false;\n texture.isReady = true;\n};","map":{"version":3,"names":["InternalTexture","WebGPUEngine","GetExponentOfTwo","prototype","createDynamicTexture","width","height","generateMipMaps","samplingMode","texture","baseWidth","baseHeight","needPOTTextures","_caps","maxTextureSize","isReady","updateTextureSamplingMode","_internalTexturesCache","push","_textureHelper","createGPUTextureForInternalTexture","updateDynamicTexture","source","invertY","premulAlpha","format","forceBindTexture","allowGPUOptimization","_texture$_hardwareTex","gpuTextureWrapper","_hardwareTexture","underlyingResource","updateTexture","depth","_generateMipmaps","_dynamicTextureSource","_premulAlpha"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture.js"],"sourcesContent":["import { InternalTexture } from \"../../../Materials/Textures/internalTexture.js\";\nimport { WebGPUEngine } from \"../../webgpuEngine.js\";\nimport { GetExponentOfTwo } from \"../../../Misc/tools.functions.js\";\nWebGPUEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {\n const texture = new InternalTexture(this, 4 /* InternalTextureSource.Dynamic */);\n texture.baseWidth = width;\n texture.baseHeight = height;\n if (generateMipMaps) {\n width = this.needPOTTextures ? GetExponentOfTwo(width, this._caps.maxTextureSize) : width;\n height = this.needPOTTextures ? GetExponentOfTwo(height, this._caps.maxTextureSize) : height;\n }\n texture.width = width;\n texture.height = height;\n texture.isReady = false;\n texture.generateMipMaps = generateMipMaps;\n texture.samplingMode = samplingMode;\n this.updateTextureSamplingMode(samplingMode, texture);\n this._internalTexturesCache.push(texture);\n if (width && height) {\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n return texture;\n};\nWebGPUEngine.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = false, format, forceBindTexture, allowGPUOptimization) {\n if (!texture) {\n return;\n }\n const width = source.width, height = source.height;\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!texture._hardwareTexture?.underlyingResource) {\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n this._textureHelper.updateTexture(source, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture);\n }\n texture._dynamicTextureSource = source;\n texture._premulAlpha = premulAlpha;\n texture.invertY = invertY || false;\n texture.isReady = true;\n};\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,gDAAgD;AAChF,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,gBAAgB,QAAQ,kCAAkC;AACnED,YAAY,CAACE,SAAS,CAACC,oBAAoB,GAAG,UAAUC,KAAK,EAAEC,MAAM,EAAEC,eAAe,EAAEC,YAAY,EAAE;EAClG,MAAMC,OAAO,GAAG,IAAIT,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,mCAAmC,CAAC;EAChFS,OAAO,CAACC,SAAS,GAAGL,KAAK;EACzBI,OAAO,CAACE,UAAU,GAAGL,MAAM;EAC3B,IAAIC,eAAe,EAAE;IACjBF,KAAK,GAAG,IAAI,CAACO,eAAe,GAAGV,gBAAgB,CAACG,KAAK,EAAE,IAAI,CAACQ,KAAK,CAACC,cAAc,CAAC,GAAGT,KAAK;IACzFC,MAAM,GAAG,IAAI,CAACM,eAAe,GAAGV,gBAAgB,CAACI,MAAM,EAAE,IAAI,CAACO,KAAK,CAACC,cAAc,CAAC,GAAGR,MAAM;EAChG;EACAG,OAAO,CAACJ,KAAK,GAAGA,KAAK;EACrBI,OAAO,CAACH,MAAM,GAAGA,MAAM;EACvBG,OAAO,CAACM,OAAO,GAAG,KAAK;EACvBN,OAAO,CAACF,eAAe,GAAGA,eAAe;EACzCE,OAAO,CAACD,YAAY,GAAGA,YAAY;EACnC,IAAI,CAACQ,yBAAyB,CAACR,YAAY,EAAEC,OAAO,CAAC;EACrD,IAAI,CAACQ,sBAAsB,CAACC,IAAI,CAACT,OAAO,CAAC;EACzC,IAAIJ,KAAK,IAAIC,MAAM,EAAE;IACjB,IAAI,CAACa,cAAc,CAACC,kCAAkC,CAACX,OAAO,EAAEJ,KAAK,EAAEC,MAAM,CAAC;EAClF;EACA,OAAOG,OAAO;AAClB,CAAC;AACDR,YAAY,CAACE,SAAS,CAACkB,oBAA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