@onerjs/core 8.36.7 → 8.36.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/Audio/analyser.js.map +1 -1
  2. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  3. package/Behaviors/Cameras/geospatialClippingBehavior.d.ts +3 -4
  4. package/Behaviors/Cameras/geospatialClippingBehavior.js +9 -14
  5. package/Behaviors/Cameras/geospatialClippingBehavior.js.map +1 -1
  6. package/Buffers/buffer.align.js +3 -3
  7. package/Buffers/buffer.align.js.map +1 -1
  8. package/Buffers/bufferUtils.d.ts +7 -0
  9. package/Buffers/bufferUtils.js +31 -13
  10. package/Buffers/bufferUtils.js.map +1 -1
  11. package/Cameras/Inputs/geospatialCameraPointersInput.js +2 -2
  12. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  13. package/Cameras/Limits/geospatialLimits.d.ts +16 -0
  14. package/Cameras/Limits/geospatialLimits.js +38 -1
  15. package/Cameras/Limits/geospatialLimits.js.map +1 -1
  16. package/Cameras/geospatialCamera.d.ts +10 -9
  17. package/Cameras/geospatialCamera.js +5 -8
  18. package/Cameras/geospatialCamera.js.map +1 -1
  19. package/Cameras/geospatialCameraMovement.d.ts +1 -3
  20. package/Cameras/geospatialCameraMovement.js +9 -4
  21. package/Cameras/geospatialCameraMovement.js.map +1 -1
  22. package/Engines/Extensions/engine.dynamicBuffer.js +3 -3
  23. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  24. package/Engines/Native/nativeDataStream.d.ts +1 -1
  25. package/Engines/Native/nativeDataStream.js.map +1 -1
  26. package/Engines/Native/nativeInterfaces.d.ts +4 -4
  27. package/Engines/Native/nativeInterfaces.js.map +1 -1
  28. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +13 -1
  29. package/Engines/WebGPU/Extensions/engine.rawTexture.js +26 -8
  30. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  31. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -1
  32. package/Engines/WebGPU/webgpuTextureManager.js +19 -6
  33. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  34. package/Engines/abstractEngine.d.ts +4 -2
  35. package/Engines/abstractEngine.functions.d.ts +1 -1
  36. package/Engines/abstractEngine.functions.js +8 -8
  37. package/Engines/abstractEngine.functions.js.map +1 -1
  38. package/Engines/abstractEngine.js +6 -4
  39. package/Engines/abstractEngine.js.map +1 -1
  40. package/Engines/engine.d.ts +12 -0
  41. package/Engines/thinNativeEngine.js +1 -1
  42. package/Engines/thinNativeEngine.js.map +1 -1
  43. package/Engines/thinWebGPUEngine.js +3 -0
  44. package/Engines/thinWebGPUEngine.js.map +1 -1
  45. package/Engines/webgpuEngine.js +18 -18
  46. package/Engines/webgpuEngine.js.map +1 -1
  47. package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
  48. package/Materials/Background/backgroundMaterial.d.ts +16 -8
  49. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +14 -1
  50. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  51. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
  52. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  53. package/Materials/Node/Blocks/Input/inputBlock.js +14 -0
  54. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  55. package/Materials/Node/Blocks/debugBlock.d.ts +2 -0
  56. package/Materials/Node/Blocks/debugBlock.js +6 -2
  57. package/Materials/Node/Blocks/debugBlock.js.map +1 -1
  58. package/Materials/Node/Enums/nodeMaterialSystemValues.d.ts +3 -1
  59. package/Materials/Node/Enums/nodeMaterialSystemValues.js +2 -0
  60. package/Materials/Node/Enums/nodeMaterialSystemValues.js.map +1 -1
  61. package/Materials/Node/nodeMaterial.d.ts +16 -8
  62. package/Materials/Node/nodeMaterialBlock.js +2 -2
  63. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  64. package/Materials/PBR/openpbrMaterial.d.ts +16 -8
  65. package/Materials/PBR/pbrBaseMaterial.d.ts +16 -8
  66. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.d.ts +1 -1
  67. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js.map +1 -1
  68. package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
  69. package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
  70. package/Materials/Textures/internalTexture.d.ts +6 -0
  71. package/Materials/Textures/internalTexture.js +24 -2
  72. package/Materials/Textures/internalTexture.js.map +1 -1
  73. package/Materials/Textures/rawTexture.d.ts +8 -1
  74. package/Materials/Textures/rawTexture.js +12 -3
  75. package/Materials/Textures/rawTexture.js.map +1 -1
  76. package/Materials/Textures/rawTexture2DArray.d.ts +8 -1
  77. package/Materials/Textures/rawTexture2DArray.js +14 -3
  78. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  79. package/Materials/imageProcessing.d.ts +47 -8
  80. package/Materials/standardMaterial.d.ts +16 -8
  81. package/Meshes/Builders/shapeBuilder.d.ts +4 -0
  82. package/Meshes/Builders/shapeBuilder.js +12 -9
  83. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  84. package/Meshes/Builders/tubeBuilder.d.ts +2 -0
  85. package/Meshes/Builders/tubeBuilder.js +19 -2
  86. package/Meshes/Builders/tubeBuilder.js.map +1 -1
  87. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +68 -4
  88. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +349 -30
  89. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  90. package/Meshes/geometry.js +15 -2
  91. package/Meshes/geometry.js.map +1 -1
  92. package/Meshes/mesh.js +23 -21
  93. package/Meshes/mesh.js.map +1 -1
  94. package/Misc/dds.js.map +1 -1
  95. package/Misc/environmentTextureTools.js +3 -1
  96. package/Misc/environmentTextureTools.js.map +1 -1
  97. package/Misc/fileTools.js +9 -1
  98. package/Misc/fileTools.js.map +1 -1
  99. package/Particles/Node/nodeParticleSystemSet.helper.js +2 -2
  100. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  101. package/Physics/v1/physicsImpostor.d.ts +2 -2
  102. package/Physics/v1/physicsImpostor.js.map +1 -1
  103. package/Shaders/ShadersInclude/gaussianSplatting.js +16 -3
  104. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  105. package/Shaders/gaussianSplatting.vertex.js +17 -4
  106. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  107. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +11 -1
  108. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  109. package/ShadersWGSL/gaussianSplatting.vertex.js +17 -4
  110. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  111. package/XR/native/nativeXRFrame.d.ts +1 -1
  112. package/XR/native/nativeXRFrame.js.map +1 -1
  113. package/package.json +1 -1
  114. package/types.d.ts +1 -1
  115. package/types.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"engine.rawTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AAGrG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,kCAAsC;AAqMjE,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAC1C,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,MAAc,EACd,eAAwB,EACxB,OAAgB,EAChB,YAAoB,EACpB,cAAgC,IAAI,EACpC,OAAe,SAAS,CAAC,yBAAyB,EAClD,gBAAwB,CAAC,EACzB,gBAAyB,KAAK;IAE9B,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AI,UAAU,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,sBAAsB;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAErC,8BAA8B;YAC9B,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAE5C,kCAAkC;YAClC,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAClC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IWebRequest } from \"../../../Misc/interfaces/iWebRequest\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\r\n\r\ndeclare module \"../../abstractEngine\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface AbstractEngine {\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n type: number,\r\n useSRGBBuffer: boolean\r\n ): void;\r\n\r\n /**\r\n * Creates a new raw cube texture\r\n * @param data defines the array of data to use to create each face\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compression used (null by default)\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTexture(\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param level defines which level of the texture to update\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n samplingMode: number,\r\n invertY: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number\r\n ): void;\r\n }\r\n}\r\n\r\nThinWebGPUEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._creationFlags = creationFlags;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n useSRGBBuffer: boolean = false\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n texture.isCube = true;\r\n texture._originalFormat = format;\r\n texture.format = format === Constants.TEXTUREFORMAT_RGB ? Constants.TEXTUREFORMAT_RGBA : format;\r\n texture.type = type;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.samplingMode = samplingMode;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n\r\n if (format === Constants.TEXTUREFORMAT_RGB) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n gpuTextureWrapper._originalFormatIsRGB = true;\r\n }\r\n\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n bufferView: ArrayBufferView[],\r\n _format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null\r\n): void {\r\n texture._bufferViewArray = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = gpuTextureWrapper._originalFormatIsRGB;\r\n\r\n const faces = [0, 2, 4, 1, 3, 5];\r\n\r\n const data = [];\r\n for (let i = 0; i < bufferView.length; ++i) {\r\n let faceData = bufferView[faces[i]];\r\n if (needConversion) {\r\n faceData = ConvertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);\r\n }\r\n data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));\r\n }\r\n\r\n this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource!, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?.addPendingData(texture);\r\n texture.url = url;\r\n texture.isReady = false;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?.removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallbackAsync = async (data: any) => {\r\n const faceDataArraysResult = callback(data);\r\n if (!faceDataArraysResult) {\r\n return;\r\n }\r\n\r\n const faceDataArrays: any = faceDataArraysResult instanceof Promise ? await faceDataArraysResult : faceDataArraysResult;\r\n const width = texture.width;\r\n\r\n if (mipmapGenerator) {\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const faces = [0, 1, 2, 3, 4, 5];\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faces[faceIndex]];\r\n if (needConversion) {\r\n mipFaceData = ConvertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));\r\n }\r\n this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource!, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n }\r\n } else {\r\n this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n scene?.removePendingData(texture);\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n // eslint-disable-next-line github/no-then\r\n internalCallbackAsync(data).catch((err) => {\r\n onerror(undefined, err);\r\n });\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawTexture3D = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw3D;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is3D = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture3D = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawTexture2DArray = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is2DArray = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);\r\n\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture2DArray = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nfunction ConvertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n"]}
1
+ {"version":3,"file":"engine.rawTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AAGrG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,kCAAsC;AA2NjE,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAC1C,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,MAAc,EACd,eAAwB,EACxB,OAAgB,EAChB,YAAoB,EACpB,cAAgC,IAAI,EACpC,OAAe,SAAS,CAAC,yBAAyB,EAClD,gBAAwB,CAAC,EACzB,gBAAyB,KAAK,EAC9B,aAAsB;IAEtB,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,oCAA4B,CAAC;IACrE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IAC1C,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;IACpC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,YAAY,GAAG,WAAW,CAAC;IACnC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC;IACvC,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC;IAEvC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAChC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,I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C,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAE5C,kCAAkC;YAClC,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QAClC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IWebRequest } from \"../../../Misc/interfaces/iWebRequest\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\r\n\r\ndeclare module \"../../abstractEngine\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface AbstractEngine {\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @param mipLevel defines which mipLevel of the texture is going to be updated\r\n */\r\n updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n type: number,\r\n useSRGBBuffer: boolean,\r\n mipLevel?: number\r\n ): void;\r\n\r\n /**\r\n * Creates a new raw cube texture\r\n * @param data defines the array of data to use to create each face\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compression used (null by default)\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTexture(\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param level defines which level of the texture to update\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n samplingMode: number,\r\n invertY: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number\r\n ): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\r\n * @param mipLevel defines which mipLevel of the texture is going to be updated\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n mipLevel?: number\r\n ): void;\r\n }\r\n}\r\n\r\nThinWebGPUEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false,\r\n mipLevelCount?: number\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._creationFlags = creationFlags;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.updateMipLevelCountForInternalTexture(texture, mipLevelCount);\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n useSRGBBuffer: boolean = false,\r\n mipLevel?: number\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n if (mipLevel !== undefined && bufferView) {\r\n if (!texture._bufferViewArray) {\r\n texture._bufferViewArray = new Array(texture.mipLevelCount);\r\n }\r\n texture._bufferViewArray[mipLevel] = bufferView;\r\n }\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n const mipWidth = Math.max(1, texture.width >> (mipLevel ?? 0));\r\n const mipHeight = Math.max(1, texture.height >> (mipLevel ?? 0));\r\n this._textureHelper.updateTexture(data, texture, mipWidth, mipHeight, texture.depth, gpuTextureWrapper.format, 0, mipLevel ?? 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps && !mipLevel) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n texture.isCube = true;\r\n texture._originalFormat = format;\r\n texture.format = format === Constants.TEXTUREFORMAT_RGB ? Constants.TEXTUREFORMAT_RGBA : format;\r\n texture.type = type;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.samplingMode = samplingMode;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n\r\n if (format === Constants.TEXTUREFORMAT_RGB) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n gpuTextureWrapper._originalFormatIsRGB = true;\r\n }\r\n\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n bufferView: ArrayBufferView[],\r\n _format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null\r\n): void {\r\n texture._bufferViewArray = bufferView;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = gpuTextureWrapper._originalFormatIsRGB;\r\n\r\n const faces = [0, 2, 4, 1, 3, 5];\r\n\r\n const data = [];\r\n for (let i = 0; i < bufferView.length; ++i) {\r\n let faceData = bufferView[faces[i]];\r\n if (needConversion) {\r\n faceData = ConvertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);\r\n }\r\n data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));\r\n }\r\n\r\n this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource!, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[] | Promise<ArrayBufferView[]>>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?.addPendingData(texture);\r\n texture.url = url;\r\n texture.isReady = false;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?.removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallbackAsync = async (data: any) => {\r\n const faceDataArraysResult = callback(data);\r\n if (!faceDataArraysResult) {\r\n return;\r\n }\r\n\r\n const faceDataArrays: any = faceDataArraysResult instanceof Promise ? await faceDataArraysResult : faceDataArraysResult;\r\n const width = texture.width;\r\n\r\n if (mipmapGenerator) {\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const faces = [0, 1, 2, 3, 4, 5];\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n const allFaces = [];\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faces[faceIndex]];\r\n if (needConversion) {\r\n mipFaceData = ConvertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));\r\n }\r\n this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource!, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);\r\n }\r\n } else {\r\n this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n scene?.removePendingData(texture);\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n // eslint-disable-next-line github/no-then\r\n internalCallbackAsync(data).catch((err) => {\r\n onerror(undefined, err);\r\n });\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawTexture3D = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw3D;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is3D = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\r\n\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture3D = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\nThinWebGPUEngine.prototype.createRawTexture2DArray = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n creationFlags: number = 0,\r\n mipLevelCount?: number\r\n): InternalTexture {\r\n const source = InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.is2DArray = true;\r\n texture._creationFlags = creationFlags;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this._textureHelper.updateMipLevelCountForInternalTexture(texture, mipLevelCount);\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);\r\n\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinWebGPUEngine.prototype.updateRawTexture2DArray = function (\r\n texture: InternalTexture,\r\n bufferView: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n mipLevel?: number\r\n): void {\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = bufferView;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n if (mipLevel !== undefined && bufferView) {\r\n if (!texture._bufferViewArray) {\r\n texture._bufferViewArray = new Array(texture.mipLevelCount);\r\n }\r\n texture._bufferViewArray[mipLevel] = bufferView;\r\n }\r\n }\r\n\r\n if (bufferView) {\r\n const gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\r\n\r\n if (needConversion) {\r\n bufferView = ConvertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\r\n }\r\n\r\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\r\n\r\n const mipWidth = Math.max(1, texture.width >> (mipLevel ?? 0));\r\n const mipHeight = Math.max(1, texture.height >> (mipLevel ?? 0));\r\n this._textureHelper.updateTexture(data, texture, mipWidth, mipHeight, texture.depth, gpuTextureWrapper.format, 0, mipLevel ?? 0, invertY, false, 0, 0);\r\n if (texture.generateMipMaps && !mipLevel) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n }\r\n\r\n texture.isReady = true;\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nfunction ConvertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n"]}
@@ -35,7 +35,7 @@ export declare class WebGPUTextureManager {
35
35
  width: number;
36
36
  height: number;
37
37
  layers: number;
38
- }, hasMipmaps?: boolean, generateMipmaps?: boolean, invertY?: boolean, premultiplyAlpha?: boolean, is3D?: boolean, format?: GPUTextureFormat, sampleCount?: number, commandEncoder?: GPUCommandEncoder, usage?: number, additionalUsages?: number, label?: string): GPUTexture;
38
+ }, hasMipmaps?: boolean, generateMipmaps?: boolean, invertY?: boolean, premultiplyAlpha?: boolean, is3D?: boolean, format?: GPUTextureFormat, sampleCount?: number, commandEncoder?: GPUCommandEncoder, usage?: number, additionalUsages?: number, label?: string, mipLevelCount?: number): GPUTexture;
39
39
  createCubeTexture(imageBitmaps: ImageBitmap[] | {
40
40
  width: number;
41
41
  height: number;
@@ -48,6 +48,7 @@ export declare class WebGPUTextureManager {
48
48
  resolveMSAADepthTexture(msaaTexture: GPUTexture, outputTexture: GPUTexture, commandEncoder?: GPUCommandEncoder): void;
49
49
  updateCubeTextures(imageBitmaps: ImageBitmap[] | Uint8Array[], gpuTexture: GPUTexture, width: number, height: number, format: GPUTextureFormat, invertY?: boolean, premultiplyAlpha?: boolean, offsetX?: number, offsetY?: number): void;
50
50
  updateTexture(imageBitmap: ImageBitmap | Uint8Array | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas, texture: GPUTexture | InternalTexture, width: number, height: number, layers: number, format: GPUTextureFormat, faceIndex?: number, mipLevel?: number, invertY?: boolean, premultiplyAlpha?: boolean, offsetX?: number, offsetY?: number, allowGPUOptimization?: boolean): void;
51
+ updateMipLevelCountForInternalTexture(texture: InternalTexture, mipLevelCount?: number): void;
51
52
  readPixels(texture: GPUTexture, x: number, y: number, width: number, height: number, format: GPUTextureFormat, faceIndex?: number, mipLevel?: number, buffer?: Nullable<ArrayBufferView>, noDataConversion?: boolean): Promise<ArrayBufferView>;
52
53
  releaseTexture(texture: InternalTexture | GPUTexture): void;
53
54
  destroyDeferredTextures(): void;
@@ -207,7 +207,7 @@ const resolveDepthFragmentSource = `
207
207
  for (var i = 0u; i < numSamples; i = i + 1u) {
208
208
  depth = min(depth, textureLoad(msaaDepthTexture, vec2u(input.position.xy), i));
209
209
  }
210
-
210
+
211
211
  fragmentOutputs.color = vec4f(depth);
212
212
  #else
213
213
  fragmentOutputs.color = vec4f(textureLoad(msaaDepthTexture, vec2u(input.position.xy), 0)); // do like WebGL, take the first sample
@@ -625,7 +625,7 @@ export class WebGPUTextureManager {
625
625
  //------------------------------------------------------------------------------
626
626
  // Creation
627
627
  //------------------------------------------------------------------------------
628
- createTexture(imageBitmap, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, is3D = false, format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
628
+ createTexture(imageBitmap, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, is3D = false, format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label, mipLevelCount) {
629
629
  sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
630
630
  const layerCount = imageBitmap.layers || 1;
631
631
  const textureSize = {
@@ -635,7 +635,8 @@ export class WebGPUTextureManager {
635
635
  };
636
636
  const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;
637
637
  const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);
638
- const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1;
638
+ const maxNumMipLevels = WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height);
639
+ const effectiveMipLevelCount = hasMipmaps ? Math.min(mipLevelCount ?? maxNumMipLevels, maxNumMipLevels) : 1;
639
640
  const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;
640
641
  additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;
641
642
  if (!isCompressedFormat && !is3D) {
@@ -649,12 +650,12 @@ export class WebGPUTextureManager {
649
650
  format,
650
651
  usage: usages | additionalUsages,
651
652
  sampleCount,
652
- mipLevelCount,
653
+ mipLevelCount: effectiveMipLevelCount,
653
654
  });
654
655
  if (WebGPUTextureHelper.IsImageBitmap(imageBitmap)) {
655
656
  this.updateTexture(imageBitmap, gpuTexture, imageBitmap.width, imageBitmap.height, layerCount, format, 0, 0, invertY, premultiplyAlpha, 0, 0);
656
657
  if (hasMipmaps && generateMipmaps) {
657
- this.generateMipmaps(gpuTexture, mipLevelCount, 0, commandEncoder);
658
+ this.generateMipmaps(gpuTexture, effectiveMipLevelCount, 0, commandEncoder);
658
659
  }
659
660
  }
660
661
  return gpuTexture;
@@ -860,7 +861,7 @@ export class WebGPUTextureManager {
860
861
  }, isStorageTexture);
861
862
  }
862
863
  else {
863
- const gpuTexture = this.createTexture({ width, height, layers: layerCount }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, texture.is3D, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);
864
+ const gpuTexture = this.createTexture({ width, height, layers: layerCount }, hasMipMaps, texture.generateMipMaps, texture.invertY, false, texture.is3D, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);
864
865
  gpuTextureWrapper.set(gpuTexture);
865
866
  const arrayLayerCount = texture.is3D ? 1 : layerCount;
866
867
  const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);
@@ -1006,6 +1007,18 @@ export class WebGPUTextureManager {
1006
1007
  this._device.queue.copyExternalImageToTexture({ source: imageBitmap, flipY: invertY }, textureCopyView, textureExtent);
1007
1008
  }
1008
1009
  }
1010
+ updateMipLevelCountForInternalTexture(texture, mipLevelCount) {
1011
+ const maxNumMipLevels = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);
1012
+ if (mipLevelCount !== undefined) {
1013
+ texture.mipLevelCount = Math.min(Math.max(1, mipLevelCount), maxNumMipLevels);
1014
+ }
1015
+ else if (texture.generateMipMaps) {
1016
+ texture.mipLevelCount = maxNumMipLevels;
1017
+ }
1018
+ else {
1019
+ texture.mipLevelCount = 1;
1020
+ }
1021
+ }
1009
1022
  // eslint-disable-next-line @typescript-eslint/promise-function-async
1010
1023
  readPixels(texture, x, y, width, height, format, faceIndex = 0, mipLevel = 0, buffer = null, noDataConversion = false) {
1011
1024
  const blockInformation = WebGPUTextureHelper.GetBlockInformationFromFormat(format);