@babylonjs/core 7.31.2 → 7.32.1
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.
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Cameras/camera.d.ts +5 -2
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +9 -1
- package/Decorators/nodeDecorator.js +8 -0
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +40 -53
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +20 -8
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.js +16 -7
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +43 -44
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +8 -6
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -3
- package/Engines/WebGPU/webgpuHardwareTexture.js +12 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +25 -19
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +5 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +6 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +6 -1
- package/Engines/constants.js +6 -1
- package/Engines/constants.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +7 -0
- package/Engines/renderTargetWrapper.js +15 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +3 -1
- package/Engines/webgpuEngine.js +9 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +62 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +171 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +51 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +127 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +67 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +187 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +232 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.d.ts +41 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +79 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +119 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +451 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +63 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +154 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.d.ts +59 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js +131 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.d.ts +49 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js +107 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +50 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +125 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +71 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +59 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/elbowBlock.d.ts +28 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js +47 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +17 -0
- package/FrameGraph/Node/Blocks/index.js +18 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -0
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +94 -0
- package/FrameGraph/Node/Blocks/inputBlock.js +270 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/outputBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/outputBlock.js +51 -0
- package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +110 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +78 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraph.d.ts +196 -0
- package/FrameGraph/Node/nodeRenderGraph.js +614 -0
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +190 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +495 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +143 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +275 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js +35 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -0
- package/FrameGraph/Passes/cullPass.d.ts +28 -0
- package/FrameGraph/Passes/cullPass.js +38 -0
- package/FrameGraph/Passes/cullPass.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +14 -0
- package/FrameGraph/Passes/pass.js +20 -0
- package/FrameGraph/Passes/pass.js.map +1 -0
- package/FrameGraph/Passes/renderPass.d.ts +49 -0
- package/FrameGraph/Passes/renderPass.js +72 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +21 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +54 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +114 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +24 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +30 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +35 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +26 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +29 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +65 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +134 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +41 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +64 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +28 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js +52 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +145 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +259 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +66 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +127 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +34 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +42 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +12 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +23 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +26 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +31 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +22 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +34 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +143 -0
- package/FrameGraph/frameGraph.js +275 -0
- package/FrameGraph/frameGraph.js.map +1 -0
- package/FrameGraph/frameGraphContext.d.ts +5 -0
- package/FrameGraph/frameGraphContext.js +6 -0
- package/FrameGraph/frameGraphContext.js.map +1 -0
- package/FrameGraph/frameGraphObjectList.d.ts +15 -0
- package/FrameGraph/frameGraphObjectList.js +7 -0
- package/FrameGraph/frameGraphObjectList.js.map +1 -0
- package/FrameGraph/frameGraphRenderContext.d.ts +110 -0
- package/FrameGraph/frameGraphRenderContext.js +237 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -0
- package/FrameGraph/frameGraphTask.d.ts +49 -0
- package/FrameGraph/frameGraphTask.js +117 -0
- package/FrameGraph/frameGraphTask.js.map +1 -0
- package/FrameGraph/frameGraphTextureManager.d.ts +50 -0
- package/FrameGraph/frameGraphTextureManager.js +277 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -0
- package/FrameGraph/frameGraphTypes.d.ts +59 -0
- package/FrameGraph/frameGraphTypes.js +9 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -0
- package/FrameGraph/index.d.ts +28 -0
- package/FrameGraph/index.js +30 -0
- package/FrameGraph/index.js.map +1 -0
- package/Gamepads/gamepadSceneComponent.d.ts +0 -1
- package/Gamepads/gamepadSceneComponent.js +1 -7
- package/Gamepads/gamepadSceneComponent.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +7 -0
- package/Gizmos/boundingBoxGizmo.js +19 -6
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +3 -1
- package/Inputs/scene.inputManager.js +20 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/layer.d.ts +1 -1
- package/Layers/layer.js +1 -1
- package/Layers/layer.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
- package/Materials/PBR/pbrBaseMaterial.js +8 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +32 -2
- package/Materials/Textures/dynamicTexture.js +13 -18
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +20 -8
- package/Materials/Textures/multiRenderTarget.js +2 -0
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +8 -1
- package/Materials/Textures/renderTargetTexture.js +28 -10
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +20 -2
- package/Materials/Textures/textureCreationOptions.js +20 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/effectRenderer.d.ts +132 -14
- package/Materials/effectRenderer.js +229 -33
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.functions.js +2 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +122 -0
- package/Materials/materialHelper.geometryrendering.js +259 -0
- package/Materials/materialHelper.geometryrendering.js.map +1 -0
- package/Materials/standardMaterial.d.ts +4 -0
- package/Materials/standardMaterial.js +8 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +22 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +39 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +3 -2
- package/Misc/copyTextureToTexture.js +11 -5
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +5 -3
- package/PostProcesses/blackAndWhitePostProcess.js +24 -19
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.d.ts +7 -5
- package/PostProcesses/bloomEffect.js +49 -23
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.d.ts +5 -5
- package/PostProcesses/bloomMergePostProcess.js +28 -19
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +7 -43
- package/PostProcesses/blurPostProcess.js +47 -185
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.d.ts +13 -6
- package/PostProcesses/circleOfConfusionPostProcess.js +59 -38
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -6
- package/PostProcesses/depthOfFieldBlurPostProcess.js +14 -11
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +5 -2
- package/PostProcesses/depthOfFieldEffect.js +53 -45
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +18 -12
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.d.ts +8 -4
- package/PostProcesses/extractHighlightsPostProcess.js +35 -22
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +6 -0
- package/PostProcesses/index.js +6 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +15 -70
- package/PostProcesses/postProcess.js +80 -97
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +28 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js +50 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -0
- package/PostProcesses/thinBloomEffect.d.ts +49 -0
- package/PostProcesses/thinBloomEffect.js +59 -0
- package/PostProcesses/thinBloomEffect.js.map +1 -0
- package/PostProcesses/thinBloomMergePostProcess.d.ts +15 -0
- package/PostProcesses/thinBloomMergePostProcess.js +38 -0
- package/PostProcesses/thinBloomMergePostProcess.js.map +1 -0
- package/PostProcesses/thinBlurPostProcess.d.ts +89 -0
- package/PostProcesses/thinBlurPostProcess.js +242 -0
- package/PostProcesses/thinBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +62 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js +81 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.d.ts +8 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js +13 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldEffect.d.ts +70 -0
- package/PostProcesses/thinDepthOfFieldEffect.js +115 -0
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +11 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js +30 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +30 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js +55 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -0
- package/Rendering/depthPeelingRenderer.js +2 -2
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +4 -4
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +75 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/prePassVertex.js +1 -2
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +9 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/colorCorrection.fragment.js +1 -0
- package/Shaders/colorCorrection.fragment.js.map +1 -1
- package/Shaders/default.fragment.js +17 -25
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +4 -6
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.d.ts +1 -0
- package/Shaders/pbr.fragment.js +2 -74
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +3 -3
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +100 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +1 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/background.vertex.js +1 -1
- package/ShadersWGSL/background.vertex.js.map +1 -1
- package/ShadersWGSL/circleOfConfusion.fragment.js +10 -2
- package/ShadersWGSL/circleOfConfusion.fragment.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +20 -31
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +4 -5
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.d.ts +1 -0
- package/ShadersWGSL/pbr.fragment.js +2 -100
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +4 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +19 -2
- package/scene.js +110 -13
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +0 -1
- package/sceneComponent.js +0 -1
- package/sceneComponent.js.map +1 -1
- package/types.d.ts +12 -0
- package/types.js.map +1 -1
|
@@ -7,20 +7,14 @@ export class WebGPUTextureHelper {
|
|
|
7
7
|
}
|
|
8
8
|
static GetTextureTypeFromFormat(format) {
|
|
9
9
|
switch (format) {
|
|
10
|
-
// One Component = 8 bits
|
|
10
|
+
// One Component = 8 bits unsigned
|
|
11
11
|
case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
|
|
12
|
-
case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
|
|
13
12
|
case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
|
|
14
|
-
case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
|
|
15
13
|
case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
|
|
16
|
-
case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
|
|
17
14
|
case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
|
|
18
|
-
case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
|
|
19
15
|
case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
|
|
20
16
|
case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
|
|
21
|
-
case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
|
|
22
17
|
case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
|
|
23
|
-
case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
|
|
24
18
|
case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
|
|
25
19
|
case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
|
|
26
20
|
case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */: // composite format - let's say it's byte...
|
|
@@ -30,15 +24,12 @@ export class WebGPUTextureHelper {
|
|
|
30
24
|
case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
|
|
31
25
|
case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
|
|
32
26
|
case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
|
|
33
|
-
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
34
27
|
case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
|
|
35
|
-
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
36
28
|
case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
|
|
37
29
|
case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
|
|
38
30
|
case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
|
|
39
31
|
case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
|
|
40
32
|
case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
|
|
41
|
-
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
42
33
|
case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
|
|
43
34
|
case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
|
|
44
35
|
case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
|
|
@@ -48,9 +39,7 @@ export class WebGPUTextureHelper {
|
|
|
48
39
|
case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
|
|
49
40
|
case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
|
|
50
41
|
case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
|
|
51
|
-
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
52
42
|
case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
|
|
53
|
-
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
54
43
|
case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
|
|
55
44
|
case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
|
|
56
45
|
case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
|
|
@@ -81,25 +70,42 @@ export class WebGPUTextureHelper {
|
|
|
81
70
|
case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
|
|
82
71
|
case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
|
|
83
72
|
return 0;
|
|
84
|
-
// One
|
|
73
|
+
// One Component = 8 bits signed
|
|
74
|
+
case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
|
|
75
|
+
case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
|
|
76
|
+
case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
|
|
77
|
+
case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
|
|
78
|
+
case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
|
|
79
|
+
case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
|
|
80
|
+
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
81
|
+
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
82
|
+
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
83
|
+
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
84
|
+
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
85
|
+
return 3;
|
|
86
|
+
// One component = 16 bits unsigned
|
|
85
87
|
case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
|
|
86
|
-
case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
|
|
87
88
|
case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
|
|
88
|
-
case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
|
|
89
89
|
case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
|
|
90
|
-
case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
|
|
91
90
|
case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
|
|
92
91
|
return 5;
|
|
92
|
+
// One component = 16 bits signed
|
|
93
|
+
case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
|
|
94
|
+
case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
|
|
95
|
+
case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
|
|
96
|
+
return 4;
|
|
93
97
|
case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
|
|
94
98
|
case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
|
|
95
99
|
case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
|
|
96
100
|
return 2;
|
|
97
|
-
// One component = 32 bits
|
|
101
|
+
// One component = 32 bits unsigned
|
|
98
102
|
case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
|
|
99
|
-
case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
|
|
100
103
|
case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
|
|
101
|
-
case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
|
|
102
104
|
case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
|
|
105
|
+
return 7;
|
|
106
|
+
// One component = 32 bits signed
|
|
107
|
+
case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
|
|
108
|
+
case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
|
|
103
109
|
case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
|
|
104
110
|
return 7;
|
|
105
111
|
case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
|
|
@@ -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;QA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kBAAkB,CAAC,MAAwB;QACrD,QAAQ,MAAM,EAAE;YACZ;gBACI,uEAAkD;YACtD;gBACI,qEAAiD;YACrD;gBACI,qEAAiD;YACrD;gBACI,uEAAkD;YACtD;gBACI,uEAAkD;SACzD;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,WAAmB;QACvC,8BAA8B;QAC9B,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ","sourcesContent":["/* eslint-disable babylonjs/available */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\nimport { ILog2 } from \"../../Maths/math.scalar.functions\";\r\nimport { Constants } from \"../constants\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\n\r\n/** @internal */\r\nexport class WebGPUTextureHelper {\r\n public static ComputeNumMipmapLevels(width: number, height: number) {\r\n return ILog2(Math.max(width, height)) + 1;\r\n }\r\n\r\n public static GetTextureTypeFromFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n // One Component = 8 bits\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat: // composite format - let's say it's byte...\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n\r\n // One component = 16 bits\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return Constants.TEXTURETYPE_HALF_FLOAT;\r\n\r\n // One component = 32 bits\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return Constants.TEXTURETYPE_FLOAT;\r\n }\r\n\r\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n public static GetBlockInformationFromFormat(format: GPUTextureFormat): { width: number; height: number; length: number } {\r\n switch (format) {\r\n // 8 bits formats\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n return { width: 1, height: 1, length: 1 };\r\n\r\n // 16 bits formats\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n return { width: 1, height: 1, length: 2 };\r\n\r\n // 32 bits formats\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n return { width: 1, height: 1, length: 4 };\r\n\r\n // 64 bits formats\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return { width: 1, height: 1, length: 8 };\r\n\r\n // 128 bits formats\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n return { width: 1, height: 1, length: 16 };\r\n\r\n // Depth and stencil formats\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Stencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return { width: 1, height: 1, length: 2 };\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24Plus format!\";\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24PlusStencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return { width: 1, height: 1, length: 4 };\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return { width: 1, height: 1, length: 5 };\r\n\r\n // BC compressed formats usable if \"texture-compression-bc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n return { width: 5, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n return { width: 5, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n return { width: 6, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n return { width: 6, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n return { width: 8, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n return { width: 8, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n return { width: 8, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n return { width: 10, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n return { width: 10, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n return { width: 10, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n return { width: 10, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n return { width: 12, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return { width: 12, height: 12, length: 16 };\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n\r\n public static IsHardwareTexture(texture: HardwareTextureWrapper | GPUTexture): texture is HardwareTextureWrapper {\r\n return !!(texture as HardwareTextureWrapper).release;\r\n }\r\n\r\n public static IsInternalTexture(texture: InternalTexture | GPUTexture): texture is InternalTexture {\r\n return !!(texture as InternalTexture).dispose;\r\n }\r\n\r\n public static IsImageBitmap(imageBitmap: ImageBitmap | { width: number; height: number }): imageBitmap is ImageBitmap {\r\n return (imageBitmap as ImageBitmap).close !== undefined;\r\n }\r\n\r\n public static IsImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number; height: number }): imageBitmap is ImageBitmap[] {\r\n return Array.isArray(imageBitmap as ImageBitmap[]) && (imageBitmap as ImageBitmap[])[0].close !== undefined;\r\n }\r\n\r\n public static IsCompressedFormat(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetWebGPUTextureFormat(type: number, format: number, useSRGBBuffer = false): GPUTextureFormat {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth24PlusStencil8;\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth32FloatStencil8;\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Stencil8;\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC7RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBUFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC3RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC2RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC1RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC4x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGB8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGBA8Unorm;\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Snorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Snorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Snorm;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Unorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Unorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n case Constants.TEXTUREFORMAT_BGRA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BGRA8UnormSRGB : WebGPUConstants.TextureFormat.BGRA8Unorm;\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Uint;\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_ALPHA format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R32Float; // By default. Other possibility is R16Float.\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG32Float; // By default. Other possibility is RG16Float.\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA32Float; // By default. Other possibility is RGBA16Float.\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Float;\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R16Float;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG16Float;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGB10A2UINT;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n }\r\n }\r\n\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n\r\n public static GetNumChannelsFromWebGPUTextureFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return 1;\r\n\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return 2;\r\n\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n return 3;\r\n\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return 4;\r\n }\r\n\r\n // eslint-disable-next-line no-throw-literal\r\n throw `Unknown format ${format}!`;\r\n }\r\n\r\n public static HasStencilAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static HasDepthAndStencilAspects(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetDepthFormatOnly(format: GPUTextureFormat): GPUTextureFormat {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n }\r\n\r\n return format;\r\n }\r\n\r\n public static GetSample(sampleCount: number) {\r\n // WebGPU only supports 1 or 4\r\n return sampleCount > 1 ? 4 : 1;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"webgpuTextureHelper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGPU/webgpuTextureHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,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;YACZ,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,uEAAgD;YAChD,gFAAoD;YACpD,yEAAiD;YACjD,mEAA8C;YAC9C,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,iEAA6C;YAC7C,uEAAgD;YAChD,gFAAoD;YACpD,wEAAiD;YACjD,iFAAqD;YACrD,4EAAmD;YACnD,qFAAuD;YACvD,0EAAkD;YAClD,mFAAsD;YACtD,oEAA+C;YAC/C,sEAAgD;YAChD,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD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AAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,uEAAgD;YAChD,gFAAoD;YACpD,yEAAiD;YACjD,kFAAqD;YACrD,yEAAiD;YACjD,kFAAqD;YACrD,yEAAiD;YACjD,kFAAqD;YACrD,2EAAkD;YAClD,oFAAsD;YACtD,2EAAkD;YAClD,oFAAsD;YACtD,2EAAkD;YAClD;gBACI,OAAO,CAAC,CAAC;SAChB;QAED,4CAA4C;QAC5C,MAAM,kBAAkB,MAAM,GAAG,CAAC;IACtC,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,MAAwB;QACnD,QAAQ,MAAM,EAAE;YACZ,6DAA4C;YAC5C,sFAAwD;YACxD;gBACI,OAAO,IAAI,CAAC;SACnB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,MAAwB;QAC5D,QAAQ,MAAM,EAAE;YACZ,sFAAwD;YACxD;gBACI,OAAO,IAAI,CAAC;SACnB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,MAAwB;QACrD,QAAQ,MAAM,EAAE;YACZ;gBACI,uEAAkD;YACtD;gBACI,qEAAiD;YACrD;gBACI,qEAAiD;YACrD;gBACI,uEAAkD;YACtD;gBACI,uEAAkD;SACzD;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,WAAmB;QACvC,8BAA8B;QAC9B,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ","sourcesContent":["/* eslint-disable babylonjs/available */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\nimport { ILog2 } from \"../../Maths/math.scalar.functions\";\r\nimport { Constants } from \"../constants\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\n\r\n/** @internal */\r\nexport class WebGPUTextureHelper {\r\n public static ComputeNumMipmapLevels(width: number, height: number) {\r\n return 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.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.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.R16Float:\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n return { width: 1, height: 1, length: 2 };\r\n\r\n // 32 bits formats\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n return { width: 1, height: 1, length: 4 };\r\n\r\n // 64 bits formats\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n return { width: 1, height: 1, length: 8 };\r\n\r\n // 128 bits formats\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n return { width: 1, height: 1, length: 16 };\r\n\r\n // Depth and stencil formats\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Stencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return { width: 1, height: 1, length: 2 };\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24Plus format!\";\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"No fixed size for Depth24PlusStencil8 format!\";\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return { width: 1, height: 1, length: 4 };\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return { width: 1, height: 1, length: 5 };\r\n\r\n // BC compressed formats usable if \"texture-compression-bc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return { width: 4, height: 4, length: 8 };\r\n\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return { width: 4, height: 4, length: 16 };\r\n\r\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\r\n // supported by the device/user agent and enabled in requestDevice.\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n return { width: 4, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n return { width: 5, height: 4, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n return { width: 5, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n return { width: 6, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n return { width: 6, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n return { width: 8, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n return { width: 8, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n return { width: 8, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n return { width: 10, height: 5, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n return { width: 10, height: 6, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n return { width: 10, height: 8, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n return { width: 10, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n return { width: 12, height: 10, length: 16 };\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return { width: 12, height: 12, length: 16 };\r\n }\r\n\r\n return { width: 1, height: 1, length: 4 };\r\n }\r\n\r\n public static IsHardwareTexture(texture: HardwareTextureWrapper | GPUTexture): texture is HardwareTextureWrapper {\r\n return !!(texture as HardwareTextureWrapper).release;\r\n }\r\n\r\n public static IsInternalTexture(texture: InternalTexture | GPUTexture): texture is InternalTexture {\r\n return !!(texture as InternalTexture).dispose;\r\n }\r\n\r\n public static IsImageBitmap(imageBitmap: ImageBitmap | { width: number; height: number }): imageBitmap is ImageBitmap {\r\n return (imageBitmap as ImageBitmap).close !== undefined;\r\n }\r\n\r\n public static IsImageBitmapArray(imageBitmap: ImageBitmap[] | { width: number; height: number }): imageBitmap is ImageBitmap[] {\r\n return Array.isArray(imageBitmap as ImageBitmap[]) && (imageBitmap as ImageBitmap[])[0].close !== undefined;\r\n }\r\n\r\n public static IsCompressedFormat(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetWebGPUTextureFormat(type: number, format: number, useSRGBBuffer = false): GPUTextureFormat {\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_DEPTH16:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case Constants.TEXTUREFORMAT_DEPTH24:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth24PlusStencil8;\r\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Depth32FloatStencil8;\r\n case Constants.TEXTUREFORMAT_STENCIL8:\r\n return WebGPUConstants.TextureFormat.Stencil8;\r\n\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC7RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBUFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\r\n return WebGPUConstants.TextureFormat.BC6HRGBFloat;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC3RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC2RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC1RGBAUnorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC4x4Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGB8Unorm;\r\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGBA8Unorm;\r\n }\r\n\r\n switch (type) {\r\n case Constants.TEXTURETYPE_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Snorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Snorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Snorm;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R8Unorm;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG8Unorm;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n case Constants.TEXTUREFORMAT_BGRA:\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.BGRA8UnormSRGB : WebGPUConstants.TextureFormat.BGRA8Unorm;\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R8Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG8Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA8Uint;\r\n case Constants.TEXTUREFORMAT_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_ALPHA format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n case Constants.TEXTURETYPE_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R16Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG16Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Uint;\r\n }\r\n case Constants.TEXTURETYPE_INT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Sint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Sint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Sint;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED_INTEGER:\r\n return WebGPUConstants.TextureFormat.R32Uint;\r\n case Constants.TEXTUREFORMAT_RG_INTEGER:\r\n return WebGPUConstants.TextureFormat.RG32Uint;\r\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Uint;\r\n }\r\n case Constants.TEXTURETYPE_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R32Float; // By default. Other possibility is R16Float.\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG32Float; // By default. Other possibility is RG16Float.\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA32Float; // By default. Other possibility is RGBA16Float.\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA32Float;\r\n }\r\n case Constants.TEXTURETYPE_HALF_FLOAT:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RED:\r\n return WebGPUConstants.TextureFormat.R16Float;\r\n case Constants.TEXTUREFORMAT_RG:\r\n return WebGPUConstants.TextureFormat.RG16Float;\r\n case Constants.TEXTUREFORMAT_RGB:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGBA16Float;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RG11B10UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV\";\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB9E5UFloat;\r\n }\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU\";\r\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\r\n switch (format) {\r\n case Constants.TEXTUREFORMAT_RGBA:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\r\n return WebGPUConstants.TextureFormat.RGB10A2UINT;\r\n default:\r\n return WebGPUConstants.TextureFormat.RGB10A2Unorm;\r\n }\r\n }\r\n\r\n return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n }\r\n\r\n public static GetNumChannelsFromWebGPUTextureFormat(format: GPUTextureFormat): number {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.R8Unorm:\r\n case WebGPUConstants.TextureFormat.R8Snorm:\r\n case WebGPUConstants.TextureFormat.R8Uint:\r\n case WebGPUConstants.TextureFormat.R8Sint:\r\n case WebGPUConstants.TextureFormat.BC4RUnorm:\r\n case WebGPUConstants.TextureFormat.BC4RSnorm:\r\n case WebGPUConstants.TextureFormat.R16Uint:\r\n case WebGPUConstants.TextureFormat.R16Sint:\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n case WebGPUConstants.TextureFormat.R16Float:\r\n case WebGPUConstants.TextureFormat.R32Uint:\r\n case WebGPUConstants.TextureFormat.R32Sint:\r\n case WebGPUConstants.TextureFormat.R32Float:\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n case WebGPUConstants.TextureFormat.EACR11Unorm:\r\n case WebGPUConstants.TextureFormat.EACR11Snorm:\r\n return 1;\r\n\r\n case WebGPUConstants.TextureFormat.RG8Unorm:\r\n case WebGPUConstants.TextureFormat.RG8Snorm:\r\n case WebGPUConstants.TextureFormat.RG8Uint:\r\n case WebGPUConstants.TextureFormat.RG8Sint:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.BC5RGUnorm:\r\n case WebGPUConstants.TextureFormat.BC5RGSnorm:\r\n case WebGPUConstants.TextureFormat.RG16Uint:\r\n case WebGPUConstants.TextureFormat.RG16Sint:\r\n case WebGPUConstants.TextureFormat.RG16Float:\r\n case WebGPUConstants.TextureFormat.RG32Uint:\r\n case WebGPUConstants.TextureFormat.RG32Sint:\r\n case WebGPUConstants.TextureFormat.RG32Float:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n case WebGPUConstants.TextureFormat.EACRG11Unorm:\r\n case WebGPUConstants.TextureFormat.EACRG11Snorm:\r\n return 2;\r\n\r\n case WebGPUConstants.TextureFormat.RGB9E5UFloat:\r\n case WebGPUConstants.TextureFormat.RG11B10UFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBUFloat:\r\n case WebGPUConstants.TextureFormat.BC6HRGBFloat:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB:\r\n return 3;\r\n\r\n case WebGPUConstants.TextureFormat.RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA8Snorm:\r\n case WebGPUConstants.TextureFormat.RGBA8Uint:\r\n case WebGPUConstants.TextureFormat.RGBA8Sint:\r\n case WebGPUConstants.TextureFormat.BGRA8Unorm:\r\n case WebGPUConstants.TextureFormat.BGRA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGB10A2UINT:\r\n case WebGPUConstants.TextureFormat.RGB10A2Unorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnorm:\r\n case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB:\r\n case WebGPUConstants.TextureFormat.RGBA16Uint:\r\n case WebGPUConstants.TextureFormat.RGBA16Sint:\r\n case WebGPUConstants.TextureFormat.RGBA16Float:\r\n case WebGPUConstants.TextureFormat.RGBA32Uint:\r\n case WebGPUConstants.TextureFormat.RGBA32Sint:\r\n case WebGPUConstants.TextureFormat.RGBA32Float:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm:\r\n case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC4x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x4Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC5x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC6x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC8x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x5Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x6Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x8Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC10x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x10Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB:\r\n case WebGPUConstants.TextureFormat.ASTC12x12Unorm:\r\n case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB:\r\n return 4;\r\n }\r\n\r\n // eslint-disable-next-line no-throw-literal\r\n throw `Unknown format ${format}!`;\r\n }\r\n\r\n public static HasStencilAspect(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Stencil8:\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static HasDepthAndStencilAspects(format: GPUTextureFormat): boolean {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public static GetDepthFormatOnly(format: GPUTextureFormat): GPUTextureFormat {\r\n switch (format) {\r\n case WebGPUConstants.TextureFormat.Depth16Unorm:\r\n return WebGPUConstants.TextureFormat.Depth16Unorm;\r\n case WebGPUConstants.TextureFormat.Depth24Plus:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth24PlusStencil8:\r\n return WebGPUConstants.TextureFormat.Depth24Plus;\r\n case WebGPUConstants.TextureFormat.Depth32Float:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n case WebGPUConstants.TextureFormat.Depth32FloatStencil8:\r\n return WebGPUConstants.TextureFormat.Depth32Float;\r\n }\r\n\r\n return format;\r\n }\r\n\r\n public static GetSample(sampleCount: number) {\r\n // WebGPU only supports 1 or 4\r\n return sampleCount > 1 ? 4 : 1;\r\n }\r\n}\r\n"]}
|
|
@@ -43,7 +43,7 @@ export declare class WebGPUTextureManager {
|
|
|
43
43
|
}, hasMipmaps?: boolean, generateMipmaps?: boolean, invertY?: boolean, premultiplyAlpha?: boolean, format?: GPUTextureFormat, sampleCount?: number, commandEncoder?: GPUCommandEncoder, usage?: number, additionalUsages?: number, label?: string): GPUTexture;
|
|
44
44
|
generateCubeMipmaps(gpuTexture: GPUTexture | WebGPUHardwareTexture, format: GPUTextureFormat, mipLevelCount: number, commandEncoder?: GPUCommandEncoder): void;
|
|
45
45
|
generateMipmaps(gpuOrHdwTexture: GPUTexture | WebGPUHardwareTexture, format: GPUTextureFormat, mipLevelCount: number, faceIndex?: number, is3D?: boolean, commandEncoder?: GPUCommandEncoder): void;
|
|
46
|
-
createGPUTextureForInternalTexture(texture: InternalTexture, width?: number, height?: number, depth?: number, creationFlags?: number): WebGPUHardwareTexture;
|
|
46
|
+
createGPUTextureForInternalTexture(texture: InternalTexture, width?: number, height?: number, depth?: number, creationFlags?: number, dontCreateMSAATexture?: boolean): WebGPUHardwareTexture;
|
|
47
47
|
createMSAATexture(texture: InternalTexture, samples: number, releaseExisting?: boolean, index?: number): void;
|
|
48
48
|
updateCubeTextures(imageBitmaps: ImageBitmap[] | Uint8Array[], gpuTexture: GPUTexture, width: number, height: number, format: GPUTextureFormat, invertY?: boolean, premultiplyAlpha?: boolean, offsetX?: number, offsetY?: number): void;
|
|
49
49
|
updateTexture(imageBitmap: ImageBitmap | Uint8Array | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas, texture: GPUTexture | InternalTexture, width: number, height: number, layers: number, format: GPUTextureFormat, faceIndex?: number, mipLevel?: number, invertY?: boolean, premultiplyAlpha?: boolean, offsetX?: number, offsetY?: number, allowGPUOptimization?: boolean): void;
|
|
@@ -775,7 +775,7 @@ export class WebGPUTextureManager {
|
|
|
775
775
|
commandEncoder = null;
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
|
-
createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags) {
|
|
778
|
+
createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags, dontCreateMSAATexture) {
|
|
779
779
|
if (!texture._hardwareTexture) {
|
|
780
780
|
texture._hardwareTexture = new WebGPUHardwareTexture();
|
|
781
781
|
}
|
|
@@ -850,10 +850,12 @@ export class WebGPUTextureManager {
|
|
|
850
850
|
texture.width = texture.baseWidth = width;
|
|
851
851
|
texture.height = texture.baseHeight = height;
|
|
852
852
|
texture.depth = texture.baseDepth = depth;
|
|
853
|
-
|
|
853
|
+
if (!dontCreateMSAATexture) {
|
|
854
|
+
this.createMSAATexture(texture, texture.samples);
|
|
855
|
+
}
|
|
854
856
|
return gpuTextureWrapper;
|
|
855
857
|
}
|
|
856
|
-
createMSAATexture(texture, samples, releaseExisting = true, index =
|
|
858
|
+
createMSAATexture(texture, samples, releaseExisting = true, index = 0) {
|
|
857
859
|
const gpuTextureWrapper = texture._hardwareTexture;
|
|
858
860
|
if (releaseExisting) {
|
|
859
861
|
gpuTextureWrapper?.releaseMSAATexture();
|