@babylonjs/core 7.12.0 → 7.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +1 -2
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +1 -1
- package/Animations/animationGroupMask.js +2 -2
- package/Animations/animationGroupMask.js.map +1 -1
- package/Animations/animationKey.d.ts +1 -1
- package/Animations/animationKey.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.d.ts +3 -3
- package/Behaviors/Meshes/handConstraintBehavior.js +16 -17
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +2 -3
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/bone.js +31 -32
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js +5 -6
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js +13 -13
- package/Bones/boneLookController.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseWheelInput.js +5 -6
- package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +5 -5
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +8 -10
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Compute/computeEffect.js +2 -3
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +19 -20
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Helper/IBoundingInfoHelperPlatform.d.ts +4 -0
- package/Culling/Helper/IBoundingInfoHelperPlatform.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.d.ts +26 -4
- package/Culling/Helper/boundingInfoHelper.js +41 -10
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.d.ts +12 -3
- package/Culling/Helper/computeShaderBoundingHelper.js +164 -76
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.d.ts +11 -0
- package/Culling/Helper/transformFeedbackBoundingHelper.js +46 -14
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/InputDevices/deviceEnums.d.ts +5 -5
- package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
- package/DeviceInput/eventFactory.js +3 -3
- package/DeviceInput/eventFactory.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -2
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +1 -1
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -3
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +2 -2
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -3
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +4 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +3 -3
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Native/nativeShaderProcessors.js +1 -2
- package/Engines/Native/nativeShaderProcessors.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGL2ShaderProcessors.js +1 -2
- package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.js +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -2
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +5 -5
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +81 -82
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +60 -64
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +1 -2
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +13 -15
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +39 -39
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +6 -8
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -2
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +15 -19
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +8 -10
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -28
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +413 -416
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +50 -51
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +1 -2
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/abstractEngine.js +4 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +9 -9
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +5 -5
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +1 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/shaderStore.js +6 -7
- package/Engines/shaderStore.js.map +1 -1
- package/Engines/thinEngine.js +4 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +11 -0
- package/Engines/webgpuEngine.js +91 -72
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +1 -1
- package/Events/deviceInputEvents.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +1 -1
- package/FlowGraph/flowGraph.js +5 -5
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +2 -3
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +1 -1
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.js +3 -3
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.js +2 -3
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +3 -3
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/Gamepads/dualShockGamepad.d.ts +2 -2
- package/Gamepads/dualShockGamepad.js +14 -14
- package/Gamepads/dualShockGamepad.js.map +1 -1
- package/Gamepads/xboxGamepad.d.ts +2 -2
- package/Gamepads/xboxGamepad.js +14 -14
- package/Gamepads/xboxGamepad.js.map +1 -1
- package/Gizmos/gizmo.d.ts +2 -2
- package/Gizmos/gizmo.js +4 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +2 -2
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +3 -3
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js +6 -6
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -3
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +10 -11
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +8 -9
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +3 -4
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +2 -3
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +5 -6
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -5
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -8
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +4 -6
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -4
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -4
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +7 -9
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +19 -21
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +3 -4
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -29
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +5 -6
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js +1 -2
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js +3 -4
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +4 -5
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +3 -4
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +1 -2
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +1 -2
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -2
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +35 -35
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -2
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js +3 -3
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -2
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +1 -2
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +10 -12
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js +3 -4
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.d.ts +1 -1
- package/Materials/Node/Blocks/waveBlock.js +4 -4
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -4
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.d.ts +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -4
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +5 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +10 -10
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +18 -19
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -3
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -4
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +1 -1
- package/Materials/Textures/internalTexture.js +13 -13
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/ktx2decoderTypes.d.ts +1 -1
- package/Materials/Textures/ktx2decoderTypes.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -2
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/effect.functions.js +2 -3
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/effect.js +3 -4
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +1 -2
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/material.js +7 -9
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +1 -1
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginManager.js +9 -11
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.d.ts +1 -1
- package/Materials/meshDebugPluginMaterial.js +2 -2
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/shaderLanguage.d.ts +1 -1
- package/Materials/shaderLanguage.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +1 -2
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +2 -3
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.axis.d.ts +2 -2
- package/Maths/math.axis.js.map +1 -1
- package/Maths/math.path.d.ts +1 -1
- package/Maths/math.path.js +3 -3
- package/Maths/math.path.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +2 -2
- package/Meshes/Builders/greasedLineBuilder.js +21 -23
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -3
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +14 -14
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +3 -3
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +3 -3
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js +2 -2
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.js +2 -2
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mergeGeometryBlock.js +2 -2
- package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.js +2 -2
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +3 -3
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -7
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/abstractMesh.js +2 -3
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +1 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshSimplification.d.ts +1 -1
- package/Meshes/meshSimplification.js +1 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/meshSimplificationSceneComponent.js +2 -2
- package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
- package/Meshes/transformNode.js +7 -8
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/assetsManager.d.ts +1 -1
- package/Misc/assetsManager.js +9 -9
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +2 -2
- package/Misc/basis.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -3
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/iInspectable.d.ts +1 -1
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +2 -2
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/timer.d.ts +1 -1
- package/Misc/timer.js +5 -5
- package/Misc/timer.js.map +1 -1
- package/Misc/virtualJoystick.d.ts +1 -1
- package/Misc/virtualJoystick.js +16 -16
- package/Misc/virtualJoystick.js.map +1 -1
- package/Particles/particleSystem.js +3 -3
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +1 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.d.ts +1 -1
- package/Particles/pointsCloudSystem.js +14 -14
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/subEmitter.d.ts +1 -1
- package/Particles/subEmitter.js +1 -1
- package/Particles/subEmitter.js.map +1 -1
- package/Physics/physicsHelper.d.ts +2 -2
- package/Physics/physicsHelper.js +6 -7
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/physicsImpostor.js +4 -5
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +16 -8
- package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +96 -79
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +8 -9
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +14 -2
- package/Physics/v2/physicsBody.js +30 -11
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.js +8 -9
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsMaterial.d.ts +1 -1
- package/Physics/v2/physicsMaterial.js.map +1 -1
- package/Physics/v2/physicsShape.js +9 -10
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Physics/v2/ragdoll.js +11 -12
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
- package/PostProcesses/depthOfFieldEffect.js +3 -3
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -1
- package/PostProcesses/tonemapPostProcess.js +4 -4
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +10 -10
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +3 -2
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/ShadersWGSL/boundingInfo.compute.js +8 -8
- package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +2 -2
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +2 -2
- package/XR/features/WebXRHandTracking.js +76 -76
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +2 -2
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRNearInteraction.d.ts +1 -1
- package/XR/features/WebXRNearInteraction.js +5 -5
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +2 -2
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +2 -2
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/webXRCamera.js +3 -4
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXREnterExitUI.js +3 -4
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +12 -13
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.d.ts +1 -1
- package/XR/webXRManagedOutputCanvas.js +15 -6
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js +2 -2
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRTypes.d.ts +2 -2
- package/XR/webXRTypes.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +4 -4
- package/scene.js.map +1 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable babylonjs/available */
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3
|
-
import * as WebGPUConstants from "./webgpuConstants.js";
|
|
4
1
|
import { Scalar } from "../../Maths/math.scalar.js";
|
|
5
2
|
|
|
6
3
|
/** @internal */
|
|
@@ -11,107 +8,107 @@ export class WebGPUTextureHelper {
|
|
|
11
8
|
static GetTextureTypeFromFormat(format) {
|
|
12
9
|
switch (format) {
|
|
13
10
|
// One Component = 8 bits
|
|
14
|
-
case WebGPUConstants.TextureFormat.R8Unorm
|
|
15
|
-
case WebGPUConstants.TextureFormat.R8Snorm
|
|
16
|
-
case WebGPUConstants.TextureFormat.R8Uint
|
|
17
|
-
case WebGPUConstants.TextureFormat.R8Sint
|
|
18
|
-
case WebGPUConstants.TextureFormat.RG8Unorm
|
|
19
|
-
case WebGPUConstants.TextureFormat.RG8Snorm
|
|
20
|
-
case WebGPUConstants.TextureFormat.RG8Uint
|
|
21
|
-
case WebGPUConstants.TextureFormat.RG8Sint
|
|
22
|
-
case WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
23
|
-
case WebGPUConstants.TextureFormat.RGBA8UnormSRGB
|
|
24
|
-
case WebGPUConstants.TextureFormat.RGBA8Snorm
|
|
25
|
-
case WebGPUConstants.TextureFormat.RGBA8Uint
|
|
26
|
-
case WebGPUConstants.TextureFormat.RGBA8Sint
|
|
27
|
-
case WebGPUConstants.TextureFormat.BGRA8Unorm
|
|
28
|
-
case WebGPUConstants.TextureFormat.BGRA8UnormSRGB
|
|
29
|
-
case WebGPUConstants.TextureFormat.RGB10A2UINT
|
|
30
|
-
case WebGPUConstants.TextureFormat.RGB10A2Unorm
|
|
31
|
-
case WebGPUConstants.TextureFormat.RGB9E5UFloat
|
|
32
|
-
case WebGPUConstants.TextureFormat.RG11B10UFloat
|
|
33
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnorm
|
|
34
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB
|
|
35
|
-
case WebGPUConstants.TextureFormat.BC6HRGBUFloat
|
|
36
|
-
case WebGPUConstants.TextureFormat.BC6HRGBFloat
|
|
37
|
-
case WebGPUConstants.TextureFormat.BC5RGUnorm
|
|
38
|
-
case WebGPUConstants.TextureFormat.BC5RGSnorm
|
|
39
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnorm
|
|
40
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB
|
|
41
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnorm
|
|
42
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB
|
|
43
|
-
case WebGPUConstants.TextureFormat.BC4RUnorm
|
|
44
|
-
case WebGPUConstants.TextureFormat.BC4RSnorm
|
|
45
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnorm
|
|
46
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB
|
|
47
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8Unorm
|
|
48
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB
|
|
49
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm
|
|
50
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB
|
|
51
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm
|
|
52
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB
|
|
53
|
-
case WebGPUConstants.TextureFormat.EACR11Unorm
|
|
54
|
-
case WebGPUConstants.TextureFormat.EACR11Snorm
|
|
55
|
-
case WebGPUConstants.TextureFormat.EACRG11Unorm
|
|
56
|
-
case WebGPUConstants.TextureFormat.EACRG11Snorm
|
|
57
|
-
case WebGPUConstants.TextureFormat.ASTC4x4Unorm
|
|
58
|
-
case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB
|
|
59
|
-
case WebGPUConstants.TextureFormat.ASTC5x4Unorm
|
|
60
|
-
case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB
|
|
61
|
-
case WebGPUConstants.TextureFormat.ASTC5x5Unorm
|
|
62
|
-
case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB
|
|
63
|
-
case WebGPUConstants.TextureFormat.ASTC6x5Unorm
|
|
64
|
-
case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB
|
|
65
|
-
case WebGPUConstants.TextureFormat.ASTC6x6Unorm
|
|
66
|
-
case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB
|
|
67
|
-
case WebGPUConstants.TextureFormat.ASTC8x5Unorm
|
|
68
|
-
case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB
|
|
69
|
-
case WebGPUConstants.TextureFormat.ASTC8x6Unorm
|
|
70
|
-
case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB
|
|
71
|
-
case WebGPUConstants.TextureFormat.ASTC8x8Unorm
|
|
72
|
-
case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB
|
|
73
|
-
case WebGPUConstants.TextureFormat.ASTC10x5Unorm
|
|
74
|
-
case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB
|
|
75
|
-
case WebGPUConstants.TextureFormat.ASTC10x6Unorm
|
|
76
|
-
case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB
|
|
77
|
-
case WebGPUConstants.TextureFormat.ASTC10x8Unorm
|
|
78
|
-
case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB
|
|
79
|
-
case WebGPUConstants.TextureFormat.ASTC10x10Unorm
|
|
80
|
-
case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB
|
|
81
|
-
case WebGPUConstants.TextureFormat.ASTC12x10Unorm
|
|
82
|
-
case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB
|
|
83
|
-
case WebGPUConstants.TextureFormat.ASTC12x12Unorm
|
|
84
|
-
case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB
|
|
85
|
-
case WebGPUConstants.TextureFormat.Stencil8
|
|
11
|
+
case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
|
|
12
|
+
case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
|
|
13
|
+
case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
|
|
14
|
+
case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
|
|
15
|
+
case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
|
|
16
|
+
case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
|
|
17
|
+
case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
|
|
18
|
+
case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
|
|
19
|
+
case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
|
|
20
|
+
case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
|
|
21
|
+
case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
|
|
22
|
+
case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
|
|
23
|
+
case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
|
|
24
|
+
case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
|
|
25
|
+
case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
|
|
26
|
+
case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */: // composite format - let's say it's byte...
|
|
27
|
+
case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */: // composite format - let's say it's byte...
|
|
28
|
+
case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */: // composite format - let's say it's byte...
|
|
29
|
+
case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */: // composite format - let's say it's byte...
|
|
30
|
+
case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
|
|
31
|
+
case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
|
|
32
|
+
case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
|
|
33
|
+
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
34
|
+
case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
|
|
35
|
+
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
36
|
+
case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
|
|
37
|
+
case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
|
|
38
|
+
case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
|
|
39
|
+
case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
|
|
40
|
+
case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
|
|
41
|
+
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
42
|
+
case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
|
|
43
|
+
case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
|
|
44
|
+
case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
|
|
45
|
+
case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
|
|
46
|
+
case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
|
|
47
|
+
case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
|
|
48
|
+
case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
|
|
49
|
+
case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
|
|
50
|
+
case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
|
|
51
|
+
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
52
|
+
case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
|
|
53
|
+
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
54
|
+
case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
|
|
55
|
+
case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
|
|
56
|
+
case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
|
|
57
|
+
case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
|
|
58
|
+
case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
|
|
59
|
+
case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
|
|
60
|
+
case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
|
|
61
|
+
case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
|
|
62
|
+
case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
|
|
63
|
+
case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
|
|
64
|
+
case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
|
|
65
|
+
case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
|
|
66
|
+
case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
|
|
67
|
+
case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
|
|
68
|
+
case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
|
|
69
|
+
case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
|
|
70
|
+
case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
|
|
71
|
+
case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
|
|
72
|
+
case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
|
|
73
|
+
case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
|
|
74
|
+
case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
|
|
75
|
+
case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
|
|
76
|
+
case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
|
|
77
|
+
case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
|
|
78
|
+
case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
|
|
79
|
+
case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
|
|
80
|
+
case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
|
|
81
|
+
case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
|
|
82
|
+
case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
|
|
86
83
|
return 0;
|
|
87
84
|
// One component = 16 bits
|
|
88
|
-
case WebGPUConstants.TextureFormat.R16Uint
|
|
89
|
-
case WebGPUConstants.TextureFormat.R16Sint
|
|
90
|
-
case WebGPUConstants.TextureFormat.RG16Uint
|
|
91
|
-
case WebGPUConstants.TextureFormat.RG16Sint
|
|
92
|
-
case WebGPUConstants.TextureFormat.RGBA16Uint
|
|
93
|
-
case WebGPUConstants.TextureFormat.RGBA16Sint
|
|
94
|
-
case WebGPUConstants.TextureFormat.Depth16Unorm
|
|
85
|
+
case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
|
|
86
|
+
case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
|
|
87
|
+
case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
|
|
88
|
+
case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
|
|
89
|
+
case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
|
|
90
|
+
case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
|
|
91
|
+
case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
|
|
95
92
|
return 5;
|
|
96
|
-
case WebGPUConstants.TextureFormat.R16Float
|
|
97
|
-
case WebGPUConstants.TextureFormat.RG16Float
|
|
98
|
-
case WebGPUConstants.TextureFormat.RGBA16Float
|
|
93
|
+
case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
|
|
94
|
+
case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
|
|
95
|
+
case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
|
|
99
96
|
return 2;
|
|
100
97
|
// One component = 32 bits
|
|
101
|
-
case WebGPUConstants.TextureFormat.R32Uint
|
|
102
|
-
case WebGPUConstants.TextureFormat.R32Sint
|
|
103
|
-
case WebGPUConstants.TextureFormat.RG32Uint
|
|
104
|
-
case WebGPUConstants.TextureFormat.RG32Sint
|
|
105
|
-
case WebGPUConstants.TextureFormat.RGBA32Uint
|
|
106
|
-
case WebGPUConstants.TextureFormat.RGBA32Sint
|
|
98
|
+
case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
|
|
99
|
+
case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
|
|
100
|
+
case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
|
|
101
|
+
case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
|
|
102
|
+
case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
|
|
103
|
+
case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
|
|
107
104
|
return 7;
|
|
108
|
-
case WebGPUConstants.TextureFormat.R32Float
|
|
109
|
-
case WebGPUConstants.TextureFormat.RG32Float
|
|
110
|
-
case WebGPUConstants.TextureFormat.RGBA32Float
|
|
111
|
-
case WebGPUConstants.TextureFormat.Depth32Float
|
|
112
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
113
|
-
case WebGPUConstants.TextureFormat.Depth24Plus
|
|
114
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
105
|
+
case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
|
|
106
|
+
case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
|
|
107
|
+
case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
|
|
108
|
+
case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
|
|
109
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
110
|
+
case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
|
|
111
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
115
112
|
return 1;
|
|
116
113
|
}
|
|
117
114
|
return 0;
|
|
@@ -119,143 +116,143 @@ export class WebGPUTextureHelper {
|
|
|
119
116
|
static GetBlockInformationFromFormat(format) {
|
|
120
117
|
switch (format) {
|
|
121
118
|
// 8 bits formats
|
|
122
|
-
case WebGPUConstants.TextureFormat.R8Unorm
|
|
123
|
-
case WebGPUConstants.TextureFormat.R8Snorm
|
|
124
|
-
case WebGPUConstants.TextureFormat.R8Uint
|
|
125
|
-
case WebGPUConstants.TextureFormat.R8Sint
|
|
119
|
+
case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
|
|
120
|
+
case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
|
|
121
|
+
case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
|
|
122
|
+
case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
|
|
126
123
|
return { width: 1, height: 1, length: 1 };
|
|
127
124
|
// 16 bits formats
|
|
128
|
-
case WebGPUConstants.TextureFormat.R16Uint
|
|
129
|
-
case WebGPUConstants.TextureFormat.R16Sint
|
|
130
|
-
case WebGPUConstants.TextureFormat.R16Float
|
|
131
|
-
case WebGPUConstants.TextureFormat.RG8Unorm
|
|
132
|
-
case WebGPUConstants.TextureFormat.RG8Snorm
|
|
133
|
-
case WebGPUConstants.TextureFormat.RG8Uint
|
|
134
|
-
case WebGPUConstants.TextureFormat.RG8Sint
|
|
125
|
+
case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
|
|
126
|
+
case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
|
|
127
|
+
case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
|
|
128
|
+
case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
|
|
129
|
+
case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
|
|
130
|
+
case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
|
|
131
|
+
case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
|
|
135
132
|
return { width: 1, height: 1, length: 2 };
|
|
136
133
|
// 32 bits formats
|
|
137
|
-
case WebGPUConstants.TextureFormat.R32Uint
|
|
138
|
-
case WebGPUConstants.TextureFormat.R32Sint
|
|
139
|
-
case WebGPUConstants.TextureFormat.R32Float
|
|
140
|
-
case WebGPUConstants.TextureFormat.RG16Uint
|
|
141
|
-
case WebGPUConstants.TextureFormat.RG16Sint
|
|
142
|
-
case WebGPUConstants.TextureFormat.RG16Float
|
|
143
|
-
case WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
144
|
-
case WebGPUConstants.TextureFormat.RGBA8UnormSRGB
|
|
145
|
-
case WebGPUConstants.TextureFormat.RGBA8Snorm
|
|
146
|
-
case WebGPUConstants.TextureFormat.RGBA8Uint
|
|
147
|
-
case WebGPUConstants.TextureFormat.RGBA8Sint
|
|
148
|
-
case WebGPUConstants.TextureFormat.BGRA8Unorm
|
|
149
|
-
case WebGPUConstants.TextureFormat.BGRA8UnormSRGB
|
|
150
|
-
case WebGPUConstants.TextureFormat.RGB9E5UFloat
|
|
151
|
-
case WebGPUConstants.TextureFormat.RGB10A2UINT
|
|
152
|
-
case WebGPUConstants.TextureFormat.RGB10A2Unorm
|
|
153
|
-
case WebGPUConstants.TextureFormat.RG11B10UFloat
|
|
134
|
+
case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
|
|
135
|
+
case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
|
|
136
|
+
case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
|
|
137
|
+
case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
|
|
138
|
+
case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
|
|
139
|
+
case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
|
|
140
|
+
case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
|
|
141
|
+
case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
|
|
142
|
+
case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
|
|
143
|
+
case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
|
|
144
|
+
case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
|
|
145
|
+
case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
|
|
146
|
+
case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
|
|
147
|
+
case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:
|
|
148
|
+
case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:
|
|
149
|
+
case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:
|
|
150
|
+
case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:
|
|
154
151
|
return { width: 1, height: 1, length: 4 };
|
|
155
152
|
// 64 bits formats
|
|
156
|
-
case WebGPUConstants.TextureFormat.RG32Uint
|
|
157
|
-
case WebGPUConstants.TextureFormat.RG32Sint
|
|
158
|
-
case WebGPUConstants.TextureFormat.RG32Float
|
|
159
|
-
case WebGPUConstants.TextureFormat.RGBA16Uint
|
|
160
|
-
case WebGPUConstants.TextureFormat.RGBA16Sint
|
|
161
|
-
case WebGPUConstants.TextureFormat.RGBA16Float
|
|
153
|
+
case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
|
|
154
|
+
case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
|
|
155
|
+
case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
|
|
156
|
+
case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
|
|
157
|
+
case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
|
|
158
|
+
case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
|
|
162
159
|
return { width: 1, height: 1, length: 8 };
|
|
163
160
|
// 128 bits formats
|
|
164
|
-
case WebGPUConstants.TextureFormat.RGBA32Uint
|
|
165
|
-
case WebGPUConstants.TextureFormat.RGBA32Sint
|
|
166
|
-
case WebGPUConstants.TextureFormat.RGBA32Float
|
|
161
|
+
case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
|
|
162
|
+
case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
|
|
163
|
+
case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
|
|
167
164
|
return { width: 1, height: 1, length: 16 };
|
|
168
165
|
// Depth and stencil formats
|
|
169
|
-
case WebGPUConstants.TextureFormat.Stencil8
|
|
166
|
+
case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
|
|
170
167
|
// eslint-disable-next-line no-throw-literal
|
|
171
168
|
throw "No fixed size for Stencil8 format!";
|
|
172
|
-
case WebGPUConstants.TextureFormat.Depth16Unorm
|
|
169
|
+
case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
|
|
173
170
|
return { width: 1, height: 1, length: 2 };
|
|
174
|
-
case WebGPUConstants.TextureFormat.Depth24Plus
|
|
171
|
+
case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
|
|
175
172
|
// eslint-disable-next-line no-throw-literal
|
|
176
173
|
throw "No fixed size for Depth24Plus format!";
|
|
177
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
174
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
178
175
|
// eslint-disable-next-line no-throw-literal
|
|
179
176
|
throw "No fixed size for Depth24PlusStencil8 format!";
|
|
180
|
-
case WebGPUConstants.TextureFormat.Depth32Float
|
|
177
|
+
case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
|
|
181
178
|
return { width: 1, height: 1, length: 4 };
|
|
182
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
179
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
183
180
|
return { width: 1, height: 1, length: 5 };
|
|
184
181
|
// BC compressed formats usable if "texture-compression-bc" is both
|
|
185
182
|
// supported by the device/user agent and enabled in requestDevice.
|
|
186
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnorm
|
|
187
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB
|
|
188
|
-
case WebGPUConstants.TextureFormat.BC6HRGBUFloat
|
|
189
|
-
case WebGPUConstants.TextureFormat.BC6HRGBFloat
|
|
190
|
-
case WebGPUConstants.TextureFormat.BC5RGUnorm
|
|
191
|
-
case WebGPUConstants.TextureFormat.BC5RGSnorm
|
|
192
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnorm
|
|
193
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB
|
|
194
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnorm
|
|
195
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB
|
|
183
|
+
case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
|
|
184
|
+
case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
|
|
185
|
+
case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
|
|
186
|
+
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
187
|
+
case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
|
|
188
|
+
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
189
|
+
case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
|
|
190
|
+
case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
|
|
191
|
+
case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
|
|
192
|
+
case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
|
|
196
193
|
return { width: 4, height: 4, length: 16 };
|
|
197
|
-
case WebGPUConstants.TextureFormat.BC4RUnorm
|
|
198
|
-
case WebGPUConstants.TextureFormat.BC4RSnorm
|
|
199
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnorm
|
|
200
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB
|
|
194
|
+
case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
|
|
195
|
+
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
196
|
+
case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
|
|
197
|
+
case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
|
|
201
198
|
return { width: 4, height: 4, length: 8 };
|
|
202
199
|
// ETC2 compressed formats usable if "texture-compression-etc2" is both
|
|
203
200
|
// supported by the device/user agent and enabled in requestDevice.
|
|
204
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8Unorm
|
|
205
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB
|
|
206
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm
|
|
207
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB
|
|
208
|
-
case WebGPUConstants.TextureFormat.EACR11Unorm
|
|
209
|
-
case WebGPUConstants.TextureFormat.EACR11Snorm
|
|
201
|
+
case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
|
|
202
|
+
case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
|
|
203
|
+
case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
|
|
204
|
+
case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
|
|
205
|
+
case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
|
|
206
|
+
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
210
207
|
return { width: 4, height: 4, length: 8 };
|
|
211
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm
|
|
212
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB
|
|
213
|
-
case WebGPUConstants.TextureFormat.EACRG11Unorm
|
|
214
|
-
case WebGPUConstants.TextureFormat.EACRG11Snorm
|
|
208
|
+
case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
|
|
209
|
+
case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
|
|
210
|
+
case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
|
|
211
|
+
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
215
212
|
return { width: 4, height: 4, length: 16 };
|
|
216
213
|
// ASTC compressed formats usable if "texture-compression-astc" is both
|
|
217
214
|
// supported by the device/user agent and enabled in requestDevice.
|
|
218
|
-
case WebGPUConstants.TextureFormat.ASTC4x4Unorm
|
|
219
|
-
case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB
|
|
215
|
+
case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
|
|
216
|
+
case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
|
|
220
217
|
return { width: 4, height: 4, length: 16 };
|
|
221
|
-
case WebGPUConstants.TextureFormat.ASTC5x4Unorm
|
|
222
|
-
case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB
|
|
218
|
+
case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
|
|
219
|
+
case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
|
|
223
220
|
return { width: 5, height: 4, length: 16 };
|
|
224
|
-
case WebGPUConstants.TextureFormat.ASTC5x5Unorm
|
|
225
|
-
case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB
|
|
221
|
+
case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
|
|
222
|
+
case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
|
|
226
223
|
return { width: 5, height: 5, length: 16 };
|
|
227
|
-
case WebGPUConstants.TextureFormat.ASTC6x5Unorm
|
|
228
|
-
case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB
|
|
224
|
+
case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
|
|
225
|
+
case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
|
|
229
226
|
return { width: 6, height: 5, length: 16 };
|
|
230
|
-
case WebGPUConstants.TextureFormat.ASTC6x6Unorm
|
|
231
|
-
case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB
|
|
227
|
+
case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
|
|
228
|
+
case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
|
|
232
229
|
return { width: 6, height: 6, length: 16 };
|
|
233
|
-
case WebGPUConstants.TextureFormat.ASTC8x5Unorm
|
|
234
|
-
case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB
|
|
230
|
+
case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
|
|
231
|
+
case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
|
|
235
232
|
return { width: 8, height: 5, length: 16 };
|
|
236
|
-
case WebGPUConstants.TextureFormat.ASTC8x6Unorm
|
|
237
|
-
case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB
|
|
233
|
+
case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
|
|
234
|
+
case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
|
|
238
235
|
return { width: 8, height: 6, length: 16 };
|
|
239
|
-
case WebGPUConstants.TextureFormat.ASTC8x8Unorm
|
|
240
|
-
case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB
|
|
236
|
+
case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
|
|
237
|
+
case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
|
|
241
238
|
return { width: 8, height: 8, length: 16 };
|
|
242
|
-
case WebGPUConstants.TextureFormat.ASTC10x5Unorm
|
|
243
|
-
case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB
|
|
239
|
+
case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
|
|
240
|
+
case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
|
|
244
241
|
return { width: 10, height: 5, length: 16 };
|
|
245
|
-
case WebGPUConstants.TextureFormat.ASTC10x6Unorm
|
|
246
|
-
case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB
|
|
242
|
+
case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
|
|
243
|
+
case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
|
|
247
244
|
return { width: 10, height: 6, length: 16 };
|
|
248
|
-
case WebGPUConstants.TextureFormat.ASTC10x8Unorm
|
|
249
|
-
case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB
|
|
245
|
+
case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
|
|
246
|
+
case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
|
|
250
247
|
return { width: 10, height: 8, length: 16 };
|
|
251
|
-
case WebGPUConstants.TextureFormat.ASTC10x10Unorm
|
|
252
|
-
case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB
|
|
248
|
+
case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
|
|
249
|
+
case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
|
|
253
250
|
return { width: 10, height: 10, length: 16 };
|
|
254
|
-
case WebGPUConstants.TextureFormat.ASTC12x10Unorm
|
|
255
|
-
case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB
|
|
251
|
+
case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
|
|
252
|
+
case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
|
|
256
253
|
return { width: 12, height: 10, length: 16 };
|
|
257
|
-
case WebGPUConstants.TextureFormat.ASTC12x12Unorm
|
|
258
|
-
case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB
|
|
254
|
+
case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
|
|
255
|
+
case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
|
|
259
256
|
return { width: 12, height: 12, length: 16 };
|
|
260
257
|
}
|
|
261
258
|
return { width: 1, height: 1, length: 4 };
|
|
@@ -274,58 +271,58 @@ export class WebGPUTextureHelper {
|
|
|
274
271
|
}
|
|
275
272
|
static IsCompressedFormat(format) {
|
|
276
273
|
switch (format) {
|
|
277
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB
|
|
278
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnorm
|
|
279
|
-
case WebGPUConstants.TextureFormat.BC6HRGBFloat
|
|
280
|
-
case WebGPUConstants.TextureFormat.BC6HRGBUFloat
|
|
281
|
-
case WebGPUConstants.TextureFormat.BC5RGSnorm
|
|
282
|
-
case WebGPUConstants.TextureFormat.BC5RGUnorm
|
|
283
|
-
case WebGPUConstants.TextureFormat.BC4RSnorm
|
|
284
|
-
case WebGPUConstants.TextureFormat.BC4RUnorm
|
|
285
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB
|
|
286
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnorm
|
|
287
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB
|
|
288
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnorm
|
|
289
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB
|
|
290
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnorm
|
|
291
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8Unorm
|
|
292
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB
|
|
293
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm
|
|
294
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB
|
|
295
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm
|
|
296
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB
|
|
297
|
-
case WebGPUConstants.TextureFormat.EACR11Unorm
|
|
298
|
-
case WebGPUConstants.TextureFormat.EACR11Snorm
|
|
299
|
-
case WebGPUConstants.TextureFormat.EACRG11Unorm
|
|
300
|
-
case WebGPUConstants.TextureFormat.EACRG11Snorm
|
|
301
|
-
case WebGPUConstants.TextureFormat.ASTC4x4Unorm
|
|
302
|
-
case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB
|
|
303
|
-
case WebGPUConstants.TextureFormat.ASTC5x4Unorm
|
|
304
|
-
case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB
|
|
305
|
-
case WebGPUConstants.TextureFormat.ASTC5x5Unorm
|
|
306
|
-
case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB
|
|
307
|
-
case WebGPUConstants.TextureFormat.ASTC6x5Unorm
|
|
308
|
-
case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB
|
|
309
|
-
case WebGPUConstants.TextureFormat.ASTC6x6Unorm
|
|
310
|
-
case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB
|
|
311
|
-
case WebGPUConstants.TextureFormat.ASTC8x5Unorm
|
|
312
|
-
case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB
|
|
313
|
-
case WebGPUConstants.TextureFormat.ASTC8x6Unorm
|
|
314
|
-
case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB
|
|
315
|
-
case WebGPUConstants.TextureFormat.ASTC8x8Unorm
|
|
316
|
-
case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB
|
|
317
|
-
case WebGPUConstants.TextureFormat.ASTC10x5Unorm
|
|
318
|
-
case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB
|
|
319
|
-
case WebGPUConstants.TextureFormat.ASTC10x6Unorm
|
|
320
|
-
case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB
|
|
321
|
-
case WebGPUConstants.TextureFormat.ASTC10x8Unorm
|
|
322
|
-
case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB
|
|
323
|
-
case WebGPUConstants.TextureFormat.ASTC10x10Unorm
|
|
324
|
-
case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB
|
|
325
|
-
case WebGPUConstants.TextureFormat.ASTC12x10Unorm
|
|
326
|
-
case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB
|
|
327
|
-
case WebGPUConstants.TextureFormat.ASTC12x12Unorm
|
|
328
|
-
case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB
|
|
274
|
+
case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
|
|
275
|
+
case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
|
|
276
|
+
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
277
|
+
case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
|
|
278
|
+
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
279
|
+
case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
|
|
280
|
+
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
281
|
+
case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
|
|
282
|
+
case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
|
|
283
|
+
case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
|
|
284
|
+
case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
|
|
285
|
+
case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
|
|
286
|
+
case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
|
|
287
|
+
case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
|
|
288
|
+
case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
|
|
289
|
+
case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
|
|
290
|
+
case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
|
|
291
|
+
case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
|
|
292
|
+
case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
|
|
293
|
+
case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
|
|
294
|
+
case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
|
|
295
|
+
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
296
|
+
case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
|
|
297
|
+
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
298
|
+
case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
|
|
299
|
+
case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
|
|
300
|
+
case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
|
|
301
|
+
case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
|
|
302
|
+
case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
|
|
303
|
+
case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
|
|
304
|
+
case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
|
|
305
|
+
case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
|
|
306
|
+
case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
|
|
307
|
+
case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
|
|
308
|
+
case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
|
|
309
|
+
case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
|
|
310
|
+
case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
|
|
311
|
+
case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
|
|
312
|
+
case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
|
|
313
|
+
case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
|
|
314
|
+
case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
|
|
315
|
+
case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
|
|
316
|
+
case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
|
|
317
|
+
case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
|
|
318
|
+
case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
|
|
319
|
+
case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
|
|
320
|
+
case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
|
|
321
|
+
case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
|
|
322
|
+
case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
|
|
323
|
+
case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
|
|
324
|
+
case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
|
|
325
|
+
case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
|
|
329
326
|
return true;
|
|
330
327
|
}
|
|
331
328
|
return false;
|
|
@@ -333,82 +330,82 @@ export class WebGPUTextureHelper {
|
|
|
333
330
|
static GetWebGPUTextureFormat(type, format, useSRGBBuffer = false) {
|
|
334
331
|
switch (format) {
|
|
335
332
|
case 15:
|
|
336
|
-
return WebGPUConstants.TextureFormat.Depth16Unorm
|
|
333
|
+
return "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */;
|
|
337
334
|
case 16:
|
|
338
|
-
return WebGPUConstants.TextureFormat.Depth24Plus
|
|
335
|
+
return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
|
|
339
336
|
case 13:
|
|
340
|
-
return WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
337
|
+
return "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */;
|
|
341
338
|
case 14:
|
|
342
|
-
return WebGPUConstants.TextureFormat.Depth32Float
|
|
339
|
+
return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
|
|
343
340
|
case 18:
|
|
344
|
-
return WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
341
|
+
return "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */;
|
|
345
342
|
case 19:
|
|
346
|
-
return WebGPUConstants.TextureFormat.Stencil8
|
|
343
|
+
return "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */;
|
|
347
344
|
case 36492:
|
|
348
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC7RGBAUnorm
|
|
345
|
+
return useSRGBBuffer ? "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */ : "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */;
|
|
349
346
|
case 36495:
|
|
350
|
-
return WebGPUConstants.TextureFormat.BC6HRGBUFloat
|
|
347
|
+
return "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */;
|
|
351
348
|
case 36494:
|
|
352
|
-
return WebGPUConstants.TextureFormat.BC6HRGBFloat
|
|
349
|
+
return "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */;
|
|
353
350
|
case 33779:
|
|
354
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC3RGBAUnorm
|
|
351
|
+
return useSRGBBuffer ? "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */ : "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */;
|
|
355
352
|
case 33778:
|
|
356
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC2RGBAUnorm
|
|
353
|
+
return useSRGBBuffer ? "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */ : "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */;
|
|
357
354
|
case 33777:
|
|
358
355
|
case 33776:
|
|
359
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB : WebGPUConstants.TextureFormat.BC1RGBAUnorm
|
|
356
|
+
return useSRGBBuffer ? "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */ : "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */;
|
|
360
357
|
case 37808:
|
|
361
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB : WebGPUConstants.TextureFormat.ASTC4x4Unorm
|
|
358
|
+
return useSRGBBuffer ? "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */ : "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */;
|
|
362
359
|
case 36196:
|
|
363
360
|
case 37492:
|
|
364
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGB8Unorm
|
|
361
|
+
return useSRGBBuffer ? "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */ : "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */;
|
|
365
362
|
case 37496:
|
|
366
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB : WebGPUConstants.TextureFormat.ETC2RGBA8Unorm
|
|
363
|
+
return useSRGBBuffer ? "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */ : "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */;
|
|
367
364
|
}
|
|
368
365
|
switch (type) {
|
|
369
366
|
case 3:
|
|
370
367
|
switch (format) {
|
|
371
368
|
case 6:
|
|
372
|
-
return WebGPUConstants.TextureFormat.R8Snorm
|
|
369
|
+
return "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */;
|
|
373
370
|
case 7:
|
|
374
|
-
return WebGPUConstants.TextureFormat.RG8Snorm
|
|
371
|
+
return "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */;
|
|
375
372
|
case 4:
|
|
376
373
|
// eslint-disable-next-line no-throw-literal
|
|
377
374
|
throw "RGB format not supported in WebGPU";
|
|
378
375
|
case 8:
|
|
379
|
-
return WebGPUConstants.TextureFormat.R8Sint
|
|
376
|
+
return "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */;
|
|
380
377
|
case 9:
|
|
381
|
-
return WebGPUConstants.TextureFormat.RG8Sint
|
|
378
|
+
return "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */;
|
|
382
379
|
case 10:
|
|
383
380
|
// eslint-disable-next-line no-throw-literal
|
|
384
381
|
throw "RGB_INTEGER format not supported in WebGPU";
|
|
385
382
|
case 11:
|
|
386
|
-
return WebGPUConstants.TextureFormat.RGBA8Sint
|
|
383
|
+
return "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */;
|
|
387
384
|
default:
|
|
388
|
-
return WebGPUConstants.TextureFormat.RGBA8Snorm
|
|
385
|
+
return "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */;
|
|
389
386
|
}
|
|
390
387
|
case 0:
|
|
391
388
|
switch (format) {
|
|
392
389
|
case 6:
|
|
393
|
-
return WebGPUConstants.TextureFormat.R8Unorm
|
|
390
|
+
return "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */;
|
|
394
391
|
case 7:
|
|
395
|
-
return WebGPUConstants.TextureFormat.RG8Unorm
|
|
392
|
+
return "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */;
|
|
396
393
|
case 4:
|
|
397
394
|
// eslint-disable-next-line no-throw-literal
|
|
398
395
|
throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
|
|
399
396
|
case 5:
|
|
400
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
397
|
+
return useSRGBBuffer ? "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
|
|
401
398
|
case 12:
|
|
402
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.BGRA8UnormSRGB : WebGPUConstants.TextureFormat.BGRA8Unorm
|
|
399
|
+
return useSRGBBuffer ? "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */ : "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */;
|
|
403
400
|
case 8:
|
|
404
|
-
return WebGPUConstants.TextureFormat.R8Uint
|
|
401
|
+
return "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */;
|
|
405
402
|
case 9:
|
|
406
|
-
return WebGPUConstants.TextureFormat.RG8Uint
|
|
403
|
+
return "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */;
|
|
407
404
|
case 10:
|
|
408
405
|
// eslint-disable-next-line no-throw-literal
|
|
409
406
|
throw "RGB_INTEGER format not supported in WebGPU";
|
|
410
407
|
case 11:
|
|
411
|
-
return WebGPUConstants.TextureFormat.RGBA8Uint
|
|
408
|
+
return "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */;
|
|
412
409
|
case 0:
|
|
413
410
|
// eslint-disable-next-line no-throw-literal
|
|
414
411
|
throw "TEXTUREFORMAT_ALPHA format not supported in WebGPU";
|
|
@@ -419,91 +416,91 @@ export class WebGPUTextureHelper {
|
|
|
419
416
|
// eslint-disable-next-line no-throw-literal
|
|
420
417
|
throw "TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";
|
|
421
418
|
default:
|
|
422
|
-
return WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
419
|
+
return "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
|
|
423
420
|
}
|
|
424
421
|
case 4:
|
|
425
422
|
switch (format) {
|
|
426
423
|
case 8:
|
|
427
|
-
return WebGPUConstants.TextureFormat.R16Sint
|
|
424
|
+
return "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */;
|
|
428
425
|
case 9:
|
|
429
|
-
return WebGPUConstants.TextureFormat.RG16Sint
|
|
426
|
+
return "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */;
|
|
430
427
|
case 10:
|
|
431
428
|
// eslint-disable-next-line no-throw-literal
|
|
432
429
|
throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
|
|
433
430
|
case 11:
|
|
434
|
-
return WebGPUConstants.TextureFormat.RGBA16Sint
|
|
431
|
+
return "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */;
|
|
435
432
|
default:
|
|
436
|
-
return WebGPUConstants.TextureFormat.RGBA16Sint
|
|
433
|
+
return "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */;
|
|
437
434
|
}
|
|
438
435
|
case 5:
|
|
439
436
|
switch (format) {
|
|
440
437
|
case 8:
|
|
441
|
-
return WebGPUConstants.TextureFormat.R16Uint
|
|
438
|
+
return "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */;
|
|
442
439
|
case 9:
|
|
443
|
-
return WebGPUConstants.TextureFormat.RG16Uint
|
|
440
|
+
return "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */;
|
|
444
441
|
case 10:
|
|
445
442
|
// eslint-disable-next-line no-throw-literal
|
|
446
443
|
throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
|
|
447
444
|
case 11:
|
|
448
|
-
return WebGPUConstants.TextureFormat.RGBA16Uint
|
|
445
|
+
return "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */;
|
|
449
446
|
default:
|
|
450
|
-
return WebGPUConstants.TextureFormat.RGBA16Uint
|
|
447
|
+
return "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */;
|
|
451
448
|
}
|
|
452
449
|
case 6:
|
|
453
450
|
switch (format) {
|
|
454
451
|
case 8:
|
|
455
|
-
return WebGPUConstants.TextureFormat.R32Sint
|
|
452
|
+
return "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */;
|
|
456
453
|
case 9:
|
|
457
|
-
return WebGPUConstants.TextureFormat.RG32Sint
|
|
454
|
+
return "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */;
|
|
458
455
|
case 10:
|
|
459
456
|
// eslint-disable-next-line no-throw-literal
|
|
460
457
|
throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
|
|
461
458
|
case 11:
|
|
462
|
-
return WebGPUConstants.TextureFormat.RGBA32Sint
|
|
459
|
+
return "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */;
|
|
463
460
|
default:
|
|
464
|
-
return WebGPUConstants.TextureFormat.RGBA32Sint
|
|
461
|
+
return "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */;
|
|
465
462
|
}
|
|
466
463
|
case 7: // Refers to UNSIGNED_INT
|
|
467
464
|
switch (format) {
|
|
468
465
|
case 8:
|
|
469
|
-
return WebGPUConstants.TextureFormat.R32Uint
|
|
466
|
+
return "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */;
|
|
470
467
|
case 9:
|
|
471
|
-
return WebGPUConstants.TextureFormat.RG32Uint
|
|
468
|
+
return "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */;
|
|
472
469
|
case 10:
|
|
473
470
|
// eslint-disable-next-line no-throw-literal
|
|
474
471
|
throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
|
|
475
472
|
case 11:
|
|
476
|
-
return WebGPUConstants.TextureFormat.RGBA32Uint
|
|
473
|
+
return "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */;
|
|
477
474
|
default:
|
|
478
|
-
return WebGPUConstants.TextureFormat.RGBA32Uint
|
|
475
|
+
return "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */;
|
|
479
476
|
}
|
|
480
477
|
case 1:
|
|
481
478
|
switch (format) {
|
|
482
479
|
case 6:
|
|
483
|
-
return WebGPUConstants.TextureFormat.R32Float
|
|
480
|
+
return "r32float" /* WebGPUConstants.TextureFormat.R32Float */; // By default. Other possibility is R16Float.
|
|
484
481
|
case 7:
|
|
485
|
-
return WebGPUConstants.TextureFormat.RG32Float
|
|
482
|
+
return "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */; // By default. Other possibility is RG16Float.
|
|
486
483
|
case 4:
|
|
487
484
|
// eslint-disable-next-line no-throw-literal
|
|
488
485
|
throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
|
|
489
486
|
case 5:
|
|
490
|
-
return WebGPUConstants.TextureFormat.RGBA32Float
|
|
487
|
+
return "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */; // By default. Other possibility is RGBA16Float.
|
|
491
488
|
default:
|
|
492
|
-
return WebGPUConstants.TextureFormat.RGBA32Float
|
|
489
|
+
return "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */;
|
|
493
490
|
}
|
|
494
491
|
case 2:
|
|
495
492
|
switch (format) {
|
|
496
493
|
case 6:
|
|
497
|
-
return WebGPUConstants.TextureFormat.R16Float
|
|
494
|
+
return "r16float" /* WebGPUConstants.TextureFormat.R16Float */;
|
|
498
495
|
case 7:
|
|
499
|
-
return WebGPUConstants.TextureFormat.RG16Float
|
|
496
|
+
return "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */;
|
|
500
497
|
case 4:
|
|
501
498
|
// eslint-disable-next-line no-throw-literal
|
|
502
499
|
throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
|
|
503
500
|
case 5:
|
|
504
|
-
return WebGPUConstants.TextureFormat.RGBA16Float
|
|
501
|
+
return "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */;
|
|
505
502
|
default:
|
|
506
|
-
return WebGPUConstants.TextureFormat.RGBA16Float
|
|
503
|
+
return "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */;
|
|
507
504
|
}
|
|
508
505
|
case 10:
|
|
509
506
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -511,22 +508,22 @@ export class WebGPUTextureHelper {
|
|
|
511
508
|
case 13:
|
|
512
509
|
switch (format) {
|
|
513
510
|
case 5:
|
|
514
|
-
return WebGPUConstants.TextureFormat.RG11B10UFloat
|
|
511
|
+
return "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;
|
|
515
512
|
case 11:
|
|
516
513
|
// eslint-disable-next-line no-throw-literal
|
|
517
514
|
throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";
|
|
518
515
|
default:
|
|
519
|
-
return WebGPUConstants.TextureFormat.RG11B10UFloat
|
|
516
|
+
return "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;
|
|
520
517
|
}
|
|
521
518
|
case 14:
|
|
522
519
|
switch (format) {
|
|
523
520
|
case 5:
|
|
524
|
-
return WebGPUConstants.TextureFormat.RGB9E5UFloat
|
|
521
|
+
return "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;
|
|
525
522
|
case 11:
|
|
526
523
|
// eslint-disable-next-line no-throw-literal
|
|
527
524
|
throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";
|
|
528
525
|
default:
|
|
529
|
-
return WebGPUConstants.TextureFormat.RGB9E5UFloat
|
|
526
|
+
return "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;
|
|
530
527
|
}
|
|
531
528
|
case 8:
|
|
532
529
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -537,115 +534,115 @@ export class WebGPUTextureHelper {
|
|
|
537
534
|
case 11:
|
|
538
535
|
switch (format) {
|
|
539
536
|
case 5:
|
|
540
|
-
return WebGPUConstants.TextureFormat.RGB10A2Unorm
|
|
537
|
+
return "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;
|
|
541
538
|
case 11:
|
|
542
|
-
return WebGPUConstants.TextureFormat.RGB10A2UINT
|
|
539
|
+
return "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */;
|
|
543
540
|
default:
|
|
544
|
-
return WebGPUConstants.TextureFormat.RGB10A2Unorm
|
|
541
|
+
return "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;
|
|
545
542
|
}
|
|
546
543
|
}
|
|
547
|
-
return useSRGBBuffer ? WebGPUConstants.TextureFormat.RGBA8UnormSRGB : WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
544
|
+
return useSRGBBuffer ? "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
|
|
548
545
|
}
|
|
549
546
|
static GetNumChannelsFromWebGPUTextureFormat(format) {
|
|
550
547
|
switch (format) {
|
|
551
|
-
case WebGPUConstants.TextureFormat.R8Unorm
|
|
552
|
-
case WebGPUConstants.TextureFormat.R8Snorm
|
|
553
|
-
case WebGPUConstants.TextureFormat.R8Uint
|
|
554
|
-
case WebGPUConstants.TextureFormat.R8Sint
|
|
555
|
-
case WebGPUConstants.TextureFormat.BC4RUnorm
|
|
556
|
-
case WebGPUConstants.TextureFormat.BC4RSnorm
|
|
557
|
-
case WebGPUConstants.TextureFormat.R16Uint
|
|
558
|
-
case WebGPUConstants.TextureFormat.R16Sint
|
|
559
|
-
case WebGPUConstants.TextureFormat.Depth16Unorm
|
|
560
|
-
case WebGPUConstants.TextureFormat.R16Float
|
|
561
|
-
case WebGPUConstants.TextureFormat.R32Uint
|
|
562
|
-
case WebGPUConstants.TextureFormat.R32Sint
|
|
563
|
-
case WebGPUConstants.TextureFormat.R32Float
|
|
564
|
-
case WebGPUConstants.TextureFormat.Depth32Float
|
|
565
|
-
case WebGPUConstants.TextureFormat.Stencil8
|
|
566
|
-
case WebGPUConstants.TextureFormat.Depth24Plus
|
|
567
|
-
case WebGPUConstants.TextureFormat.EACR11Unorm
|
|
568
|
-
case WebGPUConstants.TextureFormat.EACR11Snorm
|
|
548
|
+
case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
|
|
549
|
+
case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
|
|
550
|
+
case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
|
|
551
|
+
case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
|
|
552
|
+
case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
|
|
553
|
+
case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
|
|
554
|
+
case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
|
|
555
|
+
case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
|
|
556
|
+
case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
|
|
557
|
+
case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
|
|
558
|
+
case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
|
|
559
|
+
case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
|
|
560
|
+
case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
|
|
561
|
+
case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
|
|
562
|
+
case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
|
|
563
|
+
case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
|
|
564
|
+
case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
|
|
565
|
+
case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
|
|
569
566
|
return 1;
|
|
570
|
-
case WebGPUConstants.TextureFormat.RG8Unorm
|
|
571
|
-
case WebGPUConstants.TextureFormat.RG8Snorm
|
|
572
|
-
case WebGPUConstants.TextureFormat.RG8Uint
|
|
573
|
-
case WebGPUConstants.TextureFormat.RG8Sint
|
|
574
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
575
|
-
case WebGPUConstants.TextureFormat.BC5RGUnorm
|
|
576
|
-
case WebGPUConstants.TextureFormat.BC5RGSnorm
|
|
577
|
-
case WebGPUConstants.TextureFormat.RG16Uint
|
|
578
|
-
case WebGPUConstants.TextureFormat.RG16Sint
|
|
579
|
-
case WebGPUConstants.TextureFormat.RG16Float
|
|
580
|
-
case WebGPUConstants.TextureFormat.RG32Uint
|
|
581
|
-
case WebGPUConstants.TextureFormat.RG32Sint
|
|
582
|
-
case WebGPUConstants.TextureFormat.RG32Float
|
|
583
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
584
|
-
case WebGPUConstants.TextureFormat.EACRG11Unorm
|
|
585
|
-
case WebGPUConstants.TextureFormat.EACRG11Snorm
|
|
567
|
+
case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
|
|
568
|
+
case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
|
|
569
|
+
case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
|
|
570
|
+
case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
|
|
571
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
572
|
+
case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
|
|
573
|
+
case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
|
|
574
|
+
case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
|
|
575
|
+
case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
|
|
576
|
+
case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
|
|
577
|
+
case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
|
|
578
|
+
case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
|
|
579
|
+
case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
|
|
580
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
581
|
+
case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
|
|
582
|
+
case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
|
|
586
583
|
return 2;
|
|
587
|
-
case WebGPUConstants.TextureFormat.RGB9E5UFloat
|
|
588
|
-
case WebGPUConstants.TextureFormat.RG11B10UFloat
|
|
589
|
-
case WebGPUConstants.TextureFormat.BC6HRGBUFloat
|
|
590
|
-
case WebGPUConstants.TextureFormat.BC6HRGBFloat
|
|
591
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8Unorm
|
|
592
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB
|
|
584
|
+
case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:
|
|
585
|
+
case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:
|
|
586
|
+
case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
|
|
587
|
+
case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
|
|
588
|
+
case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
|
|
589
|
+
case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
|
|
593
590
|
return 3;
|
|
594
|
-
case WebGPUConstants.TextureFormat.RGBA8Unorm
|
|
595
|
-
case WebGPUConstants.TextureFormat.RGBA8UnormSRGB
|
|
596
|
-
case WebGPUConstants.TextureFormat.RGBA8Snorm
|
|
597
|
-
case WebGPUConstants.TextureFormat.RGBA8Uint
|
|
598
|
-
case WebGPUConstants.TextureFormat.RGBA8Sint
|
|
599
|
-
case WebGPUConstants.TextureFormat.BGRA8Unorm
|
|
600
|
-
case WebGPUConstants.TextureFormat.BGRA8UnormSRGB
|
|
601
|
-
case WebGPUConstants.TextureFormat.RGB10A2UINT
|
|
602
|
-
case WebGPUConstants.TextureFormat.RGB10A2Unorm
|
|
603
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnorm
|
|
604
|
-
case WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB
|
|
605
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnorm
|
|
606
|
-
case WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB
|
|
607
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnorm
|
|
608
|
-
case WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB
|
|
609
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnorm
|
|
610
|
-
case WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB
|
|
611
|
-
case WebGPUConstants.TextureFormat.RGBA16Uint
|
|
612
|
-
case WebGPUConstants.TextureFormat.RGBA16Sint
|
|
613
|
-
case WebGPUConstants.TextureFormat.RGBA16Float
|
|
614
|
-
case WebGPUConstants.TextureFormat.RGBA32Uint
|
|
615
|
-
case WebGPUConstants.TextureFormat.RGBA32Sint
|
|
616
|
-
case WebGPUConstants.TextureFormat.RGBA32Float
|
|
617
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm
|
|
618
|
-
case WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB
|
|
619
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8Unorm
|
|
620
|
-
case WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB
|
|
621
|
-
case WebGPUConstants.TextureFormat.ASTC4x4Unorm
|
|
622
|
-
case WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB
|
|
623
|
-
case WebGPUConstants.TextureFormat.ASTC5x4Unorm
|
|
624
|
-
case WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB
|
|
625
|
-
case WebGPUConstants.TextureFormat.ASTC5x5Unorm
|
|
626
|
-
case WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB
|
|
627
|
-
case WebGPUConstants.TextureFormat.ASTC6x5Unorm
|
|
628
|
-
case WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB
|
|
629
|
-
case WebGPUConstants.TextureFormat.ASTC6x6Unorm
|
|
630
|
-
case WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB
|
|
631
|
-
case WebGPUConstants.TextureFormat.ASTC8x5Unorm
|
|
632
|
-
case WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB
|
|
633
|
-
case WebGPUConstants.TextureFormat.ASTC8x6Unorm
|
|
634
|
-
case WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB
|
|
635
|
-
case WebGPUConstants.TextureFormat.ASTC8x8Unorm
|
|
636
|
-
case WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB
|
|
637
|
-
case WebGPUConstants.TextureFormat.ASTC10x5Unorm
|
|
638
|
-
case WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB
|
|
639
|
-
case WebGPUConstants.TextureFormat.ASTC10x6Unorm
|
|
640
|
-
case WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB
|
|
641
|
-
case WebGPUConstants.TextureFormat.ASTC10x8Unorm
|
|
642
|
-
case WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB
|
|
643
|
-
case WebGPUConstants.TextureFormat.ASTC10x10Unorm
|
|
644
|
-
case WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB
|
|
645
|
-
case WebGPUConstants.TextureFormat.ASTC12x10Unorm
|
|
646
|
-
case WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB
|
|
647
|
-
case WebGPUConstants.TextureFormat.ASTC12x12Unorm
|
|
648
|
-
case WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB
|
|
591
|
+
case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
|
|
592
|
+
case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
|
|
593
|
+
case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
|
|
594
|
+
case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
|
|
595
|
+
case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
|
|
596
|
+
case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
|
|
597
|
+
case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
|
|
598
|
+
case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:
|
|
599
|
+
case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:
|
|
600
|
+
case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
|
|
601
|
+
case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
|
|
602
|
+
case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
|
|
603
|
+
case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
|
|
604
|
+
case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
|
|
605
|
+
case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
|
|
606
|
+
case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
|
|
607
|
+
case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
|
|
608
|
+
case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
|
|
609
|
+
case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
|
|
610
|
+
case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
|
|
611
|
+
case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
|
|
612
|
+
case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
|
|
613
|
+
case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
|
|
614
|
+
case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
|
|
615
|
+
case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
|
|
616
|
+
case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
|
|
617
|
+
case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
|
|
618
|
+
case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
|
|
619
|
+
case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
|
|
620
|
+
case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
|
|
621
|
+
case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
|
|
622
|
+
case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
|
|
623
|
+
case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
|
|
624
|
+
case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
|
|
625
|
+
case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
|
|
626
|
+
case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
|
|
627
|
+
case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
|
|
628
|
+
case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
|
|
629
|
+
case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
|
|
630
|
+
case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
|
|
631
|
+
case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
|
|
632
|
+
case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
|
|
633
|
+
case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
|
|
634
|
+
case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
|
|
635
|
+
case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
|
|
636
|
+
case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
|
|
637
|
+
case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
|
|
638
|
+
case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
|
|
639
|
+
case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
|
|
640
|
+
case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
|
|
641
|
+
case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
|
|
642
|
+
case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
|
|
643
|
+
case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
|
|
644
|
+
case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
|
|
645
|
+
case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
|
|
649
646
|
return 4;
|
|
650
647
|
}
|
|
651
648
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -653,33 +650,33 @@ export class WebGPUTextureHelper {
|
|
|
653
650
|
}
|
|
654
651
|
static HasStencilAspect(format) {
|
|
655
652
|
switch (format) {
|
|
656
|
-
case WebGPUConstants.TextureFormat.Stencil8
|
|
657
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
658
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
653
|
+
case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
|
|
654
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
655
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
659
656
|
return true;
|
|
660
657
|
}
|
|
661
658
|
return false;
|
|
662
659
|
}
|
|
663
660
|
static HasDepthAndStencilAspects(format) {
|
|
664
661
|
switch (format) {
|
|
665
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
666
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
662
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
663
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
667
664
|
return true;
|
|
668
665
|
}
|
|
669
666
|
return false;
|
|
670
667
|
}
|
|
671
668
|
static GetDepthFormatOnly(format) {
|
|
672
669
|
switch (format) {
|
|
673
|
-
case WebGPUConstants.TextureFormat.Depth16Unorm
|
|
674
|
-
return WebGPUConstants.TextureFormat.Depth16Unorm
|
|
675
|
-
case WebGPUConstants.TextureFormat.Depth24Plus
|
|
676
|
-
return WebGPUConstants.TextureFormat.Depth24Plus
|
|
677
|
-
case WebGPUConstants.TextureFormat.Depth24PlusStencil8
|
|
678
|
-
return WebGPUConstants.TextureFormat.Depth24Plus
|
|
679
|
-
case WebGPUConstants.TextureFormat.Depth32Float
|
|
680
|
-
return WebGPUConstants.TextureFormat.Depth32Float
|
|
681
|
-
case WebGPUConstants.TextureFormat.Depth32FloatStencil8
|
|
682
|
-
return WebGPUConstants.TextureFormat.Depth32Float
|
|
670
|
+
case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
|
|
671
|
+
return "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */;
|
|
672
|
+
case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
|
|
673
|
+
return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
|
|
674
|
+
case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
|
|
675
|
+
return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
|
|
676
|
+
case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
|
|
677
|
+
return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
|
|
678
|
+
case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
|
|
679
|
+
return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
|
|
683
680
|
}
|
|
684
681
|
return format;
|
|
685
682
|
}
|