@babylonjs/core 7.12.0 → 7.13.0

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 (510) hide show
  1. package/Animations/animation.js +1 -2
  2. package/Animations/animation.js.map +1 -1
  3. package/Animations/animationGroupMask.d.ts +1 -1
  4. package/Animations/animationGroupMask.js +2 -2
  5. package/Animations/animationGroupMask.js.map +1 -1
  6. package/Animations/animationKey.d.ts +1 -1
  7. package/Animations/animationKey.js.map +1 -1
  8. package/Behaviors/Meshes/handConstraintBehavior.d.ts +3 -3
  9. package/Behaviors/Meshes/handConstraintBehavior.js +16 -17
  10. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  11. package/Behaviors/Meshes/sixDofDragBehavior.js +2 -3
  12. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  13. package/Bones/bone.js +31 -32
  14. package/Bones/bone.js.map +1 -1
  15. package/Bones/boneIKController.js +5 -6
  16. package/Bones/boneIKController.js.map +1 -1
  17. package/Bones/boneLookController.js +13 -13
  18. package/Bones/boneLookController.js.map +1 -1
  19. package/Cameras/Inputs/freeCameraMouseWheelInput.js +5 -6
  20. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  21. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +5 -5
  22. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
  23. package/Cameras/VR/vrExperienceHelper.js +8 -10
  24. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  25. package/Compute/computeEffect.js +2 -3
  26. package/Compute/computeEffect.js.map +1 -1
  27. package/Compute/computeShader.js +19 -20
  28. package/Compute/computeShader.js.map +1 -1
  29. package/Culling/Helper/IBoundingInfoHelperPlatform.d.ts +4 -0
  30. package/Culling/Helper/IBoundingInfoHelperPlatform.js.map +1 -1
  31. package/Culling/Helper/boundingInfoHelper.d.ts +26 -4
  32. package/Culling/Helper/boundingInfoHelper.js +41 -10
  33. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  34. package/Culling/Helper/computeShaderBoundingHelper.d.ts +12 -3
  35. package/Culling/Helper/computeShaderBoundingHelper.js +164 -76
  36. package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
  37. package/Culling/Helper/transformFeedbackBoundingHelper.d.ts +11 -0
  38. package/Culling/Helper/transformFeedbackBoundingHelper.js +46 -14
  39. package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
  40. package/Debug/debugLayer.d.ts +1 -1
  41. package/Debug/debugLayer.js.map +1 -1
  42. package/Decorators/nodeDecorator.d.ts +1 -1
  43. package/Decorators/nodeDecorator.js +1 -1
  44. package/Decorators/nodeDecorator.js.map +1 -1
  45. package/DeviceInput/InputDevices/deviceEnums.d.ts +5 -5
  46. package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
  47. package/DeviceInput/eventFactory.js +3 -3
  48. package/DeviceInput/eventFactory.js.map +1 -1
  49. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -2
  50. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
  51. package/Engines/Extensions/engine.computeShader.d.ts +1 -1
  52. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  53. package/Engines/Extensions/engine.cubeTexture.js +2 -2
  54. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  55. package/Engines/Extensions/engine.dynamicTexture.js +2 -2
  56. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  57. package/Engines/Extensions/engine.multiRender.js +3 -3
  58. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  59. package/Engines/Extensions/engine.multiview.js +2 -2
  60. package/Engines/Extensions/engine.multiview.js.map +1 -1
  61. package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -3
  62. package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
  63. package/Engines/Extensions/engine.rawTexture.js +4 -4
  64. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  65. package/Engines/Extensions/engine.renderTarget.js +3 -3
  66. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  67. package/Engines/Extensions/engine.renderTargetCube.js +2 -2
  68. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  69. package/Engines/Native/nativeShaderProcessors.js +1 -2
  70. package/Engines/Native/nativeShaderProcessors.js.map +1 -1
  71. package/Engines/Processors/shaderProcessor.js +2 -3
  72. package/Engines/Processors/shaderProcessor.js.map +1 -1
  73. package/Engines/WebGL/webGL2ShaderProcessors.js +1 -2
  74. package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
  75. package/Engines/WebGL/webGLShaderProcessors.js +1 -2
  76. package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
  77. package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -2
  78. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  79. package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
  80. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  81. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -2
  82. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  83. package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -2
  84. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  85. package/Engines/WebGPU/Extensions/engine.rawTexture.js +5 -5
  86. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  87. package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
  88. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  89. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
  90. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  91. package/Engines/WebGPU/webgpuBufferManager.js +1 -1
  92. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  93. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +81 -82
  94. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  95. package/Engines/WebGPU/webgpuCacheSampler.js +60 -64
  96. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  97. package/Engines/WebGPU/webgpuClearQuad.js +1 -2
  98. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  99. package/Engines/WebGPU/webgpuComputeContext.js +13 -15
  100. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  101. package/Engines/WebGPU/webgpuConstants.d.ts +39 -39
  102. package/Engines/WebGPU/webgpuConstants.js.map +1 -1
  103. package/Engines/WebGPU/webgpuHardwareTexture.js +6 -8
  104. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  105. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -2
  106. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  107. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  108. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  109. package/Engines/WebGPU/webgpuShaderProcessor.js +15 -19
  110. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  111. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +8 -10
  112. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  113. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -28
  114. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  115. package/Engines/WebGPU/webgpuTextureHelper.js +413 -416
  116. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  117. package/Engines/WebGPU/webgpuTextureManager.js +50 -51
  118. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  119. package/Engines/WebGPU/webgpuTimestampQuery.js +1 -2
  120. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  121. package/Engines/abstractEngine.js +4 -4
  122. package/Engines/abstractEngine.js.map +1 -1
  123. package/Engines/engine.js +2 -2
  124. package/Engines/engine.js.map +1 -1
  125. package/Engines/nativeEngine.js +9 -9
  126. package/Engines/nativeEngine.js.map +1 -1
  127. package/Engines/nullEngine.js +5 -5
  128. package/Engines/nullEngine.js.map +1 -1
  129. package/Engines/renderTargetWrapper.js +1 -2
  130. package/Engines/renderTargetWrapper.js.map +1 -1
  131. package/Engines/shaderStore.js +6 -7
  132. package/Engines/shaderStore.js.map +1 -1
  133. package/Engines/thinEngine.js +4 -5
  134. package/Engines/thinEngine.js.map +1 -1
  135. package/Engines/webgpuEngine.d.ts +11 -0
  136. package/Engines/webgpuEngine.js +91 -72
  137. package/Engines/webgpuEngine.js.map +1 -1
  138. package/Events/deviceInputEvents.d.ts +1 -1
  139. package/Events/deviceInputEvents.js.map +1 -1
  140. package/FlowGraph/flowGraph.d.ts +1 -1
  141. package/FlowGraph/flowGraph.js +5 -5
  142. package/FlowGraph/flowGraph.js.map +1 -1
  143. package/FlowGraph/flowGraphBlock.js +2 -3
  144. package/FlowGraph/flowGraphBlock.js.map +1 -1
  145. package/FlowGraph/flowGraphConnection.d.ts +1 -1
  146. package/FlowGraph/flowGraphConnection.js.map +1 -1
  147. package/FlowGraph/flowGraphDataConnection.js +3 -3
  148. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  149. package/FlowGraph/flowGraphExecutionBlock.js +2 -3
  150. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  151. package/FlowGraph/flowGraphSignalConnection.js +3 -3
  152. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  153. package/Gamepads/dualShockGamepad.d.ts +2 -2
  154. package/Gamepads/dualShockGamepad.js +14 -14
  155. package/Gamepads/dualShockGamepad.js.map +1 -1
  156. package/Gamepads/xboxGamepad.d.ts +2 -2
  157. package/Gamepads/xboxGamepad.js +14 -14
  158. package/Gamepads/xboxGamepad.js.map +1 -1
  159. package/Gizmos/gizmo.d.ts +2 -2
  160. package/Gizmos/gizmo.js +4 -4
  161. package/Gizmos/gizmo.js.map +1 -1
  162. package/Gizmos/gizmoManager.js +2 -2
  163. package/Gizmos/gizmoManager.js.map +1 -1
  164. package/Gizmos/scaleGizmo.js +3 -3
  165. package/Gizmos/scaleGizmo.js.map +1 -1
  166. package/Loading/sceneLoader.d.ts +1 -1
  167. package/Loading/sceneLoader.js +6 -6
  168. package/Loading/sceneLoader.js.map +1 -1
  169. package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -3
  170. package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
  171. package/Materials/GreasedLine/greasedLinePluginMaterial.js +10 -11
  172. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  173. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +8 -9
  174. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  175. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +3 -4
  176. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  177. package/Materials/Node/Blocks/Dual/fogBlock.js +2 -3
  178. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
  180. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  181. package/Materials/Node/Blocks/Dual/lightBlock.js +5 -6
  182. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  183. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -5
  184. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -8
  186. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  187. package/Materials/Node/Blocks/Dual/textureBlock.js +4 -6
  188. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  189. package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -4
  190. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/Fragment/derivativeBlock.js +1 -2
  192. package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
  193. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -2
  194. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  195. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +1 -2
  196. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +5 -6
  198. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  199. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -2
  200. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  201. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +5 -6
  202. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  203. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -4
  204. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  205. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +7 -9
  206. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  207. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -2
  208. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  209. package/Materials/Node/Blocks/Input/inputBlock.js +19 -21
  210. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  211. package/Materials/Node/Blocks/Input/prePassTextureBlock.js +3 -4
  212. package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
  213. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -3
  214. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  215. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +4 -5
  216. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  217. package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
  218. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  219. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -29
  220. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  221. package/Materials/Node/Blocks/PBR/reflectionBlock.js +4 -5
  222. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  223. package/Materials/Node/Blocks/PBR/refractionBlock.js +5 -6
  224. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  225. package/Materials/Node/Blocks/PBR/sheenBlock.js +4 -5
  226. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  227. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +2 -3
  228. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  229. package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -2
  230. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  231. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -2
  232. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  233. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -2
  234. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  235. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -2
  236. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  237. package/Materials/Node/Blocks/arcTan2Block.js +1 -2
  238. package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
  239. package/Materials/Node/Blocks/biPlanarBlock.js +3 -4
  240. package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
  241. package/Materials/Node/Blocks/clampBlock.js +4 -5
  242. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  243. package/Materials/Node/Blocks/cloudBlock.js +3 -4
  244. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  245. package/Materials/Node/Blocks/curveBlock.js +1 -2
  246. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  247. package/Materials/Node/Blocks/customBlock.js +1 -2
  248. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  249. package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -2
  250. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  251. package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +1 -1
  252. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +35 -35
  253. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  254. package/Materials/Node/Blocks/modBlock.js +1 -2
  255. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  256. package/Materials/Node/Blocks/remapBlock.js +3 -3
  257. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  258. package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -2
  259. package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
  260. package/Materials/Node/Blocks/transformBlock.js +1 -2
  261. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  262. package/Materials/Node/Blocks/triPlanarBlock.js +10 -12
  263. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  264. package/Materials/Node/Blocks/voronoiNoiseBlock.js +3 -4
  265. package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
  266. package/Materials/Node/Blocks/waveBlock.d.ts +1 -1
  267. package/Materials/Node/Blocks/waveBlock.js +4 -4
  268. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  269. package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -4
  270. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  271. package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.d.ts +1 -1
  272. package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js.map +1 -1
  273. package/Materials/Node/nodeMaterial.js +3 -4
  274. package/Materials/Node/nodeMaterial.js.map +1 -1
  275. package/Materials/Node/nodeMaterialBlock.js +5 -6
  276. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  277. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -2
  278. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +10 -10
  279. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  280. package/Materials/Node/nodeMaterialBuildState.js +18 -19
  281. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  282. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -3
  283. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
  284. package/Materials/PBR/pbrBaseMaterial.js +3 -4
  285. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  286. package/Materials/Textures/internalTexture.d.ts +1 -1
  287. package/Materials/Textures/internalTexture.js +13 -13
  288. package/Materials/Textures/internalTexture.js.map +1 -1
  289. package/Materials/Textures/ktx2decoderTypes.d.ts +1 -1
  290. package/Materials/Textures/ktx2decoderTypes.js.map +1 -1
  291. package/Materials/Textures/rawCubeTexture.js +1 -2
  292. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  293. package/Materials/effect.functions.js +2 -3
  294. package/Materials/effect.functions.js.map +1 -1
  295. package/Materials/effect.js +3 -4
  296. package/Materials/effect.js.map +1 -1
  297. package/Materials/effect.webgl.functions.js +1 -2
  298. package/Materials/effect.webgl.functions.js.map +1 -1
  299. package/Materials/material.js +7 -9
  300. package/Materials/material.js.map +1 -1
  301. package/Materials/materialPluginEvent.d.ts +1 -1
  302. package/Materials/materialPluginEvent.js.map +1 -1
  303. package/Materials/materialPluginManager.js +9 -11
  304. package/Materials/materialPluginManager.js.map +1 -1
  305. package/Materials/meshDebugPluginMaterial.d.ts +1 -1
  306. package/Materials/meshDebugPluginMaterial.js +2 -2
  307. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  308. package/Materials/shaderLanguage.d.ts +1 -1
  309. package/Materials/shaderLanguage.js.map +1 -1
  310. package/Materials/shadowDepthWrapper.js +1 -2
  311. package/Materials/shadowDepthWrapper.js.map +1 -1
  312. package/Materials/standardMaterial.js +2 -3
  313. package/Materials/standardMaterial.js.map +1 -1
  314. package/Maths/math.axis.d.ts +2 -2
  315. package/Maths/math.axis.js.map +1 -1
  316. package/Maths/math.path.d.ts +1 -1
  317. package/Maths/math.path.js +3 -3
  318. package/Maths/math.path.js.map +1 -1
  319. package/Meshes/Builders/greasedLineBuilder.d.ts +2 -2
  320. package/Meshes/Builders/greasedLineBuilder.js +21 -23
  321. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  322. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -3
  323. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  324. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +14 -14
  325. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  326. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +2 -2
  327. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  328. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +2 -2
  329. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  330. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +3 -3
  331. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  332. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +3 -3
  333. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  334. package/Meshes/Node/Blocks/Set/setColorsBlock.js +2 -2
  335. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  336. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +2 -2
  337. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  338. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +2 -2
  339. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  340. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +2 -2
  341. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  342. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +2 -2
  343. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  344. package/Meshes/Node/Blocks/Set/setUVsBlock.js +3 -3
  345. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  346. package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -2
  347. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  348. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -2
  349. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  350. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -2
  351. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  352. package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
  353. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  354. package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -2
  355. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  356. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -2
  357. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  358. package/Meshes/Node/Blocks/Sources/meshBlock.js +2 -2
  359. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  360. package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -2
  361. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  362. package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -2
  363. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  364. package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
  365. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  366. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +2 -2
  367. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  368. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +2 -2
  369. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  370. package/Meshes/Node/Blocks/booleanGeometryBlock.js +3 -3
  371. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  372. package/Meshes/Node/Blocks/conditionBlock.js +2 -2
  373. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  374. package/Meshes/Node/Blocks/geometryClampBlock.js +3 -3
  375. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  376. package/Meshes/Node/Blocks/geometryCollectionBlock.js +2 -2
  377. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  378. package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -2
  379. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  380. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
  381. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  382. package/Meshes/Node/Blocks/geometryTransformBlock.js +2 -2
  383. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  384. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -2
  385. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  386. package/Meshes/Node/Blocks/mappingBlock.js +2 -2
  387. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  388. package/Meshes/Node/Blocks/mathBlock.js +2 -2
  389. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  390. package/Meshes/Node/Blocks/mergeGeometryBlock.js +2 -2
  391. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  392. package/Meshes/Node/Blocks/randomBlock.js +2 -2
  393. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  394. package/Meshes/Node/nodeGeometryBlock.js +3 -3
  395. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  396. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -2
  397. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -7
  398. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  399. package/Meshes/abstractMesh.js +2 -3
  400. package/Meshes/abstractMesh.js.map +1 -1
  401. package/Meshes/mesh.js +1 -2
  402. package/Meshes/mesh.js.map +1 -1
  403. package/Meshes/meshSimplification.d.ts +1 -1
  404. package/Meshes/meshSimplification.js +1 -1
  405. package/Meshes/meshSimplification.js.map +1 -1
  406. package/Meshes/meshSimplificationSceneComponent.js +2 -2
  407. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  408. package/Meshes/transformNode.js +7 -8
  409. package/Meshes/transformNode.js.map +1 -1
  410. package/Misc/assetsManager.d.ts +1 -1
  411. package/Misc/assetsManager.js +9 -9
  412. package/Misc/assetsManager.js.map +1 -1
  413. package/Misc/basis.js +2 -2
  414. package/Misc/basis.js.map +1 -1
  415. package/Misc/copyTextureToTexture.d.ts +1 -1
  416. package/Misc/copyTextureToTexture.js +1 -1
  417. package/Misc/copyTextureToTexture.js.map +1 -1
  418. package/Misc/environmentTextureTools.js +3 -3
  419. package/Misc/environmentTextureTools.js.map +1 -1
  420. package/Misc/iInspectable.d.ts +1 -1
  421. package/Misc/iInspectable.js.map +1 -1
  422. package/Misc/khronosTextureContainer2.js +2 -2
  423. package/Misc/khronosTextureContainer2.js.map +1 -1
  424. package/Misc/timer.d.ts +1 -1
  425. package/Misc/timer.js +5 -5
  426. package/Misc/timer.js.map +1 -1
  427. package/Misc/virtualJoystick.d.ts +1 -1
  428. package/Misc/virtualJoystick.js +16 -16
  429. package/Misc/virtualJoystick.js.map +1 -1
  430. package/Particles/particleSystem.js +3 -3
  431. package/Particles/particleSystem.js.map +1 -1
  432. package/Particles/particleSystemComponent.js +1 -2
  433. package/Particles/particleSystemComponent.js.map +1 -1
  434. package/Particles/pointsCloudSystem.d.ts +1 -1
  435. package/Particles/pointsCloudSystem.js +14 -14
  436. package/Particles/pointsCloudSystem.js.map +1 -1
  437. package/Particles/subEmitter.d.ts +1 -1
  438. package/Particles/subEmitter.js +1 -1
  439. package/Particles/subEmitter.js.map +1 -1
  440. package/Physics/physicsHelper.d.ts +2 -2
  441. package/Physics/physicsHelper.js +6 -7
  442. package/Physics/physicsHelper.js.map +1 -1
  443. package/Physics/v1/physicsImpostor.js +4 -5
  444. package/Physics/v1/physicsImpostor.js.map +1 -1
  445. package/Physics/v2/IPhysicsEnginePlugin.d.ts +16 -8
  446. package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
  447. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  448. package/Physics/v2/Plugins/havokPlugin.js +96 -79
  449. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  450. package/Physics/v2/physicsAggregate.js +8 -9
  451. package/Physics/v2/physicsAggregate.js.map +1 -1
  452. package/Physics/v2/physicsBody.d.ts +14 -2
  453. package/Physics/v2/physicsBody.js +30 -11
  454. package/Physics/v2/physicsBody.js.map +1 -1
  455. package/Physics/v2/physicsConstraint.js +8 -9
  456. package/Physics/v2/physicsConstraint.js.map +1 -1
  457. package/Physics/v2/physicsMaterial.d.ts +1 -1
  458. package/Physics/v2/physicsMaterial.js.map +1 -1
  459. package/Physics/v2/physicsShape.js +9 -10
  460. package/Physics/v2/physicsShape.js.map +1 -1
  461. package/Physics/v2/ragdoll.js +11 -12
  462. package/Physics/v2/ragdoll.js.map +1 -1
  463. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -2
  464. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  465. package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
  466. package/PostProcesses/depthOfFieldEffect.js +3 -3
  467. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  468. package/PostProcesses/postProcess.js +2 -3
  469. package/PostProcesses/postProcess.js.map +1 -1
  470. package/PostProcesses/tonemapPostProcess.d.ts +1 -1
  471. package/PostProcesses/tonemapPostProcess.js +4 -4
  472. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  473. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +1 -1
  474. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +10 -10
  475. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  476. package/Shaders/spriteMap.fragment.js +3 -2
  477. package/Shaders/spriteMap.fragment.js.map +1 -1
  478. package/ShadersWGSL/boundingInfo.compute.js +8 -8
  479. package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
  480. package/XR/features/WebXRDepthSensing.js +2 -2
  481. package/XR/features/WebXRDepthSensing.js.map +1 -1
  482. package/XR/features/WebXRHandTracking.d.ts +2 -2
  483. package/XR/features/WebXRHandTracking.js +76 -76
  484. package/XR/features/WebXRHandTracking.js.map +1 -1
  485. package/XR/features/WebXRLightEstimation.js +2 -2
  486. package/XR/features/WebXRLightEstimation.js.map +1 -1
  487. package/XR/features/WebXRNearInteraction.d.ts +1 -1
  488. package/XR/features/WebXRNearInteraction.js +5 -5
  489. package/XR/features/WebXRNearInteraction.js.map +1 -1
  490. package/XR/features/WebXRRawCameraAccess.js +2 -2
  491. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  492. package/XR/motionController/webXRProfiledMotionController.js +2 -2
  493. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  494. package/XR/webXRCamera.js +3 -4
  495. package/XR/webXRCamera.js.map +1 -1
  496. package/XR/webXREnterExitUI.js +3 -4
  497. package/XR/webXREnterExitUI.js.map +1 -1
  498. package/XR/webXRExperienceHelper.js +12 -13
  499. package/XR/webXRExperienceHelper.js.map +1 -1
  500. package/XR/webXRManagedOutputCanvas.d.ts +1 -1
  501. package/XR/webXRManagedOutputCanvas.js +15 -6
  502. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  503. package/XR/webXRRenderTargetTextureProvider.js +2 -2
  504. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  505. package/XR/webXRTypes.d.ts +2 -2
  506. package/XR/webXRTypes.js.map +1 -1
  507. package/package.json +1 -1
  508. package/scene.d.ts +1 -1
  509. package/scene.js +4 -4
  510. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"webgpuTextureHelper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuTextureHelper.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,gEAAgE;AAChE,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACrB,MAAM,CAAC,sBAAsB,CAAC,KAAa,EAAE,MAAc;QAC9D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,MAAwB;QAC3D,QAAQ,MAAM,EAAE;YACZ,yBAAyB;YACzB,KAAK,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC;YAC3C,KAAK,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC;YAC3C,KAAK,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC;YAC1C,KAAK,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC;YAC1C,KAAK,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC;YAC5C,KAAK,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC;YAC5C,KAAK,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC;YAC3C,KAAK,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC;YAC3C,KAAK,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC;YAC9C,KAAK,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC;YAClD,KAAK,eAAe,CAAC,aAAa,CAAC,UAAU,C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MAAM,EAAE;YACZ,KAAK,eAAe,CAAC,aAAa,CAAC,oBAAoB,CAAC;YACxD,KAAK,eAAe,CAAC,aAAa,CAAC,mBAAmB;gBAClD,OAAO,IAAI,CAAC;SACnB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,MAAwB;QACrD,QAAQ,MAAM,EAAE;YACZ,KAAK,eAAe,CAAC,aAAa,CAAC,YAAY;gBAC3C,OAAO,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC;YACtD,KAAK,eAAe,CAAC,aAAa,CAAC,WAAW;gBAC1C,OAAO,eAAe,CAAC,aAAa,CAAC,WAAW,CAAC;YACrD,KAAK,eAAe,CAAC,aAAa,CAAC,mBAAmB;gBAClD,OAAO,eAAe,CAAC,aAAa,CAAC,WAAW,CAAC;YACrD,KAAK,eAAe,CAAC,aAAa,CAAC,YAAY;gBAC3C,OAAO,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC;YACtD,KAAK,eAAe,CAAC,aAAa,CAAC,oBAAoB;gBACnD,OAAO,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC;SACzD;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,WAAmB;QACvC,8BAA8B;QAC9B,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ","sourcesContent":["/* eslint-disable babylonjs/available */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport { Constants } from \"../constants\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\n\r\n/** @internal */\r\nexport class WebGPUTextureHelper {\r\n public static ComputeNumMipmapLevels(width: number, height: number) {\r\n return Scalar.ILog2(Math.max(width, height)) + 1;\r\n }\r\n\r\n public static GetTextureTypeFromFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n // One Component = 8 bits\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n\r\n // One component = 16 bits\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return Constants.TEXTURETYPE_HALF_FLOAT;\r\n\r\n // One component = 32 bits\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return Constants.TEXTURETYPE_FLOAT;\r\n }\r\n\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n public static GetBlockInformationFromFormat(format: GPUTextureFormat): { width: number; height: number; length: number } {\r\n switch (format) {\r\n // 8 bits formats\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n return { width: 1, height: 1, length: 1 };\r\n\r\n // 16 bits formats\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n return { width: 1, height: 1, length: 2 };\r\n\r\n // 32 bits formats\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n return { width: 1, height: 1, length: 4 };\r\n\r\n // 64 bits formats\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return { width: 1, height: 1, length: 8 };\r\n\r\n // 128 bits formats\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n return { width: 1, height: 1, length: 16 };\r\n\r\n // Depth and stencil formats\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Stencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return { width: 1, height: 1, length: 2 };\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24Plus format!\";\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24PlusStencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return { width: 1, height: 1, length: 4 };\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return { width: 1, height: 1, length: 5 };\r\n\r\n // BC compressed formats usable if \"texture-compression-bc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n return { width: 5, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n return { width: 5, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n return { width: 6, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n return { width: 6, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n return { width: 8, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n return { width: 8, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n return { width: 8, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n return { width: 10, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n return { width: 10, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n return { width: 10, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n return { width: 10, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n return { width: 12, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return { width: 12, height: 12, length: 16 };\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n\r\n public static IsHardwareTexture(texture: HardwareTextureWrapper | GPUTexture): texture is HardwareTextureWrapper {\r\n return !!(texture as HardwareTextureWrapper).release;\r\n }\r\n\r\n public static IsInternalTexture(texture: InternalTexture | GPUTexture): texture is InternalTexture {\r\n return !!(texture as InternalTexture).dispose;\r\n }\r\n\r\n public static IsImageBitmap(imageBitmap: ImageBitmap | { width: number; height: number }): imageBitmap is ImageBitmap {\r\n return (imageBitmap as ImageBitmap).close !== undefined;\r\n }\r\n\r\n public static IsImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number; height: number }): imageBitmap is ImageBitmap[] {\r\n return Array.isArray(imageBitmap as ImageBitmap[]) && (imageBitmap as ImageBitmap[])[0].close !== undefined;\r\n }\r\n\r\n public static IsCompressedFormat(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetWebGPUTextureFormat(type: number, format: number, useSRGBBuffer = false): GPUTextureFormat {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth24PlusStencil8;\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth32FloatStencil8;\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Stencil8;\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC7RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBUFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC3RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC2RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC1RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC4x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGB8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGBA8Unorm;\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Snorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Snorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Snorm;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Unorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Unorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n case Constants.TEXTUREFORMAT_BGRA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BGRA8UnormSRGB : WebGPUConstants.TextureFormat.BGRA8Unorm;\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Uint;\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_ALPHA format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R32Float; // By default. Other possibility is R16Float.\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG32Float; // By default. Other possibility is RG16Float.\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA32Float; // By default. Other possibility is RGBA16Float.\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Float;\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R16Float;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG16Float;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGB10A2UINT;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n }\r\n }\r\n\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n\r\n public static GetNumChannelsFromWebGPUTextureFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return 1;\r\n\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return 2;\r\n\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n return 3;\r\n\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return 4;\r\n }\r\n\r\n // eslint-disable-next-line no-throw-literal\r\n throw `Unknown format ${format}!`;\r\n }\r\n\r\n public static HasStencilAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static HasDepthAndStencilAspects(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetDepthFormatOnly(format: GPUTextureFormat): GPUTextureFormat {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n }\r\n\r\n return format;\r\n }\r\n\r\n public static GetSample(sampleCount: number) {\r\n // WebGPU only supports 1 or 4\r\n return sampleCount > 1 ? 4 : 1;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"webgpuTextureHelper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuTextureHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACrB,MAAM,CAAC,sBAAsB,CAAC,KAAa,EAAE,MAAc;QAC9D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,MAAwB;QAC3D,QAAQ,MAAM,EAAE;YACZ,yBAAyB;YACzB,2DAA2C;YAC3C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uEAAkD;YACtD;gBACI,qEAAiD;YACrD;gBACI,qEAAiD;YACrD;gBACI,uEAAkD;YACtD;gBACI,uEAAkD;SACzD;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,WAAmB;QACvC,8BAA8B;QAC9B,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ","sourcesContent":["/* eslint-disable babylonjs/available */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport { Constants } from \"../constants\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\n\r\n/** @internal */\r\nexport class WebGPUTextureHelper {\r\n public static ComputeNumMipmapLevels(width: number, height: number) {\r\n return Scalar.ILog2(Math.max(width, height)) + 1;\r\n }\r\n\r\n public static GetTextureTypeFromFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n // One Component = 8 bits\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n\r\n // One component = 16 bits\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return Constants.TEXTURETYPE_HALF_FLOAT;\r\n\r\n // One component = 32 bits\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return Constants.TEXTURETYPE_FLOAT;\r\n }\r\n\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n public static GetBlockInformationFromFormat(format: GPUTextureFormat): { width: number; height: number; length: number } {\r\n switch (format) {\r\n // 8 bits formats\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n return { width: 1, height: 1, length: 1 };\r\n\r\n // 16 bits formats\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n return { width: 1, height: 1, length: 2 };\r\n\r\n // 32 bits formats\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n return { width: 1, height: 1, length: 4 };\r\n\r\n // 64 bits formats\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return { width: 1, height: 1, length: 8 };\r\n\r\n // 128 bits formats\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n return { width: 1, height: 1, length: 16 };\r\n\r\n // Depth and stencil formats\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Stencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return { width: 1, height: 1, length: 2 };\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24Plus format!\";\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24PlusStencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return { width: 1, height: 1, length: 4 };\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return { width: 1, height: 1, length: 5 };\r\n\r\n // BC compressed formats usable if \"texture-compression-bc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n return { width: 5, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n return { width: 5, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n return { width: 6, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n return { width: 6, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n return { width: 8, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n return { width: 8, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n return { width: 8, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n return { width: 10, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n return { width: 10, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n return { width: 10, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n return { width: 10, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n return { width: 12, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return { width: 12, height: 12, length: 16 };\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n\r\n public static IsHardwareTexture(texture: HardwareTextureWrapper | GPUTexture): texture is HardwareTextureWrapper {\r\n return !!(texture as HardwareTextureWrapper).release;\r\n }\r\n\r\n public static IsInternalTexture(texture: InternalTexture | GPUTexture): texture is InternalTexture {\r\n return !!(texture as InternalTexture).dispose;\r\n }\r\n\r\n public static IsImageBitmap(imageBitmap: ImageBitmap | { width: number; height: number }): imageBitmap is ImageBitmap {\r\n return (imageBitmap as ImageBitmap).close !== undefined;\r\n }\r\n\r\n public static IsImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number; height: number }): imageBitmap is ImageBitmap[] {\r\n return Array.isArray(imageBitmap as ImageBitmap[]) && (imageBitmap as ImageBitmap[])[0].close !== undefined;\r\n }\r\n\r\n public static IsCompressedFormat(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetWebGPUTextureFormat(type: number, format: number, useSRGBBuffer = false): GPUTextureFormat {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth24PlusStencil8;\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth32FloatStencil8;\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Stencil8;\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC7RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBUFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC3RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC2RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC1RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC4x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGB8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGBA8Unorm;\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Snorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Snorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Snorm;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Unorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Unorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n case Constants.TEXTUREFORMAT_BGRA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BGRA8UnormSRGB : WebGPUConstants.TextureFormat.BGRA8Unorm;\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Uint;\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_ALPHA format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R32Float; // By default. Other possibility is R16Float.\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG32Float; // By default. Other possibility is RG16Float.\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA32Float; // By default. Other possibility is RGBA16Float.\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Float;\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R16Float;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG16Float;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGB10A2UINT;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n }\r\n }\r\n\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n\r\n public static GetNumChannelsFromWebGPUTextureFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return 1;\r\n\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return 2;\r\n\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n return 3;\r\n\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return 4;\r\n }\r\n\r\n // eslint-disable-next-line no-throw-literal\r\n throw `Unknown format ${format}!`;\r\n }\r\n\r\n public static HasStencilAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static HasDepthAndStencilAspects(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetDepthFormatOnly(format: GPUTextureFormat): GPUTextureFormat {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n }\r\n\r\n return format;\r\n }\r\n\r\n public static GetSample(sampleCount: number) {\r\n // WebGPU only supports 1 or 4\r\n return sampleCount > 1 ? 4 : 1;\r\n }\r\n}\r\n"]}
@@ -22,7 +22,6 @@
22
22
  // SOFTWARE.
23
23
  import * as WebGPUConstants from "./webgpuConstants.js";
24
24
 
25
- import { InternalTextureSource } from "../../Materials/Textures/internalTexture.js";
26
25
  import { WebGPUHardwareTexture } from "./webgpuHardwareTexture.js";
27
26
  import { WebGPUTextureHelper } from "./webgpuTextureHelper.js";
28
27
  // TODO WEBGPU improve mipmap generation by using compute shaders
@@ -276,15 +275,15 @@ export class WebGPUTextureManager {
276
275
  this._glslang = glslang;
277
276
  this._tintWASM = tintWASM;
278
277
  this._bufferManager = bufferManager;
279
- if (enabledExtensions.indexOf(WebGPUConstants.FeatureName.RG11B10UFloatRenderable) !== -1) {
278
+ if (enabledExtensions.indexOf("rg11b10ufloat-renderable" /* WebGPUConstants.FeatureName.RG11B10UFloatRenderable */) !== -1) {
280
279
  const keys = Object.keys(renderableTextureFormatToIndex);
281
- renderableTextureFormatToIndex[WebGPUConstants.TextureFormat.RG11B10UFloat] = renderableTextureFormatToIndex[keys[keys.length - 1]] + 1;
280
+ renderableTextureFormatToIndex["rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */] = renderableTextureFormatToIndex[keys[keys.length - 1]] + 1;
282
281
  }
283
- this._mipmapSampler = device.createSampler({ minFilter: WebGPUConstants.FilterMode.Linear });
284
- this._videoSampler = device.createSampler({ minFilter: WebGPUConstants.FilterMode.Linear });
282
+ this._mipmapSampler = device.createSampler({ minFilter: "linear" /* WebGPUConstants.FilterMode.Linear */ });
283
+ this._videoSampler = device.createSampler({ minFilter: "linear" /* WebGPUConstants.FilterMode.Linear */ });
285
284
  this._ubCopyWithOfst = this._bufferManager.createBuffer(4 * 4, WebGPUConstants.BufferUsage.Uniform | WebGPUConstants.BufferUsage.CopyDst, "UBCopyWithOffset").underlyingResource;
286
- this._getPipeline(WebGPUConstants.TextureFormat.RGBA8Unorm);
287
- this._getVideoPipeline(WebGPUConstants.TextureFormat.RGBA8Unorm);
285
+ this._getPipeline("rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);
286
+ this._getVideoPipeline("rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);
288
287
  }
289
288
  _getPipeline(format, type = PipelineType.MipMap, params) {
290
289
  const index = type === PipelineType.MipMap
@@ -327,7 +326,7 @@ export class WebGPUTextureManager {
327
326
  modules = this._compiledShaders[index] = [vertexModule, fragmentModule];
328
327
  }
329
328
  const pipeline = this._device.createRenderPipeline({
330
- layout: WebGPUConstants.AutoLayoutMode.Auto,
329
+ layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
331
330
  vertex: {
332
331
  module: modules[0],
333
332
  entryPoint: "main",
@@ -342,8 +341,8 @@ export class WebGPUTextureManager {
342
341
  ],
343
342
  },
344
343
  primitive: {
345
- topology: WebGPUConstants.PrimitiveTopology.TriangleStrip,
346
- stripIndexFormat: WebGPUConstants.IndexFormat.Uint16,
344
+ topology: "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,
345
+ stripIndexFormat: "uint16" /* WebGPUConstants.IndexFormat.Uint16 */,
347
346
  },
348
347
  });
349
348
  pipelineAndBGL = this._pipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];
@@ -369,7 +368,7 @@ export class WebGPUTextureManager {
369
368
  }
370
369
  const pipeline = this._device.createRenderPipeline({
371
370
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_${format}_${index === 0 ? "DontInvertY" : "InvertY"}`,
372
- layout: WebGPUConstants.AutoLayoutMode.Auto,
371
+ layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
373
372
  vertex: {
374
373
  module: modules[0],
375
374
  entryPoint: "main",
@@ -384,8 +383,8 @@ export class WebGPUTextureManager {
384
383
  ],
385
384
  },
386
385
  primitive: {
387
- topology: WebGPUConstants.PrimitiveTopology.TriangleStrip,
388
- stripIndexFormat: WebGPUConstants.IndexFormat.Uint16,
386
+ topology: "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,
387
+ stripIndexFormat: "uint16" /* WebGPUConstants.IndexFormat.Uint16 */,
389
388
  },
390
389
  });
391
390
  pipelineAndBGL = this._videoPipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];
@@ -409,15 +408,15 @@ export class WebGPUTextureManager {
409
408
  {
410
409
  view: webgpuHardwareTexture.underlyingResource.createView({
411
410
  format,
412
- dimension: WebGPUConstants.TextureViewDimension.E2d,
411
+ dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
413
412
  mipLevelCount: 1,
414
413
  baseArrayLayer: 0,
415
414
  baseMipLevel: 0,
416
415
  arrayLayerCount: 1,
417
- aspect: WebGPUConstants.TextureAspect.All,
416
+ aspect: "all" /* WebGPUConstants.TextureAspect.All */,
418
417
  }),
419
- loadOp: WebGPUConstants.LoadOp.Load,
420
- storeOp: WebGPUConstants.StoreOp.Store,
418
+ loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
419
+ storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
421
420
  },
422
421
  ],
423
422
  };
@@ -482,21 +481,21 @@ export class WebGPUTextureManager {
482
481
  }
483
482
  const webgpuHardwareTexture = gpuOrHdwTexture;
484
483
  const outputTexture = webgpuHardwareTexture?._copyInvertYTempTexture ??
485
- this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.RenderAttachment | WebGPUConstants.TextureUsage.TextureBinding, undefined, "TempTextureForCopyWithInvertY");
484
+ this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, "TempTextureForCopyWithInvertY");
486
485
  const renderPassDescriptor = webgpuHardwareTexture?._copyInvertYRenderPassDescr ?? {
487
486
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_invertYPreMultiplyAlpha_${format}_${invertY ? "InvertY" : "DontInvertY"}_${premultiplyAlpha ? "PremultiplyAlpha" : "DontPremultiplyAlpha"}`,
488
487
  colorAttachments: [
489
488
  {
490
489
  view: outputTexture.createView({
491
490
  format,
492
- dimension: WebGPUConstants.TextureViewDimension.E2d,
491
+ dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
493
492
  baseMipLevel: 0,
494
493
  mipLevelCount: 1,
495
494
  arrayLayerCount: 1,
496
495
  baseArrayLayer: 0,
497
496
  }),
498
- loadOp: WebGPUConstants.LoadOp.Load,
499
- storeOp: WebGPUConstants.StoreOp.Store,
497
+ loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
498
+ storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
500
499
  },
501
500
  ],
502
501
  };
@@ -510,7 +509,7 @@ export class WebGPUTextureManager {
510
509
  binding: 0,
511
510
  resource: gpuTexture.createView({
512
511
  format,
513
- dimension: WebGPUConstants.TextureViewDimension.E2d,
512
+ dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
514
513
  baseMipLevel: mipLevel,
515
514
  mipLevelCount: 1,
516
515
  arrayLayerCount: layers,
@@ -597,7 +596,7 @@ export class WebGPUTextureManager {
597
596
  //------------------------------------------------------------------------------
598
597
  // Creation
599
598
  //------------------------------------------------------------------------------
600
- createTexture(imageBitmap, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, is3D = false, format = WebGPUConstants.TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
599
+ 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) {
601
600
  sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
602
601
  const layerCount = imageBitmap.layers || 1;
603
602
  const textureSize = {
@@ -605,19 +604,19 @@ export class WebGPUTextureManager {
605
604
  height: imageBitmap.height,
606
605
  depthOrArrayLayers: layerCount,
607
606
  };
608
- const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? WebGPUConstants.TextureUsage.RenderAttachment : 0;
607
+ const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;
609
608
  const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);
610
609
  const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1;
611
- const usages = usage >= 0 ? usage : WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.CopyDst | WebGPUConstants.TextureUsage.TextureBinding;
612
- additionalUsages |= hasMipmaps && !isCompressedFormat ? WebGPUConstants.TextureUsage.CopySrc | renderAttachmentFlag : 0;
610
+ const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;
611
+ additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;
613
612
  if (!isCompressedFormat && !is3D) {
614
613
  // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times
615
- additionalUsages |= renderAttachmentFlag | WebGPUConstants.TextureUsage.CopyDst;
614
+ additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;
616
615
  }
617
616
  const gpuTexture = this._device.createTexture({
618
617
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_Texture${is3D ? "3D" : "2D"}_${label ? label + "_" : ""}${textureSize.width}x${textureSize.height}x${textureSize.depthOrArrayLayers}_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`,
619
618
  size: textureSize,
620
- dimension: is3D ? WebGPUConstants.TextureDimension.E3d : WebGPUConstants.TextureDimension.E2d,
619
+ dimension: is3D ? "3d" /* WebGPUConstants.TextureDimension.E3d */ : "2d" /* WebGPUConstants.TextureDimension.E2d */,
621
620
  format,
622
621
  usage: usages | additionalUsages,
623
622
  sampleCount,
@@ -631,18 +630,18 @@ export class WebGPUTextureManager {
631
630
  }
632
631
  return gpuTexture;
633
632
  }
634
- createCubeTexture(imageBitmaps, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format = WebGPUConstants.TextureFormat.RGBA8Unorm, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
633
+ createCubeTexture(imageBitmaps, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
635
634
  sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
636
635
  const width = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width;
637
636
  const height = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height;
638
- const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? WebGPUConstants.TextureUsage.RenderAttachment : 0;
637
+ const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;
639
638
  const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);
640
639
  const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1;
641
- const usages = usage >= 0 ? usage : WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.CopyDst | WebGPUConstants.TextureUsage.TextureBinding;
642
- additionalUsages |= hasMipmaps && !isCompressedFormat ? WebGPUConstants.TextureUsage.CopySrc | renderAttachmentFlag : 0;
640
+ const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;
641
+ additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;
643
642
  if (!isCompressedFormat) {
644
643
  // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times
645
- additionalUsages |= renderAttachmentFlag | WebGPUConstants.TextureUsage.CopyDst;
644
+ additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;
646
645
  }
647
646
  const gpuTexture = this._device.createTexture({
648
647
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureCube_${label ? label + "_" : ""}${width}x${height}x6_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`,
@@ -651,7 +650,7 @@ export class WebGPUTextureManager {
651
650
  height,
652
651
  depthOrArrayLayers: 6,
653
652
  },
654
- dimension: WebGPUConstants.TextureDimension.E2d,
653
+ dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
655
654
  format,
656
655
  usage: usages | additionalUsages,
657
656
  sampleCount,
@@ -709,14 +708,14 @@ export class WebGPUTextureManager {
709
708
  {
710
709
  view: gpuTexture.createView({
711
710
  format,
712
- dimension: is3D ? WebGPUConstants.TextureViewDimension.E3d : WebGPUConstants.TextureViewDimension.E2d,
711
+ dimension: is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
713
712
  baseMipLevel: i,
714
713
  mipLevelCount: 1,
715
714
  arrayLayerCount: 1,
716
715
  baseArrayLayer: faceIndex,
717
716
  }),
718
- loadOp: WebGPUConstants.LoadOp.Load,
719
- storeOp: WebGPUConstants.StoreOp.Store,
717
+ loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
718
+ storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
720
719
  },
721
720
  ],
722
721
  };
@@ -737,7 +736,7 @@ export class WebGPUTextureManager {
737
736
  binding: 1,
738
737
  resource: gpuTexture.createView({
739
738
  format,
740
- dimension: is3D ? WebGPUConstants.TextureViewDimension.E3d : WebGPUConstants.TextureViewDimension.E2d,
739
+ dimension: is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
741
740
  baseMipLevel: i - 1,
742
741
  mipLevelCount: 1,
743
742
  arrayLayerCount: 1,
@@ -778,12 +777,12 @@ export class WebGPUTextureManager {
778
777
  const isStorageTexture = ((creationFlags ?? 0) & 1) !== 0;
779
778
  gpuTextureWrapper.format = WebGPUTextureHelper.GetWebGPUTextureFormat(texture.type, texture.format, texture._useSRGBBuffer);
780
779
  gpuTextureWrapper.textureUsages =
781
- texture._source === InternalTextureSource.RenderTarget || texture.source === InternalTextureSource.MultiRenderTarget
782
- ? WebGPUConstants.TextureUsage.TextureBinding | WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.RenderAttachment
783
- : texture._source === InternalTextureSource.DepthStencil
784
- ? WebGPUConstants.TextureUsage.TextureBinding | WebGPUConstants.TextureUsage.RenderAttachment
780
+ texture._source === 5 /* InternalTextureSource.RenderTarget */ || texture.source === 6 /* InternalTextureSource.MultiRenderTarget */
781
+ ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */
782
+ : texture._source === 12 /* InternalTextureSource.DepthStencil */
783
+ ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */
785
784
  : -1;
786
- gpuTextureWrapper.textureAdditionalUsages = isStorageTexture ? WebGPUConstants.TextureUsage.StorageBinding : 0;
785
+ gpuTextureWrapper.textureAdditionalUsages = isStorageTexture ? 8 /* WebGPUConstants.TextureUsage.StorageBinding */ : 0;
787
786
  const hasMipMaps = texture.generateMipMaps;
788
787
  const layerCount = depth || 1;
789
788
  let mipmapCount;
@@ -798,8 +797,8 @@ export class WebGPUTextureManager {
798
797
  gpuTextureWrapper.set(gpuTexture);
799
798
  const arrayLayerCount = texture.is3D ? 1 : layerCount;
800
799
  const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);
801
- const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? WebGPUConstants.TextureAspect.DepthOnly : WebGPUConstants.TextureAspect.All;
802
- const dimension = texture.is2DArray ? WebGPUConstants.TextureViewDimension.CubeArray : WebGPUConstants.TextureViewDimension.Cube;
800
+ const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? "depth-only" /* WebGPUConstants.TextureAspect.DepthOnly */ : "all" /* WebGPUConstants.TextureAspect.All */;
801
+ const dimension = texture.is2DArray ? "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */ : "cube" /* WebGPUConstants.TextureViewDimension.Cube */;
803
802
  gpuTextureWrapper.createView({
804
803
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureViewCube${texture.is2DArray ? "_Array" + arrayLayerCount : ""}_${width}x${height}_${hasMipMaps ? "wmips" : "womips"}_${format}_${dimension}_${aspect}_${texture.label ?? "noname"}`,
805
804
  format,
@@ -816,12 +815,12 @@ export class WebGPUTextureManager {
816
815
  gpuTextureWrapper.set(gpuTexture);
817
816
  const arrayLayerCount = texture.is3D ? 1 : layerCount;
818
817
  const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);
819
- const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? WebGPUConstants.TextureAspect.DepthOnly : WebGPUConstants.TextureAspect.All;
818
+ const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? "depth-only" /* WebGPUConstants.TextureAspect.DepthOnly */ : "all" /* WebGPUConstants.TextureAspect.All */;
820
819
  const dimension = texture.is2DArray
821
- ? WebGPUConstants.TextureViewDimension.E2dArray
820
+ ? "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */
822
821
  : texture.is3D
823
- ? WebGPUConstants.TextureDimension.E3d
824
- : WebGPUConstants.TextureViewDimension.E2d;
822
+ ? "3d" /* WebGPUConstants.TextureDimension.E3d */
823
+ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */;
825
824
  gpuTextureWrapper.createView({
826
825
  label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureView${texture.is3D ? "3D" : "2D"}${texture.is2DArray ? "_Array" + arrayLayerCount : ""}_${width}x${height}${texture.is3D ? "x" + layerCount : ""}_${hasMipMaps ? "wmips" : "womips"}_${format}_${dimension}_${aspect}_${texture.label ?? "noname"}`,
827
826
  format,
@@ -849,7 +848,7 @@ export class WebGPUTextureManager {
849
848
  }
850
849
  const width = texture.width;
851
850
  const height = texture.height;
852
- const gpuMSAATexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, WebGPUConstants.TextureUsage.RenderAttachment, 0, texture.label ? "MSAA" + texture.label : undefined);
851
+ const gpuMSAATexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, 16 /* WebGPUConstants.TextureUsage.RenderAttachment */, 0, texture.label ? "MSAA" + texture.label : undefined);
853
852
  gpuTextureWrapper.setMSAATexture(gpuMSAATexture, index);
854
853
  }
855
854
  //------------------------------------------------------------------------------
@@ -935,7 +934,7 @@ export class WebGPUTextureManager {
935
934
  // we must apply the preprocessing on the source image before copying it into the destination texture
936
935
  const commandEncoder = this._device.createCommandEncoder({});
937
936
  // create a temp texture and copy the image to it
938
- const srcTexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, WebGPUConstants.TextureUsage.CopySrc | WebGPUConstants.TextureUsage.TextureBinding, undefined, "TempTextureForUpdateTexture");
937
+ const srcTexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, "TempTextureForUpdateTexture");
939
938
  this._deferredReleaseTextures.push([srcTexture, null]);
940
939
  textureExtent.depthOrArrayLayers = 1;
941
940
  this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, { texture: srcTexture }, textureExtent);