@onerjs/core 8.56.4 → 9.0.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 (482) hide show
  1. package/Animations/animatable.core.js +36 -0
  2. package/Animations/animatable.core.js.map +1 -1
  3. package/Animations/animationGroup.pure.d.ts +61 -1
  4. package/Animations/animationGroup.pure.js +191 -2
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/index.d.ts +1 -0
  7. package/Animations/index.js +1 -0
  8. package/Animations/index.js.map +1 -1
  9. package/Animations/pure.d.ts +1 -0
  10. package/Animations/pure.js +1 -0
  11. package/Animations/pure.js.map +1 -1
  12. package/Animations/rootMotion.d.ts +560 -0
  13. package/Animations/rootMotion.js +1709 -0
  14. package/Animations/rootMotion.js.map +1 -0
  15. package/Animations/runtimeAnimation.d.ts +57 -0
  16. package/Animations/runtimeAnimation.js +127 -3
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Cameras/arcRotateCamera.pure.d.ts +2 -0
  19. package/Cameras/arcRotateCamera.pure.js +2 -0
  20. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  21. package/Cameras/targetCamera.pure.d.ts +2 -0
  22. package/Cameras/targetCamera.pure.js +7 -1
  23. package/Cameras/targetCamera.pure.js.map +1 -1
  24. package/Collisions/gpuPicker.js +5 -5
  25. package/Collisions/gpuPicker.js.map +1 -1
  26. package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
  27. package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
  28. package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
  29. package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
  30. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
  31. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
  32. package/Engines/Extensions/engine.multiRender.pure.js +63 -0
  33. package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
  34. package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
  35. package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
  36. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
  37. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
  38. package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
  39. package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
  40. package/Engines/Extensions/index.d.ts +1 -0
  41. package/Engines/Extensions/index.js +1 -0
  42. package/Engines/Extensions/index.js.map +1 -1
  43. package/Engines/Extensions/pure.d.ts +1 -1
  44. package/Engines/Extensions/pure.js +1 -1
  45. package/Engines/Extensions/pure.js.map +1 -1
  46. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
  47. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
  48. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
  49. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
  50. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
  51. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  52. package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
  53. package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
  54. package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
  55. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  56. package/Engines/WebGPU/Extensions/index.d.ts +1 -0
  57. package/Engines/WebGPU/Extensions/index.js +1 -0
  58. package/Engines/WebGPU/Extensions/index.js.map +1 -1
  59. package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
  60. package/Engines/WebGPU/Extensions/pure.js +1 -1
  61. package/Engines/WebGPU/Extensions/pure.js.map +1 -1
  62. package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
  63. package/Engines/WebGPU/webgpuBundleList.js +4 -0
  64. package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
  65. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
  66. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  67. package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
  68. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  69. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  70. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  71. package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
  72. package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
  73. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  74. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
  75. package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
  76. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  77. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
  78. package/Engines/WebGPU/webgpuTextureManager.js +286 -13
  79. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  80. package/Engines/abstractEngine.pure.d.ts +2 -0
  81. package/Engines/abstractEngine.pure.js +7 -3
  82. package/Engines/abstractEngine.pure.js.map +1 -1
  83. package/Engines/constants.d.ts +4 -0
  84. package/Engines/constants.js +4 -0
  85. package/Engines/constants.js.map +1 -1
  86. package/Engines/thinEngine.pure.d.ts +14 -0
  87. package/Engines/thinEngine.pure.js +48 -12
  88. package/Engines/thinEngine.pure.js.map +1 -1
  89. package/Engines/thinNativeEngine.pure.d.ts +1 -0
  90. package/Engines/thinNativeEngine.pure.js +7 -1
  91. package/Engines/thinNativeEngine.pure.js.map +1 -1
  92. package/Engines/thinWebGPUEngine.d.ts +4 -0
  93. package/Engines/thinWebGPUEngine.js +10 -1
  94. package/Engines/thinWebGPUEngine.js.map +1 -1
  95. package/Engines/webgpuEngine.pure.d.ts +5 -2
  96. package/Engines/webgpuEngine.pure.js +48 -13
  97. package/Engines/webgpuEngine.pure.js.map +1 -1
  98. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
  99. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
  100. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
  101. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
  102. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
  103. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
  104. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
  105. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
  106. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
  107. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
  108. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
  109. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
  110. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
  111. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
  112. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
  113. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
  114. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
  115. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
  116. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
  117. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
  118. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +2 -0
  119. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +4 -0
  120. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  121. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
  122. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +53 -10
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
  129. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
  130. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
  131. package/FlowGraph/flowGraph.d.ts +4 -0
  132. package/FlowGraph/flowGraph.js +38 -7
  133. package/FlowGraph/flowGraph.js.map +1 -1
  134. package/FlowGraph/flowGraphBlock.js +3 -0
  135. package/FlowGraph/flowGraphBlock.js.map +1 -1
  136. package/FlowGraph/flowGraphConnection.d.ts +7 -0
  137. package/FlowGraph/flowGraphConnection.js +7 -0
  138. package/FlowGraph/flowGraphConnection.js.map +1 -1
  139. package/FlowGraph/flowGraphContext.d.ts +2 -1
  140. package/FlowGraph/flowGraphContext.js +4 -3
  141. package/FlowGraph/flowGraphContext.js.map +1 -1
  142. package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
  143. package/FlowGraph/flowGraphCoordinator.js +47 -16
  144. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  145. package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
  146. package/FlowGraph/flowGraphEventBlock.js +7 -0
  147. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  148. package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
  149. package/FlowGraph/flowGraphHostResolver.js.map +1 -1
  150. package/FlowGraph/flowGraphParser.js +60 -2
  151. package/FlowGraph/flowGraphParser.js.map +1 -1
  152. package/FlowGraph/serialization.d.ts +2 -0
  153. package/FlowGraph/serialization.js +10 -22
  154. package/FlowGraph/serialization.js.map +1 -1
  155. package/FlowGraph/typeDefinitions.d.ts +8 -0
  156. package/FlowGraph/typeDefinitions.js.map +1 -1
  157. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
  158. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
  159. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
  160. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
  161. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
  162. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
  163. package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
  164. package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
  165. package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
  166. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
  167. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  168. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
  169. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
  170. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
  172. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  174. package/FrameGraph/Node/Blocks/index.js +1 -0
  175. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  176. package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
  177. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  178. package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
  179. package/FrameGraph/Node/Blocks/pure.js +1 -0
  180. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  181. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  182. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
  183. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  184. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  185. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  186. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
  187. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
  188. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
  189. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  190. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
  191. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  192. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
  193. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
  194. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
  195. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
  196. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +69 -33
  197. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  198. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
  199. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  200. package/FrameGraph/frameGraphObjectList.d.ts +6 -1
  201. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  202. package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
  203. package/FrameGraph/frameGraphRenderContext.js +5 -5
  204. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  205. package/FrameGraph/index.d.ts +1 -0
  206. package/FrameGraph/index.js +1 -0
  207. package/FrameGraph/index.js.map +1 -1
  208. package/FrameGraph/pure.d.ts +1 -0
  209. package/FrameGraph/pure.js +1 -0
  210. package/FrameGraph/pure.js.map +1 -1
  211. package/Inputs/scene.inputManager.d.ts +4 -0
  212. package/Inputs/scene.inputManager.js +50 -8
  213. package/Inputs/scene.inputManager.js.map +1 -1
  214. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +5 -5
  215. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  216. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +5 -5
  217. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  218. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
  219. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +151 -47
  220. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  221. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
  222. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  223. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
  224. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  225. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
  226. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  227. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
  228. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  229. package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
  230. package/Materials/Node/nodeMaterial.pure.js +4 -0
  231. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  232. package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
  233. package/Materials/Node/nodeMaterialBuildState.js +25 -3
  234. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  235. package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
  236. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
  237. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +13 -14
  238. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +6 -6
  239. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  240. package/Materials/Textures/baseTexture.pure.js +3 -0
  241. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  242. package/Materials/Textures/cubeTexture.pure.js +1 -1
  243. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  244. package/Materials/Textures/internalTexture.d.ts +8 -1
  245. package/Materials/Textures/internalTexture.js +9 -2
  246. package/Materials/Textures/internalTexture.js.map +1 -1
  247. package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
  248. package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
  249. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  250. package/Materials/Textures/rawTexture3D.js +1 -1
  251. package/Materials/Textures/rawTexture3D.js.map +1 -1
  252. package/Materials/Textures/textureHelper.functions.d.ts +14 -0
  253. package/Materials/Textures/textureHelper.functions.js +24 -0
  254. package/Materials/Textures/textureHelper.functions.js.map +1 -1
  255. package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
  256. package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
  257. package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
  258. package/Materials/index.d.ts +1 -0
  259. package/Materials/index.js +1 -0
  260. package/Materials/index.js.map +1 -1
  261. package/Materials/materialHelper.geometryrendering.d.ts +46 -1
  262. package/Materials/materialHelper.geometryrendering.js +105 -8
  263. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  264. package/Materials/prepass.defines.d.ts +2 -0
  265. package/Materials/prepass.defines.js +2 -0
  266. package/Materials/prepass.defines.js.map +1 -1
  267. package/Materials/pure.d.ts +1 -0
  268. package/Materials/pure.js +1 -0
  269. package/Materials/pure.js.map +1 -1
  270. package/Materials/standardMaterial.pure.d.ts +2 -0
  271. package/Materials/standardMaterial.pure.js +6 -3
  272. package/Materials/standardMaterial.pure.js.map +1 -1
  273. package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
  274. package/Meshes/Builders/polygonBuilder.pure.js +4 -1
  275. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  276. package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
  277. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
  278. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
  279. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -14
  280. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +20 -24
  281. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  282. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -0
  283. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +11 -4
  284. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  285. package/Meshes/abstractMesh.pure.d.ts +18 -0
  286. package/Meshes/abstractMesh.pure.js +22 -0
  287. package/Meshes/abstractMesh.pure.js.map +1 -1
  288. package/Meshes/index.d.ts +1 -0
  289. package/Meshes/index.js +1 -0
  290. package/Meshes/index.js.map +1 -1
  291. package/Meshes/instancedMesh.pure.d.ts +5 -0
  292. package/Meshes/instancedMesh.pure.js +12 -0
  293. package/Meshes/instancedMesh.pure.js.map +1 -1
  294. package/Meshes/mesh.pure.js +23 -8
  295. package/Meshes/mesh.pure.js.map +1 -1
  296. package/Meshes/meshBlendingTag.d.ts +47 -0
  297. package/Meshes/meshBlendingTag.js +64 -0
  298. package/Meshes/meshBlendingTag.js.map +1 -0
  299. package/Meshes/polygonMesh.js +2 -2
  300. package/Meshes/polygonMesh.js.map +1 -1
  301. package/Meshes/pure.d.ts +1 -0
  302. package/Meshes/pure.js +1 -0
  303. package/Meshes/pure.js.map +1 -1
  304. package/Misc/fileTools.pure.js +21 -0
  305. package/Misc/fileTools.pure.js.map +1 -1
  306. package/Misc/snapshotRenderingHelper.js +2 -2
  307. package/Misc/snapshotRenderingHelper.js.map +1 -1
  308. package/Misc/tools.pure.js +1 -1
  309. package/Misc/tools.pure.js.map +1 -1
  310. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  311. package/Particles/gpuParticleSystem.pure.js +89 -28
  312. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  313. package/Particles/thinParticleSystem.pure.d.ts +2 -0
  314. package/Particles/thinParticleSystem.pure.js +84 -19
  315. package/Particles/thinParticleSystem.pure.js.map +1 -1
  316. package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
  317. package/Particles/webgl2ParticleSystem.pure.js +12 -4
  318. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  319. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
  320. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
  321. package/PostProcesses/index.d.ts +2 -0
  322. package/PostProcesses/index.js +2 -0
  323. package/PostProcesses/index.js.map +1 -1
  324. package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
  325. package/PostProcesses/meshBlendingBlueNoise.js +77 -0
  326. package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
  327. package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
  328. package/PostProcesses/meshBlendingPostProcess.js +315 -0
  329. package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
  330. package/PostProcesses/pure.d.ts +2 -0
  331. package/PostProcesses/pure.js +2 -0
  332. package/PostProcesses/pure.js.map +1 -1
  333. package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
  334. package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
  335. package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
  336. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
  337. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  338. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +8 -8
  339. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  340. package/Rendering/boundingBoxRenderer.pure.js +2 -1
  341. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  342. package/Rendering/depthRenderer.pure.js +3 -4
  343. package/Rendering/depthRenderer.pure.js.map +1 -1
  344. package/Rendering/edgesRenderer.pure.d.ts +4 -2
  345. package/Rendering/edgesRenderer.pure.js +11 -2
  346. package/Rendering/edgesRenderer.pure.js.map +1 -1
  347. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +10 -0
  348. package/Rendering/fluidRenderer/fluidRenderingObject.js +20 -0
  349. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  350. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +9 -3
  351. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +14 -9
  352. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  353. package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
  354. package/Rendering/geometryBufferRenderer.pure.js +126 -17
  355. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  356. package/Rendering/objectRenderer.d.ts +7 -1
  357. package/Rendering/objectRenderer.js +45 -7
  358. package/Rendering/objectRenderer.js.map +1 -1
  359. package/Rendering/outlineRenderer.pure.js +6 -2
  360. package/Rendering/outlineRenderer.pure.js.map +1 -1
  361. package/Rendering/renderingManager.d.ts +1 -1
  362. package/Rendering/renderingManager.js +5 -4
  363. package/Rendering/renderingManager.js.map +1 -1
  364. package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  365. package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
  366. package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  367. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
  368. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  369. package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
  370. package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
  371. package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  372. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
  373. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
  374. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
  375. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  376. package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
  377. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  378. package/Shaders/ShadersInclude/pbrDebug.js +6 -2
  379. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  380. package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
  381. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  382. package/Shaders/default.fragment.js +31 -40
  383. package/Shaders/default.fragment.js.map +1 -1
  384. package/Shaders/depthOfField.fragment.js +13 -9
  385. package/Shaders/depthOfField.fragment.js.map +1 -1
  386. package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
  387. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
  388. package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
  389. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
  390. package/Shaders/gaussianSplatting.fragment.js +63 -3
  391. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  392. package/Shaders/gaussianSplatting.vertex.js +80 -0
  393. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  394. package/Shaders/geometry.fragment.js +17 -11
  395. package/Shaders/geometry.fragment.js.map +1 -1
  396. package/Shaders/gpuRenderParticles.fragment.js +43 -1
  397. package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
  398. package/Shaders/gpuRenderParticles.vertex.js +96 -16
  399. package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
  400. package/Shaders/meshBlending.fragment.d.ts +5 -0
  401. package/Shaders/meshBlending.fragment.js +519 -0
  402. package/Shaders/meshBlending.fragment.js.map +1 -0
  403. package/Shaders/particles.fragment.js +43 -1
  404. package/Shaders/particles.fragment.js.map +1 -1
  405. package/Shaders/particles.vertex.js +84 -3
  406. package/Shaders/particles.vertex.js.map +1 -1
  407. package/Shaders/sprites.fragment.js +52 -2
  408. package/Shaders/sprites.fragment.js.map +1 -1
  409. package/Shaders/sprites.vertex.js +62 -1
  410. package/Shaders/sprites.vertex.js.map +1 -1
  411. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  412. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
  413. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  414. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
  415. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
  416. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  417. package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
  418. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  419. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
  420. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
  421. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
  422. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
  423. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
  424. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  425. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
  426. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
  427. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  428. package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
  429. package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
  430. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
  431. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  432. package/ShadersWGSL/default.fragment.js +17 -48
  433. package/ShadersWGSL/default.fragment.js.map +1 -1
  434. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
  435. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
  436. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
  437. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
  438. package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
  439. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  440. package/ShadersWGSL/gaussianSplatting.vertex.js +80 -0
  441. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  442. package/ShadersWGSL/geometry.fragment.js +37 -2
  443. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  444. package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
  445. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
  446. package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
  447. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
  448. package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
  449. package/ShadersWGSL/meshBlending.fragment.js +576 -0
  450. package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
  451. package/ShadersWGSL/openpbr.fragment.js +2 -1
  452. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  453. package/ShadersWGSL/particles.fragment.js +45 -1
  454. package/ShadersWGSL/particles.fragment.js.map +1 -1
  455. package/ShadersWGSL/particles.vertex.js +86 -4
  456. package/ShadersWGSL/particles.vertex.js.map +1 -1
  457. package/ShadersWGSL/pbr.fragment.js +2 -1
  458. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  459. package/ShadersWGSL/sprites.fragment.js +56 -2
  460. package/ShadersWGSL/sprites.fragment.js.map +1 -1
  461. package/ShadersWGSL/sprites.vertex.js +62 -1
  462. package/ShadersWGSL/sprites.vertex.js.map +1 -1
  463. package/Sprites/spriteManager.d.ts +13 -0
  464. package/Sprites/spriteManager.js +15 -0
  465. package/Sprites/spriteManager.js.map +1 -1
  466. package/Sprites/spriteRenderer.d.ts +24 -1
  467. package/Sprites/spriteRenderer.js +368 -50
  468. package/Sprites/spriteRenderer.js.map +1 -1
  469. package/Sprites/thinSprite.d.ts +4 -0
  470. package/Sprites/thinSprite.js +4 -0
  471. package/Sprites/thinSprite.js.map +1 -1
  472. package/States/alphaCullingState.d.ts +3 -1
  473. package/States/alphaCullingState.js +18 -3
  474. package/States/alphaCullingState.js.map +1 -1
  475. package/XR/webXRDefaultExperience.d.ts +5 -1
  476. package/XR/webXRDefaultExperience.js.map +1 -1
  477. package/XR/webXREnterExitUI.d.ts +2 -1
  478. package/XR/webXREnterExitUI.js.map +1 -1
  479. package/package.json +1 -1
  480. package/scene.pure.d.ts +23 -0
  481. package/scene.pure.js +35 -0
  482. package/scene.pure.js.map +1 -1
@@ -7,6 +7,8 @@ export declare class WebGPUSnapshotRendering {
7
7
  private _play;
8
8
  private _playBundleListIndex;
9
9
  private _allBundleLists;
10
+ private _recordingInvalidated;
11
+ private _skipNextRenderPass;
10
12
  private _modeSaved;
11
13
  private _bundleList;
12
14
  private _enabled;
@@ -19,6 +21,8 @@ export declare class WebGPUSnapshotRendering {
19
21
  set enabled(activate: boolean);
20
22
  get mode(): number;
21
23
  set mode(mode: number);
24
+ /** @internal */
25
+ handleRenderPassRestart(): void;
22
26
  endRenderPass(currentRenderPass: GPURenderPassEncoder): boolean;
23
27
  endFrame(): void;
24
28
  reset(): void;
@@ -7,6 +7,8 @@ export class WebGPUSnapshotRendering {
7
7
  this._play = false;
8
8
  this._playBundleListIndex = 0;
9
9
  this._allBundleLists = [];
10
+ this._recordingInvalidated = false;
11
+ this._skipNextRenderPass = false;
10
12
  this._enabled = false;
11
13
  this.showDebugLogs = false;
12
14
  this._engine = engine;
@@ -25,6 +27,8 @@ export class WebGPUSnapshotRendering {
25
27
  set enabled(activate) {
26
28
  this._log("enabled", `activate=${activate}, mode=${this._mode}`);
27
29
  this._allBundleLists.length = 0;
30
+ this._recordingInvalidated = false;
31
+ this._skipNextRenderPass = false;
28
32
  if (this._record) {
29
33
  // A recording pass is in flight: _mode is temporarily SNAPSHOTRENDERING_STANDARD and is normally
30
34
  // restored to _modeSaved at the next endFrame(). Restore it now so that flipping _record off
@@ -50,6 +54,19 @@ export class WebGPUSnapshotRendering {
50
54
  this._mode = mode;
51
55
  }
52
56
  }
57
+ /** @internal */
58
+ handleRenderPassRestart() {
59
+ if (!this._record) {
60
+ return;
61
+ }
62
+ if (this._bundleList.isEmpty) {
63
+ this._skipNextRenderPass = true;
64
+ }
65
+ else {
66
+ this._allBundleLists.length = 0;
67
+ this._recordingInvalidated = true;
68
+ }
69
+ }
53
70
  endRenderPass(currentRenderPass) {
54
71
  if (!this._record && !this._play) {
55
72
  // Snapshot rendering mode is not enabled
@@ -58,9 +75,18 @@ export class WebGPUSnapshotRendering {
58
75
  let bundleList = null;
59
76
  if (this._record) {
60
77
  bundleList = this._bundleList.clone();
61
- this._allBundleLists.push(bundleList);
62
78
  this._bundleList.reset();
63
- this._log("endRenderPass", `bundleList recorded at position #${this._allBundleLists.length - 1}`);
79
+ if (this._skipNextRenderPass) {
80
+ this._skipNextRenderPass = false;
81
+ this._log("endRenderPass", "bundleList omitted for a restarted empty pass");
82
+ }
83
+ else if (this._recordingInvalidated) {
84
+ this._log("endRenderPass", "bundleList discarded from an invalidated recording");
85
+ }
86
+ else {
87
+ this._allBundleLists.push(bundleList);
88
+ this._log("endRenderPass", `bundleList recorded at position #${this._allBundleLists.length - 1}`);
89
+ }
64
90
  }
65
91
  else {
66
92
  // We are playing the snapshot
@@ -82,11 +108,18 @@ export class WebGPUSnapshotRendering {
82
108
  }
83
109
  endFrame() {
84
110
  if (this._record) {
85
- // We stop recording and switch to replay mode for the next frames
86
- this._record = false;
87
- this._play = true;
88
- this._mode = this._modeSaved;
89
- this._log("endFrame", "bundles recorded, switching to play mode");
111
+ if (this._recordingInvalidated) {
112
+ this._recordingInvalidated = false;
113
+ this._allBundleLists.length = 0;
114
+ this._log("endFrame", "recording invalidated, recording the next frame");
115
+ }
116
+ else {
117
+ // We stop recording and switch to replay mode for the next frames
118
+ this._record = false;
119
+ this._play = true;
120
+ this._mode = this._modeSaved;
121
+ this._log("endFrame", "bundles recorded, switching to play mode");
122
+ }
90
123
  }
91
124
  this._playBundleListIndex = 0;
92
125
  }
@@ -1 +1 @@
1
- {"version":3,"file":"webgpuSnapshotRendering.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuSnapshotRendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,gBAAgB;AAChB,MAAM,OAAO,uBAAuB;IAahC,YAAY,MAAoB,EAAE,aAAqB,EAAE,UAA4B;QAV7E,YAAO,GAAG,KAAK,CAAC;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I,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,sBAAsB,EAAE,CAAC;gBAClD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YAC1D,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,QAAQ;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,kEAAkE;YAClE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,0CAA0C,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAEO,IAAI,CAAC,QAAgB,EAAE,OAAe;QAC1C,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,OAAO,6BAA6B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;QACpG,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { type Nullable } from \"core/types\";\r\nimport { Constants } from \"../constants\";\r\nimport { type WebGPUEngine } from \"../webgpuEngine\";\r\nimport { type WebGPUBundleList } from \"./webgpuBundleList\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/** @internal */\r\nexport class WebGPUSnapshotRendering {\r\n private _engine: WebGPUEngine;\r\n\r\n private _record = false;\r\n private _play = false;\r\n private _playBundleListIndex = 0;\r\n private _allBundleLists: WebGPUBundleList[] = [];\r\n private _modeSaved: number;\r\n private _bundleList: WebGPUBundleList;\r\n\r\n private _enabled = false;\r\n private _mode: number;\r\n\r\n constructor(engine: WebGPUEngine, renderingMode: number, bundleList: WebGPUBundleList) {\r\n this._engine = engine;\r\n this._mode = renderingMode;\r\n this._bundleList = bundleList;\r\n }\r\n\r\n public showDebugLogs = false;\r\n\r\n public get enabled(): boolean {\r\n return this._enabled;\r\n }\r\n\r\n public get play() {\r\n return this._play;\r\n }\r\n\r\n public get record() {\r\n return this._record;\r\n }\r\n\r\n public set enabled(activate: boolean) {\r\n this._log(\"enabled\", `activate=${activate}, mode=${this._mode}`);\r\n\r\n this._allBundleLists.length = 0;\r\n if (this._record) {\r\n // A recording pass is in flight: _mode is temporarily SNAPSHOTRENDERING_STANDARD and is normally\r\n // restored to _modeSaved at the next endFrame(). Restore it now so that flipping _record off\r\n // doesn't leave _mode stuck on STANDARD — otherwise the next \"enabled = true\" would save STANDARD\r\n // as the user-requested mode and the engine would permanently fall back to STANDARD (forum #63365).\r\n this._mode = this._modeSaved;\r\n }\r\n this._record = this._enabled = activate;\r\n this._play = false;\r\n if (activate) {\r\n this._modeSaved = this._mode;\r\n this._mode = Constants.SNAPSHOTRENDERING_STANDARD; // need to reset to standard for the recording pass to avoid some code being bypassed\r\n }\r\n }\r\n\r\n public get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n public set mode(mode: number) {\r\n if (this._record) {\r\n this._modeSaved = mode;\r\n } else {\r\n this._mode = mode;\r\n }\r\n }\r\n\r\n public endRenderPass(currentRenderPass: GPURenderPassEncoder): boolean {\r\n if (!this._record && !this._play) {\r\n // Snapshot rendering mode is not enabled\r\n return false;\r\n }\r\n\r\n let bundleList: Nullable<WebGPUBundleList> = null;\r\n\r\n if (this._record) {\r\n bundleList = this._bundleList.clone();\r\n this._allBundleLists.push(bundleList);\r\n this._bundleList.reset();\r\n this._log(\"endRenderPass\", `bundleList recorded at position #${this._allBundleLists.length - 1}`);\r\n } else {\r\n // We are playing the snapshot\r\n if (this._playBundleListIndex >= this._allBundleLists.length) {\r\n this._log(\r\n \"endRenderPass\",\r\n `empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`\r\n );\r\n } else {\r\n this._log(\"endRenderPass\", `run bundleList #${this._playBundleListIndex}`);\r\n bundleList = this._allBundleLists[this._playBundleListIndex++];\r\n }\r\n }\r\n\r\n if (bundleList) {\r\n bundleList.run(currentRenderPass);\r\n\r\n if (this._mode === Constants.SNAPSHOTRENDERING_FAST) {\r\n this._engine._reportDrawCall(bundleList.numDrawCalls);\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public endFrame(): void {\r\n if (this._record) {\r\n // We stop recording and switch to replay mode for the next frames\r\n this._record = false;\r\n this._play = true;\r\n this._mode = this._modeSaved;\r\n this._log(\"endFrame\", \"bundles recorded, switching to play mode\");\r\n }\r\n\r\n this._playBundleListIndex = 0;\r\n }\r\n\r\n public reset(): void {\r\n this._log(\"reset\", \"called\");\r\n this.enabled = false;\r\n this.enabled = true;\r\n }\r\n\r\n private _log(funcName: string, message: string) {\r\n if (this.showDebugLogs) {\r\n Logger.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${funcName} - ${message}`);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"webgpuSnapshotRendering.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuSnapshotRendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,gBAAgB;AAChB,MAAM,OAAO,uBAAuB;IAehC,YAAY,MAAoB,EAAE,aAAqB,EAAE,UAA4B;QAZ7E,YAAO,GAAG,KAAK,CAAC;QAChB,UAAK,GAAG,KAAK,CAAC;QACd,yBAAoB,GAAG,CAAC,CAAC;QACzB,oBAAe,GAAuB,EAAE,CAAC;QACzC,0BAA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AAG,KAAK,CAAC;gBACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC;gBAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,0CAA0C,CAAC,CAAC;YACtE,CAAC;QACL,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;IAClC,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAEO,IAAI,CAAC,QAAgB,EAAE,OAAe;QAC1C,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,OAAO,6BAA6B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;QACpG,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { type Nullable } from \"core/types\";\r\nimport { Constants } from \"../constants\";\r\nimport { type WebGPUEngine } from \"../webgpuEngine\";\r\nimport { type WebGPUBundleList } from \"./webgpuBundleList\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/** @internal */\r\nexport class WebGPUSnapshotRendering {\r\n private _engine: WebGPUEngine;\r\n\r\n private _record = false;\r\n private _play = false;\r\n private _playBundleListIndex = 0;\r\n private _allBundleLists: WebGPUBundleList[] = [];\r\n private _recordingInvalidated = false;\r\n private _skipNextRenderPass = false;\r\n private _modeSaved: number;\r\n private _bundleList: WebGPUBundleList;\r\n\r\n private _enabled = false;\r\n private _mode: number;\r\n\r\n constructor(engine: WebGPUEngine, renderingMode: number, bundleList: WebGPUBundleList) {\r\n this._engine = engine;\r\n this._mode = renderingMode;\r\n this._bundleList = bundleList;\r\n }\r\n\r\n public showDebugLogs = false;\r\n\r\n public get enabled(): boolean {\r\n return this._enabled;\r\n }\r\n\r\n public get play() {\r\n return this._play;\r\n }\r\n\r\n public get record() {\r\n return this._record;\r\n }\r\n\r\n public set enabled(activate: boolean) {\r\n this._log(\"enabled\", `activate=${activate}, mode=${this._mode}`);\r\n\r\n this._allBundleLists.length = 0;\r\n this._recordingInvalidated = false;\r\n this._skipNextRenderPass = false;\r\n if (this._record) {\r\n // A recording pass is in flight: _mode is temporarily SNAPSHOTRENDERING_STANDARD and is normally\r\n // restored to _modeSaved at the next endFrame(). Restore it now so that flipping _record off\r\n // doesn't leave _mode stuck on STANDARD — otherwise the next \"enabled = true\" would save STANDARD\r\n // as the user-requested mode and the engine would permanently fall back to STANDARD (forum #63365).\r\n this._mode = this._modeSaved;\r\n }\r\n this._record = this._enabled = activate;\r\n this._play = false;\r\n if (activate) {\r\n this._modeSaved = this._mode;\r\n this._mode = Constants.SNAPSHOTRENDERING_STANDARD; // need to reset to standard for the recording pass to avoid some code being bypassed\r\n }\r\n }\r\n\r\n public get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n public set mode(mode: number) {\r\n if (this._record) {\r\n this._modeSaved = mode;\r\n } else {\r\n this._mode = mode;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public handleRenderPassRestart(): void {\r\n if (!this._record) {\r\n return;\r\n }\r\n\r\n if (this._bundleList.isEmpty) {\r\n this._skipNextRenderPass = true;\r\n } else {\r\n this._allBundleLists.length = 0;\r\n this._recordingInvalidated = true;\r\n }\r\n }\r\n\r\n public endRenderPass(currentRenderPass: GPURenderPassEncoder): boolean {\r\n if (!this._record && !this._play) {\r\n // Snapshot rendering mode is not enabled\r\n return false;\r\n }\r\n\r\n let bundleList: Nullable<WebGPUBundleList> = null;\r\n\r\n if (this._record) {\r\n bundleList = this._bundleList.clone();\r\n this._bundleList.reset();\r\n if (this._skipNextRenderPass) {\r\n this._skipNextRenderPass = false;\r\n this._log(\"endRenderPass\", \"bundleList omitted for a restarted empty pass\");\r\n } else if (this._recordingInvalidated) {\r\n this._log(\"endRenderPass\", \"bundleList discarded from an invalidated recording\");\r\n } else {\r\n this._allBundleLists.push(bundleList);\r\n this._log(\"endRenderPass\", `bundleList recorded at position #${this._allBundleLists.length - 1}`);\r\n }\r\n } else {\r\n // We are playing the snapshot\r\n if (this._playBundleListIndex >= this._allBundleLists.length) {\r\n this._log(\r\n \"endRenderPass\",\r\n `empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`\r\n );\r\n } else {\r\n this._log(\"endRenderPass\", `run bundleList #${this._playBundleListIndex}`);\r\n bundleList = this._allBundleLists[this._playBundleListIndex++];\r\n }\r\n }\r\n\r\n if (bundleList) {\r\n bundleList.run(currentRenderPass);\r\n\r\n if (this._mode === Constants.SNAPSHOTRENDERING_FAST) {\r\n this._engine._reportDrawCall(bundleList.numDrawCalls);\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public endFrame(): void {\r\n if (this._record) {\r\n if (this._recordingInvalidated) {\r\n this._recordingInvalidated = false;\r\n this._allBundleLists.length = 0;\r\n this._log(\"endFrame\", \"recording invalidated, recording the next frame\");\r\n } else {\r\n // We stop recording and switch to replay mode for the next frames\r\n this._record = false;\r\n this._play = true;\r\n this._mode = this._modeSaved;\r\n this._log(\"endFrame\", \"bundles recorded, switching to play mode\");\r\n }\r\n }\r\n\r\n this._playBundleListIndex = 0;\r\n }\r\n\r\n public reset(): void {\r\n this._log(\"reset\", \"called\");\r\n this.enabled = false;\r\n this.enabled = true;\r\n }\r\n\r\n private _log(funcName: string, message: string) {\r\n if (this.showDebugLogs) {\r\n Logger.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${funcName} - ${message}`);\r\n }\r\n }\r\n}\r\n"]}
@@ -2,7 +2,7 @@ import { type InternalTexture } from "../../Materials/Textures/internalTexture.j
2
2
  import { type IHardwareTextureWrapper } from "../../Materials/Textures/hardwareTextureWrapper.js";
3
3
  /** @internal */
4
4
  export declare class WebGPUTextureHelper {
5
- static ComputeNumMipmapLevels(width: number, height: number): number;
5
+ static ComputeNumMipmapLevels(width: number, height: number, depth?: number): number;
6
6
  static GetTextureTypeFromFormat(format: GPUTextureFormat): number;
7
7
  static GetBlockInformationFromFormat(format: GPUTextureFormat): {
8
8
  width: number;
@@ -2,8 +2,8 @@ import { ILog2 } from "../../Maths/math.scalar.functions.js";
2
2
 
3
3
  /** @internal */
4
4
  export class WebGPUTextureHelper {
5
- static ComputeNumMipmapLevels(width, height) {
6
- return ILog2(Math.max(width, height)) + 1;
5
+ static ComputeNumMipmapLevels(width, height, depth = 1) {
6
+ return ILog2(Math.max(width, height, depth)) + 1;
7
7
  }
8
8
  static GetTextureTypeFromFormat(format) {
9
9
  switch (format) {
@@ -1 +1 @@
1
- {"version":3,"file":"webgpuTextureHelper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuTextureHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACrB,MAAM,CAAC,sBAAsB,CAAC,KAAa,EAAE,MAAc;QAC9D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,MAAwB;QAC3D,QAAQ,MAAM,EAAE,CAAC;YACb,kCAAkC;YAClC,2DAA2C;YAC3C,yDAA0C;YAC1C,6DAA4C;YAC5C,2DAA2C;YAC3C,iEAA8C;YAC9C,0EAAkD;YAClD,+DAA6C;YAC7C,iEAA8C;YAC9C,0EAAkD;YAClD,mEAA+C,CAAC,4CAA4C;YAC5F,qEAAgD,CAAC,4CAA4C;YAC7F,qEAAgD,CAAC,4CAA4C;YAC7F,uEAAiD,CAAC,4CAA4C;YAC9F,u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AC;YACb,6DAA4C;YAC5C,sFAAwD;YACxD;gBACI,OAAO,IAAI,CAAC;QACpB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,MAAwB;QACjD,QAAQ,MAAM,EAAE,CAAC;YACb,qEAAgD;YAChD,mEAA+C;YAC/C,oFAAuD;YACvD,qEAAgD;YAChD;gBACI,OAAO,IAAI,CAAC;QACpB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,MAAwB;QAC5D,QAAQ,MAAM,EAAE,CAAC;YACb,sFAAwD;YACxD;gBACI,OAAO,IAAI,CAAC;QACpB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,MAAwB;QACrD,QAAQ,MAAM,EAAE,CAAC;YACb;gBACI,uEAAkD;YACtD;gBACI,qEAAiD;YACrD;gBACI,qEAAiD;YACrD;gBACI,uEAAkD;YACtD;gBACI,uEAAkD;QAC1D,CAAC;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 { ILog2 } from \"../../Maths/math.scalar.functions\";\r\nimport { Constants } from \"../constants\";\r\nimport { type InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { type IHardwareTextureWrapper } 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 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 unsigned\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\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.BC5RGUnorm:\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.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.EACRG11Unorm:\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 = 8 bits signed\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return Constants.TEXTURETYPE_BYTE;\r\n\r\n // One component = 16 bits unsigned\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n\r\n // One component = 16 bits signed\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n return Constants.TEXTURETYPE_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 unsigned\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n\r\n // One component = 32 bits signed\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\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.R16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\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.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\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 case WebGPUConstants.TextureFormat.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\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: IHardwareTextureWrapper | GPUTexture): texture is IHardwareTextureWrapper {\r\n return !!(texture as IHardwareTextureWrapper).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_RGBA_ASTC_5x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC5x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_5x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC5x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_6x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC6x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_6x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC6x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x8:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x8:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x10:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x10Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_12x10:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB : WebGPUConstants.TextureFormat.ASTC12x10Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_12x12:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB : WebGPUConstants.TextureFormat.ASTC12x12Unorm;\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.R16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\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.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\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.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\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 HasDepthAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\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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,EAAE,CAAC;YACb;gBACI,uEAAkD;YACtD;gBACI,qEAAiD;YACrD;gBACI,qEAAiD;YACrD;gBACI,uEAAkD;YACtD;gBACI,uEAAkD;QAC1D,CAAC;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 { ILog2 } from \"../../Maths/math.scalar.functions\";\r\nimport { Constants } from \"../constants\";\r\nimport { type InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { type IHardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\n\r\n/** @internal */\r\nexport class WebGPUTextureHelper {\r\n public static ComputeNumMipmapLevels(width: number, height: number, depth = 1) {\r\n return ILog2(Math.max(width, height, depth)) + 1;\r\n }\r\n\r\n public static GetTextureTypeFromFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n // One Component = 8 bits unsigned\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\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.BC5RGUnorm:\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.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.EACRG11Unorm:\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 = 8 bits signed\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return Constants.TEXTURETYPE_BYTE;\r\n\r\n // One component = 16 bits unsigned\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n\r\n // One component = 16 bits signed\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n return Constants.TEXTURETYPE_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 unsigned\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n\r\n // One component = 32 bits signed\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\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.R16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\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.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\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 case WebGPUConstants.TextureFormat.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\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: IHardwareTextureWrapper | GPUTexture): texture is IHardwareTextureWrapper {\r\n return !!(texture as IHardwareTextureWrapper).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_RGBA_ASTC_5x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC5x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_5x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC5x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_6x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC6x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_6x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC6x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_8x8:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB : WebGPUConstants.TextureFormat.ASTC8x8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x5Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x6:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x6Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x8:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_10x10:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB : WebGPUConstants.TextureFormat.ASTC10x10Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_12x10:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB : WebGPUConstants.TextureFormat.ASTC12x10Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_12x12:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB : WebGPUConstants.TextureFormat.ASTC12x12Unorm;\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.R16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Snorm:\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.RG16Unorm:\r\n case WebGPUConstants.TextureFormat.RG16Snorm:\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.RGBA16Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA16Snorm:\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 HasDepthAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\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"]}
@@ -17,6 +17,7 @@ export declare class WebGPUTextureManager {
17
17
  private _device;
18
18
  private _bufferManager;
19
19
  private _mipmapSampler;
20
+ private _mipmap3DSampler;
20
21
  private _videoSampler;
21
22
  private _ubCopyWithOfst;
22
23
  private _pipelines;
@@ -43,6 +44,7 @@ export declare class WebGPUTextureManager {
43
44
  }, hasMipmaps?: boolean, generateMipmaps?: boolean, invertY?: boolean, premultiplyAlpha?: boolean, format?: GPUTextureFormat, sampleCount?: number, commandEncoder?: GPUCommandEncoder, usage?: number, additionalUsages?: number, label?: string): GPUTexture;
44
45
  generateCubeMipmaps(gpuOrHdwTexture: GPUTexture | WebGPUHardwareTexture, mipLevelCount: number, commandEncoder?: GPUCommandEncoder): void;
45
46
  generateMipmaps(gpuOrHdwTexture: GPUTexture | WebGPUHardwareTexture, mipLevelCount: number, faceIndex?: number, commandEncoder?: GPUCommandEncoder): void;
47
+ generate3DMipmaps(gpuOrHdwTexture: GPUTexture | WebGPUHardwareTexture, mipLevelCount: number, commandEncoder?: GPUCommandEncoder): void;
46
48
  createGPUTextureForInternalTexture(texture: InternalTexture, width?: number, height?: number, depth?: number, creationFlags?: number): WebGPUHardwareTexture;
47
49
  createMSAATexture(gpuTexture: GPUTexture, format: GPUTextureFormat, samples: number): GPUTexture;
48
50
  resolveMSAADepthTexture(msaaTexture: GPUTexture, outputTexture: GPUTexture, commandEncoder?: GPUCommandEncoder): void;