@babylonjs/core 7.12.0 → 7.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/Buffers/bufferUtils.d.ts +13 -0
- package/Buffers/bufferUtils.js +42 -0
- package/Buffers/bufferUtils.js.map +1 -0
- package/Buffers/index.d.ts +1 -0
- package/Buffers/index.js +1 -0
- package/Buffers/index.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/Maths/math.vector.js +32 -6
- package/Maths/math.vector.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.d.ts +49 -17
- package/Meshes/abstractMesh.js +128 -133
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +8 -0
- package/Meshes/geometry.js +17 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +5 -8
- package/Meshes/instancedMesh.js +15 -9
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +7 -3
- package/Meshes/mesh.js +21 -13
- 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
|
@@ -9,7 +9,6 @@ import { ShaderDefineAndOperator } from "./Expressions/Operators/shaderDefineAnd
|
|
|
9
9
|
import { ShaderDefineExpression } from "./Expressions/shaderDefineExpression.js";
|
|
10
10
|
import { ShaderDefineArithmeticOperator } from "./Expressions/Operators/shaderDefineArithmeticOperator.js";
|
|
11
11
|
import { _WarnImport } from "../../Misc/devTools.js";
|
|
12
|
-
import { ShaderLanguage } from "../../Materials/shaderLanguage.js";
|
|
13
12
|
import { _getGlobalDefines } from "../abstractEngine.functions.js";
|
|
14
13
|
const regexSE = /defined\s*?\((.+?)\)/g;
|
|
15
14
|
const regexSERevert = /defined\s*?\[(.+?)\]/g;
|
|
@@ -238,7 +237,7 @@ function _PreparePreProcessors(options, engine) {
|
|
|
238
237
|
const split = keyValue.split(" ");
|
|
239
238
|
preprocessors[split[0]] = split.length > 1 ? split[1] : "";
|
|
240
239
|
}
|
|
241
|
-
if (options.processor?.shaderLanguage === ShaderLanguage.GLSL) {
|
|
240
|
+
if (options.processor?.shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
|
|
242
241
|
preprocessors["GL_ES"] = "true";
|
|
243
242
|
}
|
|
244
243
|
preprocessors["__VERSION__"] = options.version;
|
|
@@ -252,7 +251,7 @@ function _ProcessShaderConversion(sourceCode, options, engine) {
|
|
|
252
251
|
return preparedSourceCode;
|
|
253
252
|
}
|
|
254
253
|
// Already converted
|
|
255
|
-
if (options.processor.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf("#version 3") !== -1) {
|
|
254
|
+
if (options.processor.shaderLanguage === 0 /* ShaderLanguage.GLSL */ && preparedSourceCode.indexOf("#version 3") !== -1) {
|
|
256
255
|
preparedSourceCode = preparedSourceCode.replace("#version 300 es", "");
|
|
257
256
|
if (!options.processor.parseGLES3) {
|
|
258
257
|
return preparedSourceCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/shaderProcessor.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AAExG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAMhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,MAAM,OAAO,GAAG,uBAAuB,CAAC;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IAE3B,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE7B,IAAI,cAAc,EAAE;QAChB,gBAAgB,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC/D;SAAM;QACH,QAAQ,CAAC,WAAW,CAAC,CAAC;KACzB;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,CACN,GAAW,EACX,SAAqE,EACrE,UAAwC,EACxC,eAAkC,EAClC,cAAwB,EACxB,OAAmE,EACvD,EAAE;QACd,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { ShaderCodeNode } from \"./shaderCodeNode\";\r\nimport { ShaderCodeCursor } from \"./shaderCodeCursor\";\r\nimport { ShaderCodeConditionNode } from \"./shaderCodeConditionNode\";\r\nimport { ShaderCodeTestNode } from \"./shaderCodeTestNode\";\r\nimport { ShaderDefineIsDefinedOperator } from \"./Expressions/Operators/shaderDefineIsDefinedOperator\";\r\nimport { ShaderDefineOrOperator } from \"./Expressions/Operators/shaderDefineOrOperator\";\r\nimport { ShaderDefineAndOperator } from \"./Expressions/Operators/shaderDefineAndOperator\";\r\nimport { ShaderDefineExpression } from \"./Expressions/shaderDefineExpression\";\r\nimport { ShaderDefineArithmeticOperator } from \"./Expressions/Operators/shaderDefineArithmeticOperator\";\r\nimport type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\n\r\nimport type { WebRequest } from \"../../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../../Misc/fileTools\";\r\nimport type { IOfflineProvider } from \"../../Offline/IOfflineProvider\";\r\nimport type { IFileRequest } from \"../../Misc/fileRequest\";\r\nimport { _getGlobalDefines } from \"../abstractEngine.functions\";\r\nimport type { AbstractEngine } from \"../abstractEngine\";\r\n\r\nconst regexSE = /defined\\s*?\\((.+?)\\)/g;\r\nconst regexSERevert = /defined\\s*?\\[(.+?)\\]/g;\r\nconst regexShaderInclude = /#include\\s?<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g;\r\nconst regexShaderDecl = /__decl__/;\r\nconst regexLightX = /light\\{X\\}.(\\w*)/g;\r\nconst regexX = /\\{X\\}/g;\r\nconst reusableMatches: RegExpMatchArray[] = [];\r\n\r\nconst _MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;\r\n\r\nexport function Initialize(options: ProcessingOptions): void {\r\n if (options.processor && options.processor.initializeShaders) {\r\n options.processor.initializeShaders(options.processingContext);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function Process(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine?: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes, options.defines);\r\n }\r\n const migratedCode = _ProcessShaderConversion(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function PreProcess(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes, options.defines);\r\n }\r\n const migratedCode = _ApplyPreProcessing(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function Finalize(vertexCode: string, fragmentCode: string, options: ProcessingOptions): { vertexCode: string; fragmentCode: string } {\r\n if (!options.processor || !options.processor.finalizeShaders) {\r\n return { vertexCode, fragmentCode };\r\n }\r\n\r\n return options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext);\r\n}\r\n\r\nfunction _ProcessPrecision(source: string, options: ProcessingOptions): string {\r\n if (options.processor?.noPrecision) {\r\n return source;\r\n }\r\n\r\n const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;\r\n\r\n if (source.indexOf(\"precision highp float\") === -1) {\r\n if (!shouldUseHighPrecisionShader) {\r\n source = \"precision mediump float;\\n\" + source;\r\n } else {\r\n source = \"precision highp float;\\n\" + source;\r\n }\r\n } else {\r\n if (!shouldUseHighPrecisionShader) {\r\n // Moving highp to mediump\r\n source = source.replace(\"precision highp float\", \"precision mediump float\");\r\n }\r\n }\r\n\r\n return source;\r\n}\r\n\r\nfunction _ExtractOperation(expression: string) {\r\n const regex = /defined\\((.+)\\)/;\r\n\r\n const match = regex.exec(expression);\r\n\r\n if (match && match.length) {\r\n return new ShaderDefineIsDefinedOperator(match[1].trim(), expression[0] === \"!\");\r\n }\r\n\r\n const operators = [\"==\", \"!=\", \">=\", \"<=\", \"<\", \">\"];\r\n let operator = \"\";\r\n let indexOperator = 0;\r\n\r\n for (operator of operators) {\r\n indexOperator = expression.indexOf(operator);\r\n\r\n if (indexOperator > -1) {\r\n break;\r\n }\r\n }\r\n\r\n if (indexOperator === -1) {\r\n return new ShaderDefineIsDefinedOperator(expression);\r\n }\r\n\r\n const define = expression.substring(0, indexOperator).trim();\r\n const value = expression.substring(indexOperator + operator.length).trim();\r\n\r\n return new ShaderDefineArithmeticOperator(define, operator, value);\r\n}\r\n\r\nfunction _BuildSubExpression(expression: string): ShaderDefineExpression {\r\n expression = expression.replace(regexSE, \"defined[$1]\");\r\n\r\n const postfix = ShaderDefineExpression.infixToPostfix(expression);\r\n\r\n const stack: (string | ShaderDefineExpression)[] = [];\r\n\r\n for (const c of postfix) {\r\n if (c !== \"||\" && c !== \"&&\") {\r\n stack.push(c);\r\n } else if (stack.length >= 2) {\r\n let v1 = stack[stack.length - 1],\r\n v2 = stack[stack.length - 2];\r\n\r\n stack.length -= 2;\r\n\r\n const operator = c == \"&&\" ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();\r\n\r\n if (typeof v1 === \"string\") {\r\n v1 = v1.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n if (typeof v2 === \"string\") {\r\n v2 = v2.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n operator.leftOperand = typeof v2 === \"string\" ? _ExtractOperation(v2) : v2;\r\n operator.rightOperand = typeof v1 === \"string\" ? _ExtractOperation(v1) : v1;\r\n\r\n stack.push(operator);\r\n }\r\n }\r\n\r\n let result = stack[stack.length - 1];\r\n\r\n if (typeof result === \"string\") {\r\n result = result.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n // note: stack.length !== 1 if there was an error in the parsing\r\n\r\n return typeof result === \"string\" ? _ExtractOperation(result) : result;\r\n}\r\n\r\nfunction _BuildExpression(line: string, start: number): ShaderCodeTestNode {\r\n const node = new ShaderCodeTestNode();\r\n const command = line.substring(0, start);\r\n let expression = line.substring(start);\r\n\r\n expression = expression.substring(0, (expression.indexOf(\"//\") + 1 || expression.length + 1) - 1).trim();\r\n\r\n if (command === \"#ifdef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression);\r\n } else if (command === \"#ifndef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression, true);\r\n } else {\r\n node.testExpression = _BuildSubExpression(expression);\r\n }\r\n\r\n return node;\r\n}\r\n\r\nfunction _MoveCursorWithinIf(cursor: ShaderCodeCursor, rootNode: ShaderCodeConditionNode, ifNode: ShaderCodeNode) {\r\n let line = cursor.currentLine;\r\n while (_MoveCursor(cursor, ifNode)) {\r\n line = cursor.currentLine;\r\n const first5 = line.substring(0, 5).toLowerCase();\r\n\r\n if (first5 === \"#else\") {\r\n const elseNode = new ShaderCodeNode();\r\n rootNode.children.push(elseNode);\r\n _MoveCursor(cursor, elseNode);\r\n return;\r\n } else if (first5 === \"#elif\") {\r\n const elifNode = _BuildExpression(line, 5);\r\n\r\n rootNode.children.push(elifNode);\r\n ifNode = elifNode;\r\n }\r\n }\r\n}\r\n\r\nfunction _MoveCursor(cursor: ShaderCodeCursor, rootNode: ShaderCodeNode): boolean {\r\n while (cursor.canRead) {\r\n cursor.lineIndex++;\r\n const line = cursor.currentLine;\r\n\r\n if (line.indexOf(\"#\") >= 0) {\r\n const matches = _MoveCursorRegex.exec(line);\r\n\r\n if (matches && matches.length) {\r\n const keyword = matches[0];\r\n\r\n switch (keyword) {\r\n case \"#ifdef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 6);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#else\":\r\n case \"#elif\":\r\n return true;\r\n case \"#endif\":\r\n return false;\r\n case \"#ifndef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 7);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#if\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n const ifNode = _BuildExpression(line, 3);\r\n rootNode.children.push(newRootNode);\r\n\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n }\r\n continue;\r\n }\r\n }\r\n\r\n const newNode = new ShaderCodeNode();\r\n newNode.line = line;\r\n rootNode.children.push(newNode);\r\n\r\n // Detect additional defines\r\n if (line[0] === \"#\" && line[1] === \"d\") {\r\n const split = line.replace(\";\", \"\").split(\" \");\r\n newNode.additionalDefineKey = split[1];\r\n\r\n if (split.length === 3) {\r\n newNode.additionalDefineValue = split[2];\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction _EvaluatePreProcessors(sourceCode: string, preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n const rootNode = new ShaderCodeNode();\r\n const cursor = new ShaderCodeCursor();\r\n\r\n cursor.lineIndex = -1;\r\n cursor.lines = sourceCode.split(\"\\n\");\r\n\r\n // Decompose (We keep it in 2 steps so it is easier to maintain and perf hit is insignificant)\r\n _MoveCursor(cursor, rootNode);\r\n\r\n // Recompose\r\n return rootNode.process(preprocessors, options);\r\n}\r\n\r\nfunction _PreparePreProcessors(options: ProcessingOptions, engine?: AbstractEngine): { [key: string]: string } {\r\n const defines = options.defines;\r\n const preprocessors: { [key: string]: string } = {};\r\n\r\n for (const define of defines) {\r\n const keyValue = define.replace(\"#define\", \"\").replace(\";\", \"\").trim();\r\n const split = keyValue.split(\" \");\r\n preprocessors[split[0]] = split.length > 1 ? split[1] : \"\";\r\n }\r\n\r\n if (options.processor?.shaderLanguage === ShaderLanguage.GLSL) {\r\n preprocessors[\"GL_ES\"] = \"true\";\r\n }\r\n preprocessors[\"__VERSION__\"] = options.version;\r\n preprocessors[options.platformName] = \"true\";\r\n\r\n _getGlobalDefines(preprocessors, engine?.isNDCHalfZRange, engine?.useReverseDepthBuffer, engine?.useExactSrgbConversions);\r\n\r\n return preprocessors;\r\n}\r\n\r\nfunction _ProcessShaderConversion(sourceCode: string, options: ProcessingOptions, engine?: AbstractEngine): string {\r\n let preparedSourceCode = _ProcessPrecision(sourceCode, options);\r\n\r\n if (!options.processor) {\r\n return preparedSourceCode;\r\n }\r\n\r\n // Already converted\r\n if (options.processor.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf(\"#version 3\") !== -1) {\r\n preparedSourceCode = preparedSourceCode.replace(\"#version 300 es\", \"\");\r\n if (!options.processor.parseGLES3) {\r\n return preparedSourceCode;\r\n }\r\n }\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine?._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\nfunction _ApplyPreProcessing(sourceCode: string, options: ProcessingOptions, engine: AbstractEngine): string {\r\n let preparedSourceCode = sourceCode;\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor?.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor?.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\n/** @internal */\r\nexport function _ProcessIncludes(sourceCode: string, options: ProcessingOptions, callback: (data: any) => void): void {\r\n reusableMatches.length = 0;\r\n let match: RegExpMatchArray | null;\r\n // stay back-compat to the old matchAll syntax\r\n while ((match = regexShaderInclude.exec(sourceCode)) !== null) {\r\n reusableMatches.push(match);\r\n }\r\n\r\n let returnValue = String(sourceCode);\r\n let parts = [sourceCode];\r\n\r\n let keepProcessing = false;\r\n\r\n for (const match of reusableMatches) {\r\n let includeFile = match[1];\r\n\r\n // Uniform declaration\r\n if (includeFile.indexOf(\"__decl__\") !== -1) {\r\n includeFile = includeFile.replace(regexShaderDecl, \"\");\r\n if (options.supportsUniformBuffers) {\r\n includeFile = includeFile.replace(\"Vertex\", \"Ubo\").replace(\"Fragment\", \"Ubo\");\r\n }\r\n includeFile = includeFile + \"Declaration\";\r\n }\r\n\r\n if (options.includesShadersStore[includeFile]) {\r\n // Substitution\r\n let includeContent = options.includesShadersStore[includeFile];\r\n if (match[2]) {\r\n const splits = match[3].split(\",\");\r\n\r\n for (let index = 0; index < splits.length; index += 2) {\r\n const source = new RegExp(splits[index], \"g\");\r\n const dest = splits[index + 1];\r\n\r\n includeContent = includeContent.replace(source, dest);\r\n }\r\n }\r\n\r\n if (match[4]) {\r\n const indexString = match[5];\r\n\r\n if (indexString.indexOf(\"..\") !== -1) {\r\n const indexSplits = indexString.split(\"..\");\r\n const minIndex = parseInt(indexSplits[0]);\r\n let maxIndex = parseInt(indexSplits[1]);\r\n let sourceIncludeContent = includeContent.slice(0);\r\n includeContent = \"\";\r\n\r\n if (isNaN(maxIndex)) {\r\n maxIndex = options.indexParameters[indexSplits[1]];\r\n }\r\n\r\n for (let i = minIndex; i < maxIndex; i++) {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n sourceIncludeContent = sourceIncludeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent += sourceIncludeContent.replace(regexX, i.toString()) + \"\\n\";\r\n }\r\n } else {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n includeContent = includeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent = includeContent.replace(regexX, indexString);\r\n }\r\n }\r\n\r\n // Replace\r\n // Split all parts on match[0] and intersperse the parts with the include content\r\n const newParts = [];\r\n for (const part of parts) {\r\n const splitPart = part.split(match[0]);\r\n for (let i = 0; i < splitPart.length - 1; i++) {\r\n newParts.push(splitPart[i]);\r\n newParts.push(includeContent);\r\n }\r\n newParts.push(splitPart[splitPart.length - 1]);\r\n }\r\n parts = newParts;\r\n\r\n keepProcessing = keepProcessing || includeContent.indexOf(\"#include<\") >= 0 || includeContent.indexOf(\"#include <\") >= 0;\r\n } else {\r\n const includeShaderUrl = options.shadersRepository + \"ShadersInclude/\" + includeFile + \".fx\";\r\n\r\n _functionContainer.loadFile(includeShaderUrl, (fileContent) => {\r\n options.includesShadersStore[includeFile] = fileContent as string;\r\n _ProcessIncludes(parts.join(\"\"), options, callback);\r\n });\r\n return;\r\n }\r\n }\r\n reusableMatches.length = 0;\r\n\r\n returnValue = parts.join(\"\");\r\n\r\n if (keepProcessing) {\r\n _ProcessIncludes(returnValue.toString(), options, callback);\r\n } else {\r\n callback(returnValue);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _functionContainer = {\r\n /**\r\n * Loads a file from a url\r\n * @param url url to load\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param offlineProvider defines the offline provider for caching\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @returns a file request object\r\n * @internal\r\n */\r\n loadFile: (\r\n url: string,\r\n onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void,\r\n onProgress?: (ev: ProgressEvent) => void,\r\n offlineProvider?: IOfflineProvider,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void\r\n ): IFileRequest => {\r\n throw _WarnImport(\"FileTools\");\r\n },\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"shaderProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Processors/shaderProcessor.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AAExG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,0CAA0C,CAAC;AACtE,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AACxC,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,eAAe,GAAuB,EAAE,CAAC;AAE/C,MAAM,gBAAgB,GAAG,mDAAmD,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;;;;;;;OAUG;IACH,QAAQ,EAAE,CACN,GAAW,EACX,SAAqE,EACrE,UAAwC,EACxC,eAAkC,EAClC,cAAwB,EACxB,OAAmE,EACvD,EAAE;QACd,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACJ,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { ShaderCodeNode } from \"./shaderCodeNode\";\r\nimport { ShaderCodeCursor } from \"./shaderCodeCursor\";\r\nimport { ShaderCodeConditionNode } from \"./shaderCodeConditionNode\";\r\nimport { ShaderCodeTestNode } from \"./shaderCodeTestNode\";\r\nimport { ShaderDefineIsDefinedOperator } from \"./Expressions/Operators/shaderDefineIsDefinedOperator\";\r\nimport { ShaderDefineOrOperator } from \"./Expressions/Operators/shaderDefineOrOperator\";\r\nimport { ShaderDefineAndOperator } from \"./Expressions/Operators/shaderDefineAndOperator\";\r\nimport { ShaderDefineExpression } from \"./Expressions/shaderDefineExpression\";\r\nimport { ShaderDefineArithmeticOperator } from \"./Expressions/Operators/shaderDefineArithmeticOperator\";\r\nimport type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\n\r\nimport type { WebRequest } from \"../../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../../Misc/fileTools\";\r\nimport type { IOfflineProvider } from \"../../Offline/IOfflineProvider\";\r\nimport type { IFileRequest } from \"../../Misc/fileRequest\";\r\nimport { _getGlobalDefines } from \"../abstractEngine.functions\";\r\nimport type { AbstractEngine } from \"../abstractEngine\";\r\n\r\nconst regexSE = /defined\\s*?\\((.+?)\\)/g;\r\nconst regexSERevert = /defined\\s*?\\[(.+?)\\]/g;\r\nconst regexShaderInclude = /#include\\s?<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g;\r\nconst regexShaderDecl = /__decl__/;\r\nconst regexLightX = /light\\{X\\}.(\\w*)/g;\r\nconst regexX = /\\{X\\}/g;\r\nconst reusableMatches: RegExpMatchArray[] = [];\r\n\r\nconst _MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;\r\n\r\nexport function Initialize(options: ProcessingOptions): void {\r\n if (options.processor && options.processor.initializeShaders) {\r\n options.processor.initializeShaders(options.processingContext);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function Process(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine?: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes, options.defines);\r\n }\r\n const migratedCode = _ProcessShaderConversion(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function PreProcess(sourceCode: string, options: ProcessingOptions, callback: (migratedCode: string, codeBeforeMigration: string) => void, engine: AbstractEngine) {\r\n if (options.processor?.preProcessShaderCode) {\r\n sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);\r\n }\r\n _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {\r\n if (options.processCodeAfterIncludes) {\r\n codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? \"fragment\" : \"vertex\", codeWithIncludes, options.defines);\r\n }\r\n const migratedCode = _ApplyPreProcessing(codeWithIncludes, options, engine);\r\n callback(migratedCode, codeWithIncludes);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function Finalize(vertexCode: string, fragmentCode: string, options: ProcessingOptions): { vertexCode: string; fragmentCode: string } {\r\n if (!options.processor || !options.processor.finalizeShaders) {\r\n return { vertexCode, fragmentCode };\r\n }\r\n\r\n return options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext);\r\n}\r\n\r\nfunction _ProcessPrecision(source: string, options: ProcessingOptions): string {\r\n if (options.processor?.noPrecision) {\r\n return source;\r\n }\r\n\r\n const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;\r\n\r\n if (source.indexOf(\"precision highp float\") === -1) {\r\n if (!shouldUseHighPrecisionShader) {\r\n source = \"precision mediump float;\\n\" + source;\r\n } else {\r\n source = \"precision highp float;\\n\" + source;\r\n }\r\n } else {\r\n if (!shouldUseHighPrecisionShader) {\r\n // Moving highp to mediump\r\n source = source.replace(\"precision highp float\", \"precision mediump float\");\r\n }\r\n }\r\n\r\n return source;\r\n}\r\n\r\nfunction _ExtractOperation(expression: string) {\r\n const regex = /defined\\((.+)\\)/;\r\n\r\n const match = regex.exec(expression);\r\n\r\n if (match && match.length) {\r\n return new ShaderDefineIsDefinedOperator(match[1].trim(), expression[0] === \"!\");\r\n }\r\n\r\n const operators = [\"==\", \"!=\", \">=\", \"<=\", \"<\", \">\"];\r\n let operator = \"\";\r\n let indexOperator = 0;\r\n\r\n for (operator of operators) {\r\n indexOperator = expression.indexOf(operator);\r\n\r\n if (indexOperator > -1) {\r\n break;\r\n }\r\n }\r\n\r\n if (indexOperator === -1) {\r\n return new ShaderDefineIsDefinedOperator(expression);\r\n }\r\n\r\n const define = expression.substring(0, indexOperator).trim();\r\n const value = expression.substring(indexOperator + operator.length).trim();\r\n\r\n return new ShaderDefineArithmeticOperator(define, operator, value);\r\n}\r\n\r\nfunction _BuildSubExpression(expression: string): ShaderDefineExpression {\r\n expression = expression.replace(regexSE, \"defined[$1]\");\r\n\r\n const postfix = ShaderDefineExpression.infixToPostfix(expression);\r\n\r\n const stack: (string | ShaderDefineExpression)[] = [];\r\n\r\n for (const c of postfix) {\r\n if (c !== \"||\" && c !== \"&&\") {\r\n stack.push(c);\r\n } else if (stack.length >= 2) {\r\n let v1 = stack[stack.length - 1],\r\n v2 = stack[stack.length - 2];\r\n\r\n stack.length -= 2;\r\n\r\n const operator = c == \"&&\" ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();\r\n\r\n if (typeof v1 === \"string\") {\r\n v1 = v1.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n if (typeof v2 === \"string\") {\r\n v2 = v2.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n operator.leftOperand = typeof v2 === \"string\" ? _ExtractOperation(v2) : v2;\r\n operator.rightOperand = typeof v1 === \"string\" ? _ExtractOperation(v1) : v1;\r\n\r\n stack.push(operator);\r\n }\r\n }\r\n\r\n let result = stack[stack.length - 1];\r\n\r\n if (typeof result === \"string\") {\r\n result = result.replace(regexSERevert, \"defined($1)\");\r\n }\r\n\r\n // note: stack.length !== 1 if there was an error in the parsing\r\n\r\n return typeof result === \"string\" ? _ExtractOperation(result) : result;\r\n}\r\n\r\nfunction _BuildExpression(line: string, start: number): ShaderCodeTestNode {\r\n const node = new ShaderCodeTestNode();\r\n const command = line.substring(0, start);\r\n let expression = line.substring(start);\r\n\r\n expression = expression.substring(0, (expression.indexOf(\"//\") + 1 || expression.length + 1) - 1).trim();\r\n\r\n if (command === \"#ifdef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression);\r\n } else if (command === \"#ifndef\") {\r\n node.testExpression = new ShaderDefineIsDefinedOperator(expression, true);\r\n } else {\r\n node.testExpression = _BuildSubExpression(expression);\r\n }\r\n\r\n return node;\r\n}\r\n\r\nfunction _MoveCursorWithinIf(cursor: ShaderCodeCursor, rootNode: ShaderCodeConditionNode, ifNode: ShaderCodeNode) {\r\n let line = cursor.currentLine;\r\n while (_MoveCursor(cursor, ifNode)) {\r\n line = cursor.currentLine;\r\n const first5 = line.substring(0, 5).toLowerCase();\r\n\r\n if (first5 === \"#else\") {\r\n const elseNode = new ShaderCodeNode();\r\n rootNode.children.push(elseNode);\r\n _MoveCursor(cursor, elseNode);\r\n return;\r\n } else if (first5 === \"#elif\") {\r\n const elifNode = _BuildExpression(line, 5);\r\n\r\n rootNode.children.push(elifNode);\r\n ifNode = elifNode;\r\n }\r\n }\r\n}\r\n\r\nfunction _MoveCursor(cursor: ShaderCodeCursor, rootNode: ShaderCodeNode): boolean {\r\n while (cursor.canRead) {\r\n cursor.lineIndex++;\r\n const line = cursor.currentLine;\r\n\r\n if (line.indexOf(\"#\") >= 0) {\r\n const matches = _MoveCursorRegex.exec(line);\r\n\r\n if (matches && matches.length) {\r\n const keyword = matches[0];\r\n\r\n switch (keyword) {\r\n case \"#ifdef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 6);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#else\":\r\n case \"#elif\":\r\n return true;\r\n case \"#endif\":\r\n return false;\r\n case \"#ifndef\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n rootNode.children.push(newRootNode);\r\n\r\n const ifNode = _BuildExpression(line, 7);\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n case \"#if\": {\r\n const newRootNode = new ShaderCodeConditionNode();\r\n const ifNode = _BuildExpression(line, 3);\r\n rootNode.children.push(newRootNode);\r\n\r\n newRootNode.children.push(ifNode);\r\n _MoveCursorWithinIf(cursor, newRootNode, ifNode);\r\n break;\r\n }\r\n }\r\n continue;\r\n }\r\n }\r\n\r\n const newNode = new ShaderCodeNode();\r\n newNode.line = line;\r\n rootNode.children.push(newNode);\r\n\r\n // Detect additional defines\r\n if (line[0] === \"#\" && line[1] === \"d\") {\r\n const split = line.replace(\";\", \"\").split(\" \");\r\n newNode.additionalDefineKey = split[1];\r\n\r\n if (split.length === 3) {\r\n newNode.additionalDefineValue = split[2];\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction _EvaluatePreProcessors(sourceCode: string, preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n const rootNode = new ShaderCodeNode();\r\n const cursor = new ShaderCodeCursor();\r\n\r\n cursor.lineIndex = -1;\r\n cursor.lines = sourceCode.split(\"\\n\");\r\n\r\n // Decompose (We keep it in 2 steps so it is easier to maintain and perf hit is insignificant)\r\n _MoveCursor(cursor, rootNode);\r\n\r\n // Recompose\r\n return rootNode.process(preprocessors, options);\r\n}\r\n\r\nfunction _PreparePreProcessors(options: ProcessingOptions, engine?: AbstractEngine): { [key: string]: string } {\r\n const defines = options.defines;\r\n const preprocessors: { [key: string]: string } = {};\r\n\r\n for (const define of defines) {\r\n const keyValue = define.replace(\"#define\", \"\").replace(\";\", \"\").trim();\r\n const split = keyValue.split(\" \");\r\n preprocessors[split[0]] = split.length > 1 ? split[1] : \"\";\r\n }\r\n\r\n if (options.processor?.shaderLanguage === ShaderLanguage.GLSL) {\r\n preprocessors[\"GL_ES\"] = \"true\";\r\n }\r\n preprocessors[\"__VERSION__\"] = options.version;\r\n preprocessors[options.platformName] = \"true\";\r\n\r\n _getGlobalDefines(preprocessors, engine?.isNDCHalfZRange, engine?.useReverseDepthBuffer, engine?.useExactSrgbConversions);\r\n\r\n return preprocessors;\r\n}\r\n\r\nfunction _ProcessShaderConversion(sourceCode: string, options: ProcessingOptions, engine?: AbstractEngine): string {\r\n let preparedSourceCode = _ProcessPrecision(sourceCode, options);\r\n\r\n if (!options.processor) {\r\n return preparedSourceCode;\r\n }\r\n\r\n // Already converted\r\n if (options.processor.shaderLanguage === ShaderLanguage.GLSL && preparedSourceCode.indexOf(\"#version 3\") !== -1) {\r\n preparedSourceCode = preparedSourceCode.replace(\"#version 300 es\", \"\");\r\n if (!options.processor.parseGLES3) {\r\n return preparedSourceCode;\r\n }\r\n }\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine?._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\nfunction _ApplyPreProcessing(sourceCode: string, options: ProcessingOptions, engine: AbstractEngine): string {\r\n let preparedSourceCode = sourceCode;\r\n\r\n const defines = options.defines;\r\n\r\n const preprocessors = _PreparePreProcessors(options, engine);\r\n\r\n // General pre processing\r\n if (options.processor?.preProcessor) {\r\n preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);\r\n }\r\n\r\n preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);\r\n\r\n // Post processing\r\n if (options.processor?.postProcessor) {\r\n preparedSourceCode = options.processor.postProcessor(\r\n preparedSourceCode,\r\n defines,\r\n options.isFragment,\r\n options.processingContext,\r\n engine\r\n ? {\r\n drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,\r\n }\r\n : {}\r\n );\r\n }\r\n\r\n // Inline functions tagged with #define inline\r\n if (engine._features.needShaderCodeInlining) {\r\n preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);\r\n }\r\n\r\n return preparedSourceCode;\r\n}\r\n\r\n/** @internal */\r\nexport function _ProcessIncludes(sourceCode: string, options: ProcessingOptions, callback: (data: any) => void): void {\r\n reusableMatches.length = 0;\r\n let match: RegExpMatchArray | null;\r\n // stay back-compat to the old matchAll syntax\r\n while ((match = regexShaderInclude.exec(sourceCode)) !== null) {\r\n reusableMatches.push(match);\r\n }\r\n\r\n let returnValue = String(sourceCode);\r\n let parts = [sourceCode];\r\n\r\n let keepProcessing = false;\r\n\r\n for (const match of reusableMatches) {\r\n let includeFile = match[1];\r\n\r\n // Uniform declaration\r\n if (includeFile.indexOf(\"__decl__\") !== -1) {\r\n includeFile = includeFile.replace(regexShaderDecl, \"\");\r\n if (options.supportsUniformBuffers) {\r\n includeFile = includeFile.replace(\"Vertex\", \"Ubo\").replace(\"Fragment\", \"Ubo\");\r\n }\r\n includeFile = includeFile + \"Declaration\";\r\n }\r\n\r\n if (options.includesShadersStore[includeFile]) {\r\n // Substitution\r\n let includeContent = options.includesShadersStore[includeFile];\r\n if (match[2]) {\r\n const splits = match[3].split(\",\");\r\n\r\n for (let index = 0; index < splits.length; index += 2) {\r\n const source = new RegExp(splits[index], \"g\");\r\n const dest = splits[index + 1];\r\n\r\n includeContent = includeContent.replace(source, dest);\r\n }\r\n }\r\n\r\n if (match[4]) {\r\n const indexString = match[5];\r\n\r\n if (indexString.indexOf(\"..\") !== -1) {\r\n const indexSplits = indexString.split(\"..\");\r\n const minIndex = parseInt(indexSplits[0]);\r\n let maxIndex = parseInt(indexSplits[1]);\r\n let sourceIncludeContent = includeContent.slice(0);\r\n includeContent = \"\";\r\n\r\n if (isNaN(maxIndex)) {\r\n maxIndex = options.indexParameters[indexSplits[1]];\r\n }\r\n\r\n for (let i = minIndex; i < maxIndex; i++) {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n sourceIncludeContent = sourceIncludeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent += sourceIncludeContent.replace(regexX, i.toString()) + \"\\n\";\r\n }\r\n } else {\r\n if (!options.supportsUniformBuffers) {\r\n // Ubo replacement\r\n includeContent = includeContent.replace(regexLightX, (str: string, p1: string) => {\r\n return p1 + \"{X}\";\r\n });\r\n }\r\n includeContent = includeContent.replace(regexX, indexString);\r\n }\r\n }\r\n\r\n // Replace\r\n // Split all parts on match[0] and intersperse the parts with the include content\r\n const newParts = [];\r\n for (const part of parts) {\r\n const splitPart = part.split(match[0]);\r\n for (let i = 0; i < splitPart.length - 1; i++) {\r\n newParts.push(splitPart[i]);\r\n newParts.push(includeContent);\r\n }\r\n newParts.push(splitPart[splitPart.length - 1]);\r\n }\r\n parts = newParts;\r\n\r\n keepProcessing = keepProcessing || includeContent.indexOf(\"#include<\") >= 0 || includeContent.indexOf(\"#include <\") >= 0;\r\n } else {\r\n const includeShaderUrl = options.shadersRepository + \"ShadersInclude/\" + includeFile + \".fx\";\r\n\r\n _functionContainer.loadFile(includeShaderUrl, (fileContent) => {\r\n options.includesShadersStore[includeFile] = fileContent as string;\r\n _ProcessIncludes(parts.join(\"\"), options, callback);\r\n });\r\n return;\r\n }\r\n }\r\n reusableMatches.length = 0;\r\n\r\n returnValue = parts.join(\"\");\r\n\r\n if (keepProcessing) {\r\n _ProcessIncludes(returnValue.toString(), options, callback);\r\n } else {\r\n callback(returnValue);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _functionContainer = {\r\n /**\r\n * Loads a file from a url\r\n * @param url url to load\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param offlineProvider defines the offline provider for caching\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @returns a file request object\r\n * @internal\r\n */\r\n loadFile: (\r\n url: string,\r\n onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void,\r\n onProgress?: (ev: ProgressEvent) => void,\r\n offlineProvider?: IOfflineProvider,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void\r\n ): IFileRequest => {\r\n throw _WarnImport(\"FileTools\");\r\n },\r\n};\r\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ShaderLanguage } from "../../Materials/shaderLanguage.js";
|
|
2
1
|
const varyingRegex = /(flat\s)?\s*varying\s*.*/;
|
|
3
2
|
/** @internal */
|
|
4
3
|
export class WebGL2ShaderProcessor {
|
|
5
4
|
constructor() {
|
|
6
|
-
this.shaderLanguage = ShaderLanguage.GLSL
|
|
5
|
+
this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
|
|
7
6
|
}
|
|
8
7
|
attributeProcessor(attribute) {
|
|
9
8
|
return attribute.replace("attribute", "in");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webGL2ShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGL2ShaderProcessors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webGL2ShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGL2ShaderProcessors.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAAlC;QACW,mBAAc,+BAAuB;IA0ChD,CAAC;IAxCU,kBAAkB,CAAC,SAAiB;QACvC,OAAO,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAEM,YAAY,CAAC,OAAe,EAAE,WAAoB;QACrD,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,gBAAgB,CAAC,OAAe,EAAE,UAAmB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAEM,aAAa,CAAC,IAAY,EAAE,OAAiB,EAAE,UAAmB;QACrE,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC,0CAA0C,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/F,oBAAoB;QACpB,MAAM,KAAK,GAAG,gJAAgJ,CAAC;QAC/J,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAE/B,uBAAuB;QACvB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACnD,IAAI,UAAU,EAAE;YACZ,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kCAAkC,CAAC,KAAK,CAAC,CAAC,CAAC;YAEzE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;YAC5D,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;YAC9D,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;YACrD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;YACxD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YACpD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAClD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC,uBAAuB,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,8CAA8C,CAAC,GAAG,YAAY,CAAC,CAAC;SAC1J;aAAM;YACH,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,IAAI,qBAAqB,EAAE;gBACvB,OAAO,sEAAsE,GAAG,IAAI,CAAC;aACxF;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\nimport type { IShaderProcessor } from \"../Processors/iShaderProcessor\";\r\n\r\nconst varyingRegex = /(flat\\s)?\\s*varying\\s*.*/;\r\n\r\n/** @internal */\r\nexport class WebGL2ShaderProcessor implements IShaderProcessor {\r\n public shaderLanguage = ShaderLanguage.GLSL;\r\n\r\n public attributeProcessor(attribute: string) {\r\n return attribute.replace(\"attribute\", \"in\");\r\n }\r\n\r\n public varyingCheck(varying: string, _isFragment: boolean) {\r\n return varyingRegex.test(varying);\r\n }\r\n\r\n public varyingProcessor(varying: string, isFragment: boolean) {\r\n return varying.replace(\"varying\", isFragment ? \"in\" : \"out\");\r\n }\r\n\r\n public postProcessor(code: string, defines: string[], isFragment: boolean) {\r\n const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;\r\n\r\n // Remove extensions\r\n const regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;\r\n code = code.replace(regex, \"\");\r\n\r\n // Replace instructions\r\n code = code.replace(/texture2D\\s*\\(/g, \"texture(\");\r\n if (isFragment) {\r\n const hasOutput = code.search(/layout *\\(location *= *0\\) *out/g) !== -1;\r\n\r\n code = code.replace(/texture2DLodEXT\\s*\\(/g, \"textureLod(\");\r\n code = code.replace(/textureCubeLodEXT\\s*\\(/g, \"textureLod(\");\r\n code = code.replace(/textureCube\\s*\\(/g, \"texture(\");\r\n code = code.replace(/gl_FragDepthEXT/g, \"gl_FragDepth\");\r\n code = code.replace(/gl_FragColor/g, \"glFragColor\");\r\n code = code.replace(/gl_FragData/g, \"glFragData\");\r\n code = code.replace(/void\\s+?main\\s*\\(/g, (hasDrawBuffersExtension || hasOutput ? \"\" : \"layout(location = 0) out vec4 glFragColor;\\n\") + \"void main(\");\r\n } else {\r\n const hasMultiviewExtension = defines.indexOf(\"#define MULTIVIEW\") !== -1;\r\n if (hasMultiviewExtension) {\r\n return \"#extension GL_OVR_multiview2 : require\\nlayout (num_views = 2) in;\\n\" + code;\r\n }\r\n }\r\n\r\n return code;\r\n }\r\n}\r\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ShaderLanguage } from "../../Materials/shaderLanguage.js";
|
|
2
1
|
/** @internal */
|
|
3
2
|
export class WebGLShaderProcessor {
|
|
4
3
|
constructor() {
|
|
5
|
-
this.shaderLanguage = ShaderLanguage.GLSL
|
|
4
|
+
this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
|
|
6
5
|
}
|
|
7
6
|
postProcessor(code, defines, isFragment, processingContext, parameters) {
|
|
8
7
|
// Remove extensions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webGLShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGLShaderProcessors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webGLShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGLShaderProcessors.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IAAjC;QACW,mBAAc,+BAAuB;IAkBhD,CAAC;IAhBU,aAAa,CAChB,IAAY,EACZ,OAAiB,EACjB,UAAmB,EACnB,iBAAoD,EACpD,UAAoE;QAEpE,oBAAoB;QACpB,IAAI,UAAU,CAAC,4BAA4B,EAAE;YACzC,iHAAiH;YACjH,MAAM,KAAK,GAAG,oDAAoD,CAAC;YACnE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { IShaderProcessor } from \"../Processors/iShaderProcessor\";\r\nimport type { ShaderProcessingContext } from \"../Processors/shaderProcessingOptions\";\r\n\r\n/** @internal */\r\nexport class WebGLShaderProcessor implements IShaderProcessor {\r\n public shaderLanguage = ShaderLanguage.GLSL;\r\n\r\n public postProcessor(\r\n code: string,\r\n defines: string[],\r\n isFragment: boolean,\r\n processingContext: Nullable<ShaderProcessingContext>,\r\n parameters: { [key: string]: number | string | boolean | undefined }\r\n ) {\r\n // Remove extensions\r\n if (parameters.drawBuffersExtensionDisabled) {\r\n // even if enclosed in #if/#endif, IE11 does parse the #extension declaration, so we need to remove it altogether\r\n const regex = /#extension.+GL_EXT_draw_buffers.+(enable|require)/g;\r\n code = code.replace(regex, \"\");\r\n }\r\n\r\n return code;\r\n }\r\n}\r\n"]}
|
|
@@ -3,7 +3,6 @@ import { ComputeEffect } from "../../../Compute/computeEffect.js";
|
|
|
3
3
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
4
4
|
import { WebGPUComputeContext } from "../webgpuComputeContext.js";
|
|
5
5
|
import { WebGPUComputePipelineContext } from "../webgpuComputePipelineContext.js";
|
|
6
|
-
import * as WebGPUConstants from "../webgpuConstants.js";
|
|
7
6
|
const computePassDescriptor = {};
|
|
8
7
|
WebGPUEngine.prototype.createComputeContext = function () {
|
|
9
8
|
return new WebGPUComputeContext(this._device, this._cacheSampler);
|
|
@@ -46,7 +45,7 @@ WebGPUEngine.prototype._computeDispatch = function (effect, context, bindings, x
|
|
|
46
45
|
const computeContext = context;
|
|
47
46
|
if (!contextPipeline.computePipeline) {
|
|
48
47
|
contextPipeline.computePipeline = this._device.createComputePipeline({
|
|
49
|
-
layout: WebGPUConstants.AutoLayoutMode.Auto
|
|
48
|
+
layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
|
|
50
49
|
compute: contextPipeline.stage,
|
|
51
50
|
});
|
|
52
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.computeShader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.computeShader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAK/D,OAAO,EAAE,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C,6BAA6B,GAAG,UAAU,eAAwC;IACrG,MAAM,qBAAqB,GAAG,eAA+C,CAAC;IAC9E,IAAI,qBAAqB,EAAE;QACvB,eAAe,CAAC,OAAO,EAAE,CAAC;KAC7B;AACL,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,qCAAqC,GAAG,UAAU,aAAqB,EAAE,OAAyB,EAAE,UAAkB;IACzI,IAAI,OAAO,EAAE;QACT,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;KAC5D;SAAM;QACH,OAAO,GAAG,EAAE,CAAC;KAChB;IACD,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACpC,IAAI,EAAE,OAAO,GAAG,aAAa;SAChC,CAAC;QACF,UAAU;KACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Logger } from \"core/Misc/logger\";\r\nimport type { IComputeEffectCreationOptions, IComputeShaderPath } from \"../../../Compute/computeEffect\";\r\nimport { ComputeEffect } from \"../../../Compute/computeEffect\";\r\nimport type { IComputeContext } from \"../../../Compute/IComputeContext\";\r\nimport type { IComputePipelineContext } from \"../../../Compute/IComputePipelineContext\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { ComputeBindingList, ComputeBindingMapping, ComputeCompilationMessages } from \"../../Extensions/engine.computeShader\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPUComputeContext } from \"../webgpuComputeContext\";\r\nimport { WebGPUComputePipelineContext } from \"../webgpuComputePipelineContext\";\r\nimport * as WebGPUConstants from \"../webgpuConstants\";\r\nimport type { WebGPUPerfCounter } from \"../webgpuPerfCounter\";\r\nimport type { DataBuffer } from \"../../../Buffers/dataBuffer\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /** @internal */\r\n _createComputePipelineStageDescriptor(computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage;\r\n /** @internal\r\n * Either all of x,y,z or buffer and offset should be defined.\r\n */\r\n _computeDispatch(\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n ): void;\r\n }\r\n}\r\n\r\nconst computePassDescriptor: GPUComputePassDescriptor = {};\r\n\r\nWebGPUEngine.prototype.createComputeContext = function (): IComputeContext | undefined {\r\n return new WebGPUComputeContext(this._device, this._cacheSampler);\r\n};\r\n\r\nWebGPUEngine.prototype.createComputeEffect = function (baseName: string | (IComputeShaderPath & { computeToken?: string }), options: IComputeEffectCreationOptions): ComputeEffect {\r\n const compute = typeof baseName === \"string\" ? baseName : baseName.computeToken || baseName.computeSource || baseName.computeElement || baseName.compute;\r\n\r\n const name = compute + \"@\" + options.defines;\r\n if (this._compiledComputeEffects[name]) {\r\n const compiledEffect = <ComputeEffect>this._compiledComputeEffects[name];\r\n if (options.onCompiled && compiledEffect.isReady()) {\r\n options.onCompiled(compiledEffect);\r\n }\r\n\r\n return compiledEffect;\r\n }\r\n const effect = new ComputeEffect(baseName, options, this, name);\r\n this._compiledComputeEffects[name] = effect;\r\n\r\n return effect;\r\n};\r\n\r\nWebGPUEngine.prototype.createComputePipelineContext = function (): IComputePipelineContext {\r\n return new WebGPUComputePipelineContext(this);\r\n};\r\n\r\nWebGPUEngine.prototype.areAllComputeEffectsReady = function (): boolean {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n if (!effect.isReady()) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x: number,\r\n y = 1,\r\n z = 1,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, x, y, z, undefined, undefined, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatchIndirect = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n buffer: DataBuffer,\r\n offset: number = 0,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, undefined, undefined, undefined, buffer, offset, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype._computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._endCurrentRenderPass();\r\n\r\n const contextPipeline = effect._pipelineContext as WebGPUComputePipelineContext;\r\n const computeContext = context as WebGPUComputeContext;\r\n\r\n if (!contextPipeline.computePipeline) {\r\n contextPipeline.computePipeline = this._device.createComputePipeline({\r\n layout: WebGPUConstants.AutoLayoutMode.Auto,\r\n compute: contextPipeline.stage!,\r\n });\r\n }\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.startPass(computePassDescriptor, this._timestampIndex);\r\n }\r\n\r\n const computePass = this._renderEncoder.beginComputePass(computePassDescriptor);\r\n\r\n computePass.setPipeline(contextPipeline.computePipeline);\r\n\r\n const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);\r\n for (let i = 0; i < bindGroups.length; ++i) {\r\n const bindGroup = bindGroups[i];\r\n if (!bindGroup) {\r\n continue;\r\n }\r\n computePass.setBindGroup(i, bindGroup);\r\n }\r\n\r\n if (buffer !== undefined) {\r\n computePass.dispatchWorkgroupsIndirect(buffer.underlyingResource, <number>offset);\r\n } else {\r\n if (<number>x + <number>y + <number>z > 0) {\r\n computePass.dispatchWorkgroups(<number>x, <number>y, <number>z);\r\n }\r\n }\r\n computePass.end();\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.endPass(this._timestampIndex, gpuPerfCounter);\r\n this._timestampIndex += 2;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.releaseComputeEffects = function () {\r\n for (const name in this._compiledComputeEffects) {\r\n const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext() as WebGPUComputePipelineContext;\r\n this._deleteComputePipelineContext(webGPUPipelineContextCompute);\r\n }\r\n\r\n this._compiledComputeEffects = {};\r\n};\r\n\r\nWebGPUEngine.prototype._prepareComputePipelineContext = function (\r\n pipelineContext: IComputePipelineContext,\r\n computeSourceCode: string,\r\n rawComputeSourceCode: string,\r\n defines: Nullable<string>,\r\n entryPoint: string\r\n): void {\r\n const webGpuContext = pipelineContext as WebGPUComputePipelineContext;\r\n\r\n if (this.dbgShowShaderCode) {\r\n Logger.Log(defines!);\r\n Logger.Log(computeSourceCode);\r\n }\r\n\r\n webGpuContext.sources = {\r\n compute: computeSourceCode,\r\n rawCompute: rawComputeSourceCode,\r\n };\r\n\r\n webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);\r\n};\r\n\r\nWebGPUEngine.prototype._releaseComputeEffect = function (effect: ComputeEffect): void {\r\n if (this._compiledComputeEffects[effect._key]) {\r\n delete this._compiledComputeEffects[effect._key];\r\n\r\n this._deleteComputePipelineContext(effect.getPipelineContext() as WebGPUComputePipelineContext);\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._rebuildComputeEffects = function (): void {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n effect._pipelineContext = null;\r\n effect._wasPreviouslyReady = false;\r\n effect._prepareEffect();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._executeWhenComputeStateIsCompiled = function (\r\n pipelineContext: WebGPUComputePipelineContext,\r\n action: (messages: Nullable<ComputeCompilationMessages>) => void\r\n): void {\r\n pipelineContext.stage!.module.getCompilationInfo().then((info) => {\r\n const compilationMessages: ComputeCompilationMessages = {\r\n numErrors: 0,\r\n messages: [],\r\n };\r\n for (const message of info.messages) {\r\n if (message.type === \"error\") {\r\n compilationMessages.numErrors++;\r\n }\r\n compilationMessages.messages.push({\r\n type: message.type,\r\n text: message.message,\r\n line: message.lineNum,\r\n column: message.linePos,\r\n length: message.length,\r\n offset: message.offset,\r\n });\r\n }\r\n action(compilationMessages);\r\n });\r\n};\r\n\r\nWebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext: IComputePipelineContext): void {\r\n const webgpuPipelineContext = pipelineContext as WebGPUComputePipelineContext;\r\n if (webgpuPipelineContext) {\r\n pipelineContext.dispose();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage {\r\n if (defines) {\r\n defines = \"//\" + defines.split(\"\\n\").join(\"\\n//\") + \"\\n\";\r\n } else {\r\n defines = \"\";\r\n }\r\n return {\r\n module: this._device.createShaderModule({\r\n code: defines + computeShader,\r\n }),\r\n entryPoint,\r\n };\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"engine.computeShader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.computeShader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAK/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AA2B/E,MAAM,qBAA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E,UAAkB;IACzI,IAAI,OAAO,EAAE;QACT,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;KAC5D;SAAM;QACH,OAAO,GAAG,EAAE,CAAC;KAChB;IACD,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACpC,IAAI,EAAE,OAAO,GAAG,aAAa;SAChC,CAAC;QACF,UAAU;KACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Logger } from \"core/Misc/logger\";\r\nimport type { IComputeEffectCreationOptions, IComputeShaderPath } from \"../../../Compute/computeEffect\";\r\nimport { ComputeEffect } from \"../../../Compute/computeEffect\";\r\nimport type { IComputeContext } from \"../../../Compute/IComputeContext\";\r\nimport type { IComputePipelineContext } from \"../../../Compute/IComputePipelineContext\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { ComputeBindingList, ComputeBindingMapping, ComputeCompilationMessages } from \"../../Extensions/engine.computeShader\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPUComputeContext } from \"../webgpuComputeContext\";\r\nimport { WebGPUComputePipelineContext } from \"../webgpuComputePipelineContext\";\r\nimport * as WebGPUConstants from \"../webgpuConstants\";\r\nimport type { WebGPUPerfCounter } from \"../webgpuPerfCounter\";\r\nimport type { DataBuffer } from \"../../../Buffers/dataBuffer\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /** @internal */\r\n _createComputePipelineStageDescriptor(computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage;\r\n /** @internal\r\n * Either all of x,y,z or buffer and offset should be defined.\r\n */\r\n _computeDispatch(\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n ): void;\r\n }\r\n}\r\n\r\nconst computePassDescriptor: GPUComputePassDescriptor = {};\r\n\r\nWebGPUEngine.prototype.createComputeContext = function (): IComputeContext | undefined {\r\n return new WebGPUComputeContext(this._device, this._cacheSampler);\r\n};\r\n\r\nWebGPUEngine.prototype.createComputeEffect = function (baseName: string | (IComputeShaderPath & { computeToken?: string }), options: IComputeEffectCreationOptions): ComputeEffect {\r\n const compute = typeof baseName === \"string\" ? baseName : baseName.computeToken || baseName.computeSource || baseName.computeElement || baseName.compute;\r\n\r\n const name = compute + \"@\" + options.defines;\r\n if (this._compiledComputeEffects[name]) {\r\n const compiledEffect = <ComputeEffect>this._compiledComputeEffects[name];\r\n if (options.onCompiled && compiledEffect.isReady()) {\r\n options.onCompiled(compiledEffect);\r\n }\r\n\r\n return compiledEffect;\r\n }\r\n const effect = new ComputeEffect(baseName, options, this, name);\r\n this._compiledComputeEffects[name] = effect;\r\n\r\n return effect;\r\n};\r\n\r\nWebGPUEngine.prototype.createComputePipelineContext = function (): IComputePipelineContext {\r\n return new WebGPUComputePipelineContext(this);\r\n};\r\n\r\nWebGPUEngine.prototype.areAllComputeEffectsReady = function (): boolean {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n if (!effect.isReady()) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x: number,\r\n y = 1,\r\n z = 1,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, x, y, z, undefined, undefined, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatchIndirect = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n buffer: DataBuffer,\r\n offset: number = 0,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, undefined, undefined, undefined, buffer, offset, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype._computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._endCurrentRenderPass();\r\n\r\n const contextPipeline = effect._pipelineContext as WebGPUComputePipelineContext;\r\n const computeContext = context as WebGPUComputeContext;\r\n\r\n if (!contextPipeline.computePipeline) {\r\n contextPipeline.computePipeline = this._device.createComputePipeline({\r\n layout: WebGPUConstants.AutoLayoutMode.Auto,\r\n compute: contextPipeline.stage!,\r\n });\r\n }\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.startPass(computePassDescriptor, this._timestampIndex);\r\n }\r\n\r\n const computePass = this._renderEncoder.beginComputePass(computePassDescriptor);\r\n\r\n computePass.setPipeline(contextPipeline.computePipeline);\r\n\r\n const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);\r\n for (let i = 0; i < bindGroups.length; ++i) {\r\n const bindGroup = bindGroups[i];\r\n if (!bindGroup) {\r\n continue;\r\n }\r\n computePass.setBindGroup(i, bindGroup);\r\n }\r\n\r\n if (buffer !== undefined) {\r\n computePass.dispatchWorkgroupsIndirect(buffer.underlyingResource, <number>offset);\r\n } else {\r\n if (<number>x + <number>y + <number>z > 0) {\r\n computePass.dispatchWorkgroups(<number>x, <number>y, <number>z);\r\n }\r\n }\r\n computePass.end();\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.endPass(this._timestampIndex, gpuPerfCounter);\r\n this._timestampIndex += 2;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.releaseComputeEffects = function () {\r\n for (const name in this._compiledComputeEffects) {\r\n const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext() as WebGPUComputePipelineContext;\r\n this._deleteComputePipelineContext(webGPUPipelineContextCompute);\r\n }\r\n\r\n this._compiledComputeEffects = {};\r\n};\r\n\r\nWebGPUEngine.prototype._prepareComputePipelineContext = function (\r\n pipelineContext: IComputePipelineContext,\r\n computeSourceCode: string,\r\n rawComputeSourceCode: string,\r\n defines: Nullable<string>,\r\n entryPoint: string\r\n): void {\r\n const webGpuContext = pipelineContext as WebGPUComputePipelineContext;\r\n\r\n if (this.dbgShowShaderCode) {\r\n Logger.Log(defines!);\r\n Logger.Log(computeSourceCode);\r\n }\r\n\r\n webGpuContext.sources = {\r\n compute: computeSourceCode,\r\n rawCompute: rawComputeSourceCode,\r\n };\r\n\r\n webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);\r\n};\r\n\r\nWebGPUEngine.prototype._releaseComputeEffect = function (effect: ComputeEffect): void {\r\n if (this._compiledComputeEffects[effect._key]) {\r\n delete this._compiledComputeEffects[effect._key];\r\n\r\n this._deleteComputePipelineContext(effect.getPipelineContext() as WebGPUComputePipelineContext);\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._rebuildComputeEffects = function (): void {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n effect._pipelineContext = null;\r\n effect._wasPreviouslyReady = false;\r\n effect._prepareEffect();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._executeWhenComputeStateIsCompiled = function (\r\n pipelineContext: WebGPUComputePipelineContext,\r\n action: (messages: Nullable<ComputeCompilationMessages>) => void\r\n): void {\r\n pipelineContext.stage!.module.getCompilationInfo().then((info) => {\r\n const compilationMessages: ComputeCompilationMessages = {\r\n numErrors: 0,\r\n messages: [],\r\n };\r\n for (const message of info.messages) {\r\n if (message.type === \"error\") {\r\n compilationMessages.numErrors++;\r\n }\r\n compilationMessages.messages.push({\r\n type: message.type,\r\n text: message.message,\r\n line: message.lineNum,\r\n column: message.linePos,\r\n length: message.length,\r\n offset: message.offset,\r\n });\r\n }\r\n action(compilationMessages);\r\n });\r\n};\r\n\r\nWebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext: IComputePipelineContext): void {\r\n const webgpuPipelineContext = pipelineContext as WebGPUComputePipelineContext;\r\n if (webgpuPipelineContext) {\r\n pipelineContext.dispose();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage {\r\n if (defines) {\r\n defines = \"//\" + defines.split(\"\\n\").join(\"\\n//\") + \"\\n\";\r\n } else {\r\n defines = \"\";\r\n }\r\n return {\r\n module: this._device.createShaderModule({\r\n code: defines + computeShader,\r\n }),\r\n entryPoint,\r\n };\r\n};\r\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InternalTexture
|
|
1
|
+
import { InternalTexture } from "../../../Materials/Textures/internalTexture.js";
|
|
2
2
|
|
|
3
3
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
4
4
|
import { WebGPUTextureHelper } from "../webgpuTextureHelper.js";
|
|
5
5
|
WebGPUEngine.prototype._createDepthStencilCubeTexture = function (size, options) {
|
|
6
|
-
const internalTexture = new InternalTexture(this, options.generateStencil ? InternalTextureSource.DepthStencil : InternalTextureSource.Depth);
|
|
6
|
+
const internalTexture = new InternalTexture(this, options.generateStencil ? 12 /* InternalTextureSource.DepthStencil */ : 14 /* InternalTextureSource.Depth */);
|
|
7
7
|
internalTexture.isCube = true;
|
|
8
8
|
internalTexture.label = options.label;
|
|
9
9
|
const internalOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.cubeTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/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alTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { DepthTextureCreationOptions } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { WebGPUTextureHelper } from \"../webgpuTextureHelper\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\ndeclare module \"../../abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * @internal\r\n */\r\n _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;\r\n\r\n /**\r\n * Creates a depth stencil cube texture.\r\n * This is only available in WebGL 2.\r\n * @param size The size of face edge in the cube texture.\r\n * @param options The options defining the cube texture.\r\n * @returns The cube texture\r\n */\r\n _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param fallback defines texture to use while falling back when (compressed) texture file not found.\r\n * @param loaderOptions options to be passed to the loader\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @param buffer defines the data buffer to load instead of loading the rootUrl\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean | undefined,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n loaderOptions: any,\r\n useSRGBBuffer: boolean,\r\n buffer: Nullable<ArrayBufferView>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n createCubeTextureBase(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>,\r\n imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n useSRGBBuffer: boolean,\r\n buffer: Nullable<ArrayBufferView>\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n _partialLoadFile(\r\n url: string,\r\n index: number,\r\n loadedFiles: ArrayBuffer[],\r\n onfinish: (files: ArrayBuffer[]) => void,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>\r\n ): void;\r\n\r\n /** @internal */\r\n _cascadeLoadFiles(scene: Nullable<Scene>, onfinish: (images: ArrayBuffer[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void>): void;\r\n\r\n /** @internal */\r\n _cascadeLoadImgs(\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n files: string[],\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /** @internal */\r\n _partialLoadImg(\r\n url: string,\r\n index: number,\r\n loadedImages: HTMLImageElement[] | ImageBitmap[],\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /**\r\n * Force the mipmap generation for the given render target texture\r\n * @param texture defines the render target texture to use\r\n * @param unbind defines whether or not to unbind the texture after generation. Defaults to true.\r\n */\r\n generateMipMapsForCubemap(texture: InternalTexture, unbind?: boolean): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size: number, options: DepthTextureCreationOptions): InternalTexture {\r\n const internalTexture = new InternalTexture(this, options.generateStencil ? InternalTextureSource.DepthStencil : InternalTextureSource.Depth);\r\n\r\n internalTexture.isCube = true;\r\n internalTexture.label = options.label;\r\n\r\n const internalOptions = {\r\n bilinearFiltering: false,\r\n comparisonFunction: 0,\r\n generateStencil: false,\r\n samples: 1,\r\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n ...options,\r\n };\r\n\r\n internalTexture.format = internalOptions.depthTextureFormat;\r\n\r\n this._setupDepthStencilTexture(\r\n internalTexture,\r\n size,\r\n internalOptions.generateStencil,\r\n internalOptions.bilinearFiltering,\r\n internalOptions.comparisonFunction,\r\n internalOptions.samples\r\n );\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\r\n\r\n // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture\r\n const gpuTextureWrapper = internalTexture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);\r\n\r\n this._internalTexturesCache.push(internalTexture);\r\n\r\n return internalTexture;\r\n};\r\n\r\nWebGPUEngine.prototype.createCubeTexture = function (\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap?: boolean,\r\n onLoad: Nullable<(data?: any) => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format?: number,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0,\r\n lodOffset: number = 0,\r\n fallback: Nullable<InternalTexture> = null,\r\n loaderOptions?: any,\r\n useSRGBBuffer = false,\r\n buffer: Nullable<ArrayBufferView> = null\r\n): InternalTexture {\r\n return this.createCubeTextureBase(\r\n rootUrl,\r\n scene,\r\n files,\r\n !!noMipmap,\r\n onLoad,\r\n onError,\r\n format,\r\n forcedExtension,\r\n createPolynomials,\r\n lodScale,\r\n lodOffset,\r\n fallback,\r\n null,\r\n (texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => {\r\n const imageBitmaps = imgs as ImageBitmap[]; // we will always get an ImageBitmap array in WebGPU\r\n const width = imageBitmaps[0].width;\r\n const height = width;\r\n\r\n this._setCubeMapTextureParams(texture, !noMipmap);\r\n texture.format = format ?? -1;\r\n\r\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n\r\n this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, false, false, 0, 0);\r\n\r\n if (!noMipmap) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n },\r\n !!useSRGBBuffer,\r\n buffer\r\n );\r\n};\r\n\r\nWebGPUEngine.prototype._setCubeMapTextureParams = function (texture: InternalTexture, loadMipmap: boolean, maxLevel?: number) {\r\n texture.samplingMode = loadMipmap ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n if (maxLevel) {\r\n texture._maxLodLevel = maxLevel;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.generateMipMapsForCubemap = function (texture: InternalTexture) {\r\n if (texture.generateMipMaps) {\r\n const gpuTexture = texture._hardwareTexture?.underlyingResource;\r\n\r\n if (!gpuTexture) {\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n }\r\n\r\n this._generateMipmaps(texture);\r\n }\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"engine.cubeTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.cubeTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA4K7D,YAAY,CAAC,SAAS,CAAC,8BAA8B,GAAG,UAAU,IAAY,EAAE,OAAoC;IAChH,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,6CAAoC,CAAC,qCAA4B,CAAC,CAAC;IAE9I,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAEtC,MAAM,eAAe,GAAG;QACpB,iBAAiB,EAAE,KAAK;QACxB,kBAAkB,EAAE,CAAC;QACrB,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,CAAC;QACV,kBAAkB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CAAC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OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC;KACnC;AACL,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,yBAAyB,GAAG,UAAU,OAAwB;IACjF,IAAI,OAAO,CAAC,eAAe,EAAE;QACzB,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;QAEhE,IAAI,CAAC,UAAU,EAAE;YACb,IAAI,CAAC,cAAc,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;SACnE;QAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;KAClC;AACL,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { DepthTextureCreationOptions } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { WebGPUTextureHelper } from \"../webgpuTextureHelper\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\ndeclare module \"../../abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * @internal\r\n */\r\n _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;\r\n\r\n /**\r\n * Creates a depth stencil cube texture.\r\n * This is only available in WebGL 2.\r\n * @param size The size of face edge in the cube texture.\r\n * @param options The options defining the cube texture.\r\n * @returns The cube texture\r\n */\r\n _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param fallback defines texture to use while falling back when (compressed) texture file not found.\r\n * @param loaderOptions options to be passed to the loader\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @param buffer defines the data buffer to load instead of loading the rootUrl\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean | undefined,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n loaderOptions: any,\r\n useSRGBBuffer: boolean,\r\n buffer: Nullable<ArrayBufferView>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n createCubeTextureBase(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>,\r\n imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n useSRGBBuffer: boolean,\r\n buffer: Nullable<ArrayBufferView>\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n _partialLoadFile(\r\n url: string,\r\n index: number,\r\n loadedFiles: ArrayBuffer[],\r\n onfinish: (files: ArrayBuffer[]) => void,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>\r\n ): void;\r\n\r\n /** @internal */\r\n _cascadeLoadFiles(scene: Nullable<Scene>, onfinish: (images: ArrayBuffer[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void>): void;\r\n\r\n /** @internal */\r\n _cascadeLoadImgs(\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n files: string[],\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /** @internal */\r\n _partialLoadImg(\r\n url: string,\r\n index: number,\r\n loadedImages: HTMLImageElement[] | ImageBitmap[],\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /**\r\n * Force the mipmap generation for the given render target texture\r\n * @param texture defines the render target texture to use\r\n * @param unbind defines whether or not to unbind the texture after generation. Defaults to true.\r\n */\r\n generateMipMapsForCubemap(texture: InternalTexture, unbind?: boolean): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size: number, options: DepthTextureCreationOptions): InternalTexture {\r\n const internalTexture = new InternalTexture(this, options.generateStencil ? InternalTextureSource.DepthStencil : InternalTextureSource.Depth);\r\n\r\n internalTexture.isCube = true;\r\n internalTexture.label = options.label;\r\n\r\n const internalOptions = {\r\n bilinearFiltering: false,\r\n comparisonFunction: 0,\r\n generateStencil: false,\r\n samples: 1,\r\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n ...options,\r\n };\r\n\r\n internalTexture.format = internalOptions.depthTextureFormat;\r\n\r\n this._setupDepthStencilTexture(\r\n internalTexture,\r\n size,\r\n internalOptions.generateStencil,\r\n internalOptions.bilinearFiltering,\r\n internalOptions.comparisonFunction,\r\n internalOptions.samples\r\n );\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\r\n\r\n // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture\r\n const gpuTextureWrapper = internalTexture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);\r\n\r\n this._internalTexturesCache.push(internalTexture);\r\n\r\n return internalTexture;\r\n};\r\n\r\nWebGPUEngine.prototype.createCubeTexture = function (\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap?: boolean,\r\n onLoad: Nullable<(data?: any) => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format?: number,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0,\r\n lodOffset: number = 0,\r\n fallback: Nullable<InternalTexture> = null,\r\n loaderOptions?: any,\r\n useSRGBBuffer = false,\r\n buffer: Nullable<ArrayBufferView> = null\r\n): InternalTexture {\r\n return this.createCubeTextureBase(\r\n rootUrl,\r\n scene,\r\n files,\r\n !!noMipmap,\r\n onLoad,\r\n onError,\r\n format,\r\n forcedExtension,\r\n createPolynomials,\r\n lodScale,\r\n lodOffset,\r\n fallback,\r\n null,\r\n (texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => {\r\n const imageBitmaps = imgs as ImageBitmap[]; // we will always get an ImageBitmap array in WebGPU\r\n const width = imageBitmaps[0].width;\r\n const height = width;\r\n\r\n this._setCubeMapTextureParams(texture, !noMipmap);\r\n texture.format = format ?? -1;\r\n\r\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n\r\n this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, false, false, 0, 0);\r\n\r\n if (!noMipmap) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n },\r\n !!useSRGBBuffer,\r\n buffer\r\n );\r\n};\r\n\r\nWebGPUEngine.prototype._setCubeMapTextureParams = function (texture: InternalTexture, loadMipmap: boolean, maxLevel?: number) {\r\n texture.samplingMode = loadMipmap ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n if (maxLevel) {\r\n texture._maxLodLevel = maxLevel;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.generateMipMapsForCubemap = function (texture: InternalTexture) {\r\n if (texture.generateMipMaps) {\r\n const gpuTexture = texture._hardwareTexture?.underlyingResource;\r\n\r\n if (!gpuTexture) {\r\n this._textureHelper.createGPUTextureForInternalTexture(texture);\r\n }\r\n\r\n this._generateMipmaps(texture);\r\n }\r\n};\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InternalTexture
|
|
1
|
+
import { InternalTexture } from "../../../Materials/Textures/internalTexture.js";
|
|
2
2
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
3
3
|
import { GetExponentOfTwo } from "../../../Misc/tools.functions.js";
|
|
4
4
|
WebGPUEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
|
|
5
|
-
const texture = new InternalTexture(this, InternalTextureSource.Dynamic);
|
|
5
|
+
const texture = new InternalTexture(this, 4 /* InternalTextureSource.Dynamic */);
|
|
6
6
|
texture.baseWidth = width;
|
|
7
7
|
texture.baseHeight = height;
|
|
8
8
|
if (generateMipMaps) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqCjE,YAAY,CAAC,SAAS,CAAC,oBAAoB,GAAG,UAAU,KAAa,EAAE,MAAc,EAAE,eAAwB,EAAE,YAAoB;IACjI,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,wCAAgC,CAAC;IACzE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAE5B,IAAI,eAAe,EAAE;QACjB,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1F,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;KAChG;IAED,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IAC1C,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;I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AAG,OAAO,IAAI,KAAK,CAAC;IACnC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { ImageSource, Nullable } from \"../../../types\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { GetExponentOfTwo } from \"../../../Misc/tools.functions\";\r\nimport type { ICanvas } from \"../../../Engines/ICanvas\";\r\n\r\ndeclare module \"../../abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Creates a dynamic texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @returns the dynamic texture inside an InternalTexture\r\n */\r\n createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;\r\n\r\n /**\r\n * Update the content of a dynamic texture\r\n * @param texture defines the texture to update\r\n * @param source defines the source containing the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param premulAlpha defines if alpha is stored as premultiplied\r\n * @param format defines the format of the data\r\n * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)\r\n * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature \"allowGPUOptimizationsForGUI\" being true)\r\n */\r\n updateDynamicTexture(\r\n texture: Nullable<InternalTexture>,\r\n source: ImageSource | ICanvas,\r\n invertY?: boolean,\r\n premulAlpha?: boolean,\r\n format?: number,\r\n forceBindTexture?: boolean,\r\n allowGPUOptimization?: boolean\r\n ): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype.createDynamicTexture = function (width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Dynamic);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n\r\n if (generateMipMaps) {\r\n width = this.needPOTTextures ? GetExponentOfTwo(width, this._caps.maxTextureSize) : width;\r\n height = this.needPOTTextures ? GetExponentOfTwo(height, this._caps.maxTextureSize) : height;\r\n }\r\n\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = false;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n\r\n this.updateTextureSamplingMode(samplingMode, texture);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n if (width && height) {\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateDynamicTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n source: ImageSource,\r\n invertY: boolean,\r\n premulAlpha: boolean = false,\r\n format?: number,\r\n forceBindTexture?: boolean,\r\n allowGPUOptimization?: boolean\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n const width = source.width,\r\n height = source.height;\r\n\r\n let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n if (!texture._hardwareTexture?.underlyingResource) {\r\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n }\r\n\r\n this._textureHelper.updateTexture(source, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture);\r\n }\r\n\r\n texture._dynamicTextureSource = source;\r\n texture._premulAlpha = premulAlpha;\r\n texture.invertY = invertY || false;\r\n texture.isReady = true;\r\n};\r\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InternalTexture
|
|
1
|
+
import { InternalTexture } from "../../../Materials/Textures/internalTexture.js";
|
|
2
2
|
import { Logger } from "../../../Misc/logger.js";
|
|
3
3
|
|
|
4
4
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
@@ -126,7 +126,7 @@ WebGPUEngine.prototype.createMultipleRenderTarget = function (size, options, ini
|
|
|
126
126
|
if (target === -1) {
|
|
127
127
|
continue;
|
|
128
128
|
}
|
|
129
|
-
const texture = new InternalTexture(this, InternalTextureSource.MultiRenderTarget);
|
|
129
|
+
const texture = new InternalTexture(this, 6 /* InternalTextureSource.MultiRenderTarget */);
|
|
130
130
|
textures[i] = texture;
|
|
131
131
|
switch (target) {
|
|
132
132
|
case 34067:
|