@babylonjs/core 7.15.2 → 7.16.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/animationGroup.d.ts +1 -0
- package/Animations/animationGroup.js +4 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Collisions/gpuPicker.js +1 -1
- package/Collisions/gpuPicker.js.map +1 -1
- package/Compute/computeEffect.js +1 -1
- package/Compute/computeEffect.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +32 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +32 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +1993 -1993
- package/Engines/nativeEngine.d.ts +7 -0
- package/Engines/nativeEngine.js +24 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +3 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -6
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -7
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +4 -4
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +46 -40
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +2 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +10 -9
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +85 -69
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +54 -38
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +2 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +2 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +40 -32
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +53 -45
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -1
- package/Materials/Node/nodeMaterial.js +4 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -0
- package/Materials/Node/nodeMaterialBuildState.js +12 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +5 -0
- package/Materials/Textures/rawTexture.js +13 -0
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/effect.js +2 -2
- package/Materials/effect.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +12 -12
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +10 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +50 -11
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +6 -0
- package/Meshes/Node/nodeGeometry.js +7 -0
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -0
- package/Meshes/mesh.js +138 -134
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +1 -1
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +3 -3
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +13 -14
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlphaFresnel.js +4 -5
- package/Shaders/ShadersInclude/pbrBlockAlphaFresnel.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js +4 -5
- package/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAnisotropic.js +4 -5
- package/Shaders/ShadersInclude/pbrBlockAnisotropic.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js +34 -35
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockIridescence.js +10 -11
- package/Shaders/ShadersInclude/pbrBlockIridescence.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js +23 -24
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js +12 -13
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSheen.js +31 -32
- package/Shaders/ShadersInclude/pbrBlockSheen.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +43 -44
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
- package/Shaders/pbr.fragment.js +143 -153
- package/Shaders/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +3 -3
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/decalFragment.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/decalFragment.js +18 -0
- package/ShadersWGSL/ShadersInclude/decalFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/depthPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/depthPrePass.js +12 -0
- package/ShadersWGSL/ShadersInclude/depthPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/harmonicsFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/harmonicsFunctions.js +24 -0
- package/ShadersWGSL/ShadersInclude/harmonicsFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +39 -0
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +6 -2
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +2 -2
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/importanceSampling.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/importanceSampling.js +12 -0
- package/ShadersWGSL/ShadersInclude/importanceSampling.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +3 -3
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +139 -0
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js +81 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.js +37 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.js +35 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.js +46 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.js +267 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js +24 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.js +51 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +96 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +26 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.js +33 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.js +20 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.js +51 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js +19 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +19 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +30 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js +18 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +277 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +120 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSheen.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSheen.js +195 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSheen.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +425 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrDebug.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +193 -0
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js +43 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +68 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +30 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js +41 -0
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +23 -0
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -0
- package/package.json +1 -1
package/Engines/engine.d.ts
CHANGED
|
@@ -460,2652 +460,2652 @@ export declare class Engine extends ThinEngine {
|
|
|
460
460
|
|
|
461
461
|
// Mixins
|
|
462
462
|
declare global{
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
//
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
mozRequestAnimationFrame(callback: FrameRequestCallback): number;
|
|
472
|
-
oRequestAnimationFrame(callback: FrameRequestCallback): number;
|
|
473
|
-
WebGLRenderingContext: WebGLRenderingContext;
|
|
474
|
-
CANNON: any;
|
|
475
|
-
AudioContext: AudioContext;
|
|
476
|
-
webkitAudioContext: AudioContext;
|
|
477
|
-
PointerEvent: any;
|
|
478
|
-
Math: Math;
|
|
479
|
-
Uint8Array: Uint8ArrayConstructor;
|
|
480
|
-
Float32Array: Float32ArrayConstructor;
|
|
481
|
-
mozURL: typeof URL;
|
|
482
|
-
msURL: typeof URL;
|
|
483
|
-
DracoDecoderModule: any;
|
|
484
|
-
setImmediate(handler: (...args: any[]) => void): number;
|
|
463
|
+
// This file contains native only extensions for WebXR. These APIs are not supported in the browser yet.
|
|
464
|
+
// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
|
|
465
|
+
// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
|
|
466
|
+
|
|
467
|
+
type XRSceneObjectType = "unknown" | "background" | "wall" | "floor" | "ceiling" | "platform" | "inferred" | "world";
|
|
468
|
+
|
|
469
|
+
interface XRSceneObject {
|
|
470
|
+
type: XRSceneObjectType;
|
|
485
471
|
}
|
|
486
472
|
|
|
487
|
-
interface
|
|
488
|
-
|
|
473
|
+
interface XRFieldOfView {
|
|
474
|
+
angleLeft: number;
|
|
475
|
+
angleRight: number;
|
|
476
|
+
angleUp: number;
|
|
477
|
+
angleDown: number;
|
|
489
478
|
}
|
|
490
479
|
|
|
491
|
-
|
|
480
|
+
interface XRFrustum {
|
|
481
|
+
position: DOMPointReadOnly;
|
|
482
|
+
orientation: DOMPointReadOnly;
|
|
483
|
+
fieldOfView: XRFieldOfView;
|
|
484
|
+
farDistance: number;
|
|
485
|
+
}
|
|
492
486
|
|
|
493
|
-
interface
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
mozRequestPointerLock?(): void;
|
|
497
|
-
webkitRequestPointerLock?(): void;
|
|
487
|
+
interface XRPlane {
|
|
488
|
+
parentSceneObject?: XRSceneObject;
|
|
489
|
+
}
|
|
498
490
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
491
|
+
// extending the webxr XRMesh with babylon native properties
|
|
492
|
+
interface XRMesh {
|
|
493
|
+
normals?: Float32Array;
|
|
494
|
+
parentSceneObject?: XRSceneObject;
|
|
495
|
+
positions: Float32Array; // Babylon native!
|
|
503
496
|
}
|
|
504
497
|
|
|
505
|
-
interface
|
|
506
|
-
|
|
498
|
+
interface XRFrustumDetectionBoundary {
|
|
499
|
+
type: "frustum";
|
|
500
|
+
frustum: XRFrustum;
|
|
507
501
|
}
|
|
508
502
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
503
|
+
interface XRSphereDetectionBoundary {
|
|
504
|
+
type: "sphere";
|
|
505
|
+
radius: number;
|
|
512
506
|
}
|
|
513
507
|
|
|
514
|
-
interface
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
webkitMovementX: number;
|
|
518
|
-
webkitMovementY: number;
|
|
519
|
-
msMovementX: number;
|
|
520
|
-
msMovementY: number;
|
|
508
|
+
interface XRBoxDetectionBoundary {
|
|
509
|
+
type: "box";
|
|
510
|
+
extent: DOMPointReadOnly;
|
|
521
511
|
}
|
|
522
512
|
|
|
523
|
-
|
|
524
|
-
mozGetVRDevices: (any: any) => any;
|
|
525
|
-
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
526
|
-
mozGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
527
|
-
msGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
513
|
+
type XRDetectionBoundary = XRFrustumDetectionBoundary | XRSphereDetectionBoundary | XRBoxDetectionBoundary;
|
|
528
514
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
515
|
+
interface XRGeometryDetectorOptions {
|
|
516
|
+
detectionBoundary?: XRDetectionBoundary;
|
|
517
|
+
updateInterval?: number;
|
|
532
518
|
}
|
|
533
519
|
|
|
534
|
-
interface
|
|
535
|
-
|
|
520
|
+
interface XRSession {
|
|
521
|
+
trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
|
|
522
|
+
trySetPreferredPlaneDetectorOptions(preferredOptions: XRGeometryDetectorOptions): boolean;
|
|
523
|
+
trySetMeshDetectorEnabled(enabled: boolean): boolean;
|
|
524
|
+
trySetPreferredMeshDetectorOptions(preferredOptions: XRGeometryDetectorOptions): boolean;
|
|
536
525
|
}
|
|
537
526
|
|
|
538
|
-
interface
|
|
539
|
-
|
|
540
|
-
imul(a: number, b: number): number;
|
|
541
|
-
log2(x: number): number;
|
|
527
|
+
interface XRFrame {
|
|
528
|
+
featurePointCloud?: Array<number> | undefined;
|
|
542
529
|
}
|
|
543
530
|
|
|
544
|
-
interface
|
|
545
|
-
|
|
546
|
-
height: number;
|
|
531
|
+
interface XRWorldInformation {
|
|
532
|
+
detectedMeshes?: XRMeshSet;
|
|
547
533
|
}
|
|
534
|
+
|
|
535
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
536
|
+
// Type definitions for non-npm package webxr 0.5
|
|
537
|
+
// Project: https://www.w3.org/TR/webxr/
|
|
538
|
+
// Definitions by: Rob Rohan <https://github.com/robrohan>
|
|
539
|
+
// Raanan Weber <https://github.com/RaananW>
|
|
540
|
+
// Sean T. McBeth <https://github.com/capnmidnight>
|
|
541
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
542
|
+
// Minimum TypeScript Version: 3.7
|
|
548
543
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
//
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
type PressureState = "nominal" | "fair" | "serious" | "critical";
|
|
558
|
-
|
|
559
|
-
type PressureFactor = "thermal" | "power-supply";
|
|
544
|
+
// Most of this was hand written and... more or less copied from the following
|
|
545
|
+
// sites:
|
|
546
|
+
// https://www.w3.org/TR/webxr/
|
|
547
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API
|
|
548
|
+
// https://www.w3.org/immersive-web/
|
|
549
|
+
// https://github.com/immersive-web
|
|
550
|
+
//
|
|
560
551
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
552
|
+
/**
|
|
553
|
+
* ref: https://immersive-web.github.io/webxr/#navigator-xr-attribute
|
|
554
|
+
*/
|
|
555
|
+
interface Navigator {
|
|
556
|
+
/**
|
|
557
|
+
* An XRSystem object is the entry point to the API, used to query for XR features
|
|
558
|
+
* available to the user agent and initiate communication with XR hardware via the
|
|
559
|
+
* creation of XRSessions.
|
|
560
|
+
*/
|
|
561
|
+
xr?: XRSystem | undefined;
|
|
566
562
|
}
|
|
567
563
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
564
|
+
/**
|
|
565
|
+
* WebGL Context Compatability
|
|
566
|
+
*
|
|
567
|
+
* ref: https://immersive-web.github.io/webxr/#contextcompatibility
|
|
568
|
+
*/
|
|
569
|
+
interface WebGLContextAttributes {
|
|
570
|
+
xrCompatible?: boolean | undefined;
|
|
573
571
|
}
|
|
574
572
|
|
|
575
|
-
interface
|
|
576
|
-
|
|
573
|
+
interface WebGLRenderingContextBase {
|
|
574
|
+
makeXRCompatible(): Promise<void>;
|
|
577
575
|
}
|
|
578
576
|
|
|
579
|
-
|
|
577
|
+
/**
|
|
578
|
+
* Available session modes
|
|
579
|
+
*
|
|
580
|
+
* ref: https://immersive-web.github.io/webxr/#xrsessionmode-enum
|
|
581
|
+
*/
|
|
582
|
+
type XRSessionMode = "inline" | "immersive-vr" | "immersive-ar";
|
|
580
583
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
+
/**
|
|
585
|
+
* Reference space types
|
|
586
|
+
*/
|
|
587
|
+
type XRReferenceSpaceType = "viewer" | "local" | "local-floor" | "bounded-floor" | "unbounded";
|
|
588
|
+
|
|
589
|
+
type XREnvironmentBlendMode = "opaque" | "additive" | "alpha-blend";
|
|
584
590
|
|
|
585
|
-
knownSources: ReadonlyArray<PressureSource>;
|
|
586
|
-
};
|
|
587
|
-
|
|
588
591
|
/**
|
|
589
|
-
*
|
|
592
|
+
* ref: https://immersive-web.github.io/webxr/#xrsession-interface
|
|
593
|
+
*/
|
|
594
|
+
type XRVisibilityState = "visible" | "visible-blurred" | "hidden";
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Handedness types
|
|
590
598
|
*/
|
|
599
|
+
type XRHandedness = "none" | "left" | "right";
|
|
591
600
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
/**
|
|
602
|
+
* InputSource target ray modes
|
|
603
|
+
*/
|
|
604
|
+
type XRTargetRayMode = "gaze" | "tracked-pointer" | "screen" | "transient-pointer";
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Eye types
|
|
608
|
+
*/
|
|
609
|
+
type XREye = "none" | "left" | "right";
|
|
610
|
+
|
|
611
|
+
type XRFrameRequestCallback = (time: DOMHighResTimeStamp, frame: XRFrame) => void;
|
|
612
|
+
|
|
613
|
+
interface XRSystemDeviceChangeEvent extends Event {
|
|
614
|
+
type: "devicechange";
|
|
597
615
|
}
|
|
598
616
|
|
|
599
|
-
interface
|
|
600
|
-
|
|
601
|
-
type?: string;
|
|
617
|
+
interface XRSystemDeviceChangeEventHandler {
|
|
618
|
+
(event: XRSystemDeviceChangeEvent): any;
|
|
602
619
|
}
|
|
603
620
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
type OffscreenRenderingContextBJS = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
|
|
621
|
+
interface XRSystemEventMap {
|
|
622
|
+
devicechange: XRSystemDeviceChangeEvent;
|
|
623
|
+
}
|
|
608
624
|
|
|
609
|
-
|
|
625
|
+
/**
|
|
626
|
+
* An XRSystem object is the entry point to the API, used to query for XR features available
|
|
627
|
+
* to the user agent and initiate communication with XR hardware via the creation of
|
|
628
|
+
* XRSessions.
|
|
629
|
+
*
|
|
630
|
+
* ref: https://immersive-web.github.io/webxr/#xrsystem-interface
|
|
631
|
+
*/
|
|
632
|
+
interface XRSystem extends EventTarget {
|
|
610
633
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
634
|
+
* Attempts to initialize an XRSession for the given mode if possible, entering immersive
|
|
635
|
+
* mode if necessary.
|
|
636
|
+
* @param mode
|
|
637
|
+
* @param options
|
|
614
638
|
*/
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
|
|
639
|
+
requestSession(mode: XRSessionMode, options?: XRSessionInit): Promise<XRSession>;
|
|
640
|
+
|
|
618
641
|
/**
|
|
619
|
-
*
|
|
620
|
-
*
|
|
621
|
-
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
|
|
642
|
+
* Queries if a given mode may be supported by the user agent and device capabilities.
|
|
643
|
+
* @param mode
|
|
622
644
|
*/
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
*/
|
|
629
|
-
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
|
|
630
|
-
/**
|
|
631
|
-
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
|
|
632
|
-
*
|
|
633
|
-
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
|
|
634
|
-
*
|
|
635
|
-
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
|
|
636
|
-
*/
|
|
637
|
-
getContext(contextId: "2d", options?: any): OffscreenCanvasRenderingContext2D | null;
|
|
638
|
-
getContext(contextId: "bitmaprenderer", options?: any): ImageBitmapRenderingContext | null;
|
|
639
|
-
getContext(contextId: "webgl", options?: any): WebGLRenderingContext | null;
|
|
640
|
-
getContext(contextId: "webgl2", options?: any): WebGL2RenderingContext | null;
|
|
641
|
-
getContext(contextId: OffscreenRenderingContextIdBJS, options?: any): OffscreenRenderingContextBJS | null;
|
|
642
|
-
/** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. */
|
|
643
|
-
transferToImageBitmap(): ImageBitmap;
|
|
644
|
-
addEventListener<K extends keyof OffscreenCanvasEventMap>(
|
|
645
|
-
type: K,
|
|
646
|
-
listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any,
|
|
647
|
-
options?: boolean | AddEventListenerOptions
|
|
648
|
-
): void;
|
|
645
|
+
isSessionSupported(mode: XRSessionMode): Promise<boolean>;
|
|
646
|
+
|
|
647
|
+
ondevicechange: XRSystemDeviceChangeEventHandler | null;
|
|
648
|
+
|
|
649
|
+
addEventListener<K extends keyof XRSystemEventMap>(type: K, listener: (this: XRSystem, ev: XRSystemEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
649
650
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
650
|
-
removeEventListener<K extends keyof
|
|
651
|
-
type: K,
|
|
652
|
-
listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any,
|
|
653
|
-
options?: boolean | EventListenerOptions
|
|
654
|
-
): void;
|
|
651
|
+
removeEventListener<K extends keyof XRSystemEventMap>(type: K, listener: (this: XRSystem, ev: XRSystemEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
655
652
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
656
653
|
}
|
|
657
654
|
|
|
658
|
-
|
|
659
|
-
prototype: OffscreenCanvas;
|
|
660
|
-
new (width: number, height: number): OffscreenCanvas;
|
|
661
|
-
};
|
|
655
|
+
abstract class XRSystem implements XRSystem {}
|
|
662
656
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
CanvasRect,
|
|
674
|
-
CanvasShadowStyles,
|
|
675
|
-
CanvasState,
|
|
676
|
-
CanvasText,
|
|
677
|
-
CanvasTextDrawingStyles,
|
|
678
|
-
CanvasTransform {
|
|
679
|
-
readonly canvas: OffscreenCanvas;
|
|
680
|
-
commit(): void;
|
|
657
|
+
/**
|
|
658
|
+
* Describes a viewport, or rectangular region, of a graphics surface.
|
|
659
|
+
*
|
|
660
|
+
* ref: https://immersive-web.github.io/webxr/#xrviewport-interface
|
|
661
|
+
*/
|
|
662
|
+
interface XRViewport {
|
|
663
|
+
readonly x: number;
|
|
664
|
+
readonly y: number;
|
|
665
|
+
readonly width: number;
|
|
666
|
+
readonly height: number;
|
|
681
667
|
}
|
|
682
668
|
|
|
683
|
-
|
|
684
|
-
prototype: OffscreenCanvasRenderingContext2D;
|
|
685
|
-
new (): OffscreenCanvasRenderingContext2D;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
/* eslint-disable no-var */
|
|
689
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
690
|
-
// Type definitions for WebGL 2 extended with Babylon specific types
|
|
691
|
-
|
|
692
|
-
interface WebGL2RenderingContext extends WebGL2RenderingContextBase {
|
|
693
|
-
HALF_FLOAT_OES: number;
|
|
694
|
-
RGBA16F: typeof WebGL2RenderingContext.RGBA16F;
|
|
695
|
-
RGBA32F: typeof WebGL2RenderingContext.RGBA32F;
|
|
696
|
-
DEPTH24_STENCIL8: typeof WebGL2RenderingContext.DEPTH24_STENCIL8;
|
|
697
|
-
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;
|
|
698
|
-
COMPRESSED_SRGB_S3TC_DXT1_EXT: number;
|
|
699
|
-
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;
|
|
700
|
-
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;
|
|
701
|
-
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: number;
|
|
702
|
-
COMPRESSED_SRGB8_ETC2: number;
|
|
703
|
-
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: number;
|
|
704
|
-
DRAW_FRAMEBUFFER: typeof WebGL2RenderingContext.DRAW_FRAMEBUFFER;
|
|
705
|
-
UNSIGNED_INT_24_8: typeof WebGL2RenderingContext.UNSIGNED_INT_24_8;
|
|
706
|
-
MIN: typeof WebGL2RenderingContext.MIN;
|
|
707
|
-
MAX: typeof WebGL2RenderingContext.MAX;
|
|
708
|
-
}
|
|
669
|
+
abstract class XRViewport implements XRViewport {}
|
|
709
670
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
endQueryEXT(target: number): void;
|
|
721
|
-
getQueryObjectEXT(query: WebGLQuery, target: number): any;
|
|
722
|
-
deleteQueryEXT(query: WebGLQuery): void;
|
|
723
|
-
}
|
|
671
|
+
/**
|
|
672
|
+
* Represents a virtual coordinate system with an origin that corresponds to a physical location.
|
|
673
|
+
* Spatial data that is requested from the API or given to the API is always expressed in relation
|
|
674
|
+
* to a specific XRSpace at the time of a specific XRFrame. Numeric values such as pose positions
|
|
675
|
+
* are coordinates in that space relative to its origin. The interface is intentionally opaque.
|
|
676
|
+
*
|
|
677
|
+
* ref: https://immersive-web.github.io/webxr/#xrspace-interface
|
|
678
|
+
*/
|
|
679
|
+
// tslint:disable-next-line no-empty-interface
|
|
680
|
+
interface XRSpace extends EventTarget {}
|
|
724
681
|
|
|
725
|
-
|
|
726
|
-
__SPECTOR_rebuildProgram?:
|
|
727
|
-
| ((vertexSourceCode: string, fragmentSourceCode: string, onCompiled: (program: WebGLProgram) => void, onError: (message: string) => void) => void)
|
|
728
|
-
| null;
|
|
729
|
-
}
|
|
682
|
+
abstract class XRSpace implements XRSpace {}
|
|
730
683
|
|
|
731
|
-
interface
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
737
|
-
interface GPUObjectBase {
|
|
738
|
-
label: string | undefined;
|
|
684
|
+
interface XRRenderStateInit {
|
|
685
|
+
baseLayer?: XRWebGLLayer | undefined;
|
|
686
|
+
depthFar?: number | undefined;
|
|
687
|
+
depthNear?: number | undefined;
|
|
688
|
+
inlineVerticalFieldOfView?: number | undefined;
|
|
739
689
|
}
|
|
740
690
|
|
|
741
|
-
interface
|
|
742
|
-
|
|
691
|
+
interface XRRenderState {
|
|
692
|
+
readonly baseLayer?: XRWebGLLayer | undefined;
|
|
693
|
+
readonly depthFar: number;
|
|
694
|
+
readonly depthNear: number;
|
|
695
|
+
readonly inlineVerticalFieldOfView?: number | undefined;
|
|
743
696
|
}
|
|
744
697
|
|
|
745
|
-
|
|
746
|
-
[name: string]: number;
|
|
698
|
+
abstract class XRRenderState implements XRRenderState {}
|
|
747
699
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
readonly maxTextureArrayLayers: number;
|
|
752
|
-
readonly maxBindGroups: number;
|
|
753
|
-
readonly maxBindGroupsPlusVertexBuffers: number;
|
|
754
|
-
readonly maxBindingsPerBindGroup: number;
|
|
755
|
-
readonly maxDynamicUniformBuffersPerPipelineLayout: number;
|
|
756
|
-
readonly maxDynamicStorageBuffersPerPipelineLayout: number;
|
|
757
|
-
readonly maxSampledTexturesPerShaderStage: number;
|
|
758
|
-
readonly maxSamplersPerShaderStage: number;
|
|
759
|
-
readonly maxStorageBuffersPerShaderStage: number;
|
|
760
|
-
readonly maxStorageTexturesPerShaderStage: number;
|
|
761
|
-
readonly maxUniformBuffersPerShaderStage: number;
|
|
762
|
-
readonly maxUniformBufferBindingSize: number;
|
|
763
|
-
readonly maxStorageBufferBindingSize: number;
|
|
764
|
-
readonly minUniformBufferOffsetAlignment: number;
|
|
765
|
-
readonly minStorageBufferOffsetAlignment: number;
|
|
766
|
-
readonly maxVertexBuffers: number;
|
|
767
|
-
readonly maxBufferSize: number;
|
|
768
|
-
readonly maxVertexAttributes: number;
|
|
769
|
-
readonly maxVertexBufferArrayStride: number;
|
|
770
|
-
readonly maxInterStageShaderComponents: number;
|
|
771
|
-
readonly maxInterStageShaderVariables: number;
|
|
772
|
-
readonly maxColorAttachments: number;
|
|
773
|
-
readonly maxColorAttachmentBytesPerSample: number;
|
|
774
|
-
readonly maxComputeWorkgroupStorageSize: number;
|
|
775
|
-
readonly maxComputeInvocationsPerWorkgroup: number;
|
|
776
|
-
readonly maxComputeWorkgroupSizeX: number;
|
|
777
|
-
readonly maxComputeWorkgroupSizeY: number;
|
|
778
|
-
readonly maxComputeWorkgroupSizeZ: number;
|
|
779
|
-
readonly maxComputeWorkgroupsPerDimension: number;
|
|
700
|
+
interface XRReferenceSpaceEventInit extends EventInit {
|
|
701
|
+
referenceSpace?: XRReferenceSpace | undefined;
|
|
702
|
+
transform?: XRRigidTransform | undefined;
|
|
780
703
|
}
|
|
781
704
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
705
|
+
/**
|
|
706
|
+
* XRReferenceSpaceEvents are fired to indicate changes to the state of an XRReferenceSpace.
|
|
707
|
+
*
|
|
708
|
+
* ref: https://immersive-web.github.io/webxr/#xrreferencespaceevent-interface
|
|
709
|
+
*/
|
|
710
|
+
interface XRReferenceSpaceEvent extends Event {
|
|
711
|
+
readonly type: "reset";
|
|
712
|
+
readonly referenceSpace: XRReferenceSpace;
|
|
713
|
+
readonly transform?: XRRigidTransform | undefined;
|
|
714
|
+
}
|
|
785
715
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
readonly device: string;
|
|
790
|
-
readonly description: string;
|
|
716
|
+
// tslint:disable-next-line no-unnecessary-class
|
|
717
|
+
class XRReferenceSpaceEvent implements XRReferenceSpaceEvent {
|
|
718
|
+
constructor(type: "reset", eventInitDict?: XRReferenceSpaceEventInit);
|
|
791
719
|
}
|
|
792
720
|
|
|
793
|
-
interface
|
|
794
|
-
|
|
721
|
+
interface XRReferenceSpaceEventHandler {
|
|
722
|
+
(event: XRReferenceSpaceEvent): any;
|
|
795
723
|
}
|
|
796
724
|
|
|
797
|
-
interface
|
|
798
|
-
|
|
725
|
+
interface XRReferenceSpaceEventMap {
|
|
726
|
+
reset: XRReferenceSpaceEvent;
|
|
799
727
|
}
|
|
800
728
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
729
|
+
/**
|
|
730
|
+
* One of several common XRSpaces that applications can use to establish a spatial relationship
|
|
731
|
+
* with the user's physical environment.
|
|
732
|
+
*
|
|
733
|
+
* ref: https://immersive-web.github.io/webxr/#xrreferencespace-interface
|
|
734
|
+
*/
|
|
735
|
+
interface XRReferenceSpace extends XRSpace {
|
|
736
|
+
getOffsetReferenceSpace(originOffset: XRRigidTransform): XRReferenceSpace;
|
|
737
|
+
onreset: XRReferenceSpaceEventHandler;
|
|
804
738
|
|
|
805
|
-
|
|
739
|
+
addEventListener<K extends keyof XRReferenceSpaceEventMap>(
|
|
740
|
+
type: K,
|
|
741
|
+
listener: (this: XRReferenceSpace, ev: XRReferenceSpaceEventMap[K]) => any,
|
|
742
|
+
options?: boolean | AddEventListenerOptions
|
|
743
|
+
): void;
|
|
744
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
745
|
+
removeEventListener<K extends keyof XRReferenceSpaceEventMap>(
|
|
746
|
+
type: K,
|
|
747
|
+
listener: (this: XRReferenceSpace, ev: XRReferenceSpaceEventMap[K]) => any,
|
|
748
|
+
options?: boolean | EventListenerOptions
|
|
749
|
+
): void;
|
|
750
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
806
751
|
}
|
|
807
752
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
753
|
+
abstract class XRReferenceSpace implements XRReferenceSpace {}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Extends XRReferenceSpace to include boundsGeometry, indicating the pre-configured boundaries
|
|
757
|
+
* of the user's space.
|
|
758
|
+
*
|
|
759
|
+
* ref: https://immersive-web.github.io/webxr/#xrboundedreferencespace-interface
|
|
760
|
+
*/
|
|
761
|
+
interface XRBoundedReferenceSpace extends XRReferenceSpace {
|
|
762
|
+
readonly boundsGeometry: DOMPointReadOnly[];
|
|
811
763
|
}
|
|
812
764
|
|
|
813
|
-
|
|
765
|
+
abstract class XRBoundedReferenceSpace implements XRBoundedReferenceSpace {}
|
|
814
766
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Represents an XR input source, which is any input mechanism which allows the user to perform
|
|
769
|
+
* targeted actions in the same virtual space as the viewer. Example XR input sources include,
|
|
770
|
+
* but are not limited to, handheld controllers, optically tracked hands, and gaze-based input
|
|
771
|
+
* methods that operate on the viewer's pose. Input mechanisms which are not explicitly associated
|
|
772
|
+
* with the XR device, such as traditional gamepads, mice, or keyboards SHOULD NOT be considered
|
|
773
|
+
* XR input sources.
|
|
774
|
+
* ref: https://immersive-web.github.io/webxr/#xrinputsource-interface
|
|
775
|
+
*/
|
|
776
|
+
interface XRInputSource {
|
|
777
|
+
readonly handedness: XRHandedness;
|
|
778
|
+
readonly targetRayMode: XRTargetRayMode;
|
|
779
|
+
readonly targetRaySpace: XRSpace;
|
|
780
|
+
readonly gripSpace?: XRSpace | undefined;
|
|
781
|
+
readonly gamepad?: Gamepad | undefined;
|
|
782
|
+
readonly profiles: string[];
|
|
783
|
+
readonly hand?: XRHand;
|
|
830
784
|
}
|
|
831
785
|
|
|
832
|
-
|
|
833
|
-
| "depth-clip-control"
|
|
834
|
-
| "depth32float-stencil8"
|
|
835
|
-
| "texture-compression-bc"
|
|
836
|
-
| "texture-compression-etc2"
|
|
837
|
-
| "texture-compression-astc"
|
|
838
|
-
| "timestamp-query"
|
|
839
|
-
| "indirect-first-instance"
|
|
840
|
-
| "shader-f16"
|
|
841
|
-
| "rg11b10ufloat-renderable"
|
|
842
|
-
| "bgra8unorm-storage"
|
|
843
|
-
| "float32-filterable";
|
|
844
|
-
|
|
845
|
-
class GPUDevice extends EventTarget implements GPUObjectBase {
|
|
846
|
-
label: string | undefined;
|
|
786
|
+
abstract class XRInputSource implements XRInputSource {}
|
|
847
787
|
|
|
848
|
-
|
|
849
|
-
|
|
788
|
+
/**
|
|
789
|
+
* Represents a list of XRInputSources. It is used in favor of a frozen array type when the contents
|
|
790
|
+
* of the list are expected to change over time, such as with the XRSession inputSources attribute.
|
|
791
|
+
* ref: https://immersive-web.github.io/webxr/#xrinputsourcearray-interface
|
|
792
|
+
*/
|
|
793
|
+
interface XRInputSourceArray {
|
|
794
|
+
[Symbol.iterator](): IterableIterator<XRInputSource>;
|
|
795
|
+
[n: number]: XRInputSource;
|
|
850
796
|
|
|
851
|
-
|
|
797
|
+
length: number;
|
|
852
798
|
|
|
853
|
-
|
|
799
|
+
entries(): IterableIterator<[number, XRInputSource]>;
|
|
800
|
+
keys(): IterableIterator<number>;
|
|
801
|
+
values(): IterableIterator<XRInputSource>;
|
|
854
802
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
|
|
858
|
-
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
|
|
803
|
+
forEach(callbackfn: (value: XRInputSource, index: number, array: XRInputSource[]) => void, thisArg?: any): void;
|
|
804
|
+
}
|
|
859
805
|
|
|
860
|
-
|
|
861
|
-
createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout;
|
|
862
|
-
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
806
|
+
abstract class XRInputSourceArray implements XRInputSourceArray {}
|
|
863
807
|
|
|
864
|
-
|
|
808
|
+
/**
|
|
809
|
+
* Describes a position and orientation in space relative to an XRSpace.
|
|
810
|
+
*
|
|
811
|
+
* ref: https://immersive-web.github.io/webxr/#xrpose-interface
|
|
812
|
+
*/
|
|
813
|
+
interface XRPose {
|
|
814
|
+
readonly transform: XRRigidTransform;
|
|
815
|
+
readonly emulatedPosition: boolean;
|
|
816
|
+
}
|
|
865
817
|
|
|
866
|
-
|
|
867
|
-
createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
868
|
-
createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>;
|
|
869
|
-
createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
|
|
818
|
+
abstract class XRPose implements XRPose {}
|
|
870
819
|
|
|
871
|
-
|
|
872
|
-
|
|
820
|
+
/**
|
|
821
|
+
* Represents a snapshot of the state of all of the tracked objects for an XRSession. Applications
|
|
822
|
+
* can acquire an XRFrame by calling requestAnimationFrame() on an XRSession with an
|
|
823
|
+
* XRFrameRequestCallback. When the callback is called it will be passed an XRFrame.
|
|
824
|
+
* Events which need to communicate tracking state, such as the select event, will also provide an
|
|
825
|
+
* XRFrame.
|
|
826
|
+
*
|
|
827
|
+
* ref: https://immersive-web.github.io/webxr/#xrframe-interface
|
|
828
|
+
*/
|
|
829
|
+
interface XRFrame {
|
|
830
|
+
readonly session: XRSession;
|
|
831
|
+
// BABYLON CHANGE - switched to optional
|
|
832
|
+
readonly predictedDisplayTime?: DOMHighResTimeStamp;
|
|
873
833
|
|
|
874
|
-
|
|
834
|
+
/**
|
|
835
|
+
* Provides the pose of space relative to baseSpace as an XRPose, at the time represented by
|
|
836
|
+
* the XRFrame.
|
|
837
|
+
*
|
|
838
|
+
* @param space
|
|
839
|
+
* @param baseSpace
|
|
840
|
+
*/
|
|
841
|
+
getPose(space: XRSpace, baseSpace: XRSpace): XRPose | undefined;
|
|
875
842
|
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
843
|
+
/**
|
|
844
|
+
* Provides the pose of the viewer relative to referenceSpace as an XRViewerPose, at the
|
|
845
|
+
* XRFrame's time.
|
|
846
|
+
*
|
|
847
|
+
* @param referenceSpace
|
|
848
|
+
*/
|
|
849
|
+
getViewerPose(referenceSpace: XRReferenceSpace): XRViewerPose | undefined;
|
|
880
850
|
}
|
|
881
851
|
|
|
882
|
-
class
|
|
883
|
-
label: string | undefined;
|
|
884
|
-
|
|
885
|
-
readonly size: GPUSize64Out;
|
|
886
|
-
readonly usage: GPUFlagsConstant;
|
|
887
|
-
readonly mapState: GPUBufferMapState;
|
|
852
|
+
abstract class XRFrame implements XRFrame {}
|
|
888
853
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
854
|
+
/**
|
|
855
|
+
* Type of XR events available
|
|
856
|
+
*/
|
|
857
|
+
type XRInputSourceEventType = "select" | "selectend" | "selectstart" | "squeeze" | "squeezeend" | "squeezestart";
|
|
892
858
|
|
|
893
|
-
|
|
859
|
+
interface XRInputSourceEventInit extends EventInit {
|
|
860
|
+
frame?: XRFrame | undefined;
|
|
861
|
+
inputSource?: XRInputSource | undefined;
|
|
894
862
|
}
|
|
895
863
|
|
|
896
|
-
|
|
864
|
+
/**
|
|
865
|
+
* XRInputSourceEvents are fired to indicate changes to the state of an XRInputSource.
|
|
866
|
+
* ref: https://immersive-web.github.io/webxr/#xrinputsourceevent-interface
|
|
867
|
+
*/
|
|
868
|
+
class XRInputSourceEvent extends Event {
|
|
869
|
+
readonly type: XRInputSourceEventType;
|
|
870
|
+
readonly frame: XRFrame;
|
|
871
|
+
readonly inputSource: XRInputSource;
|
|
897
872
|
|
|
898
|
-
|
|
899
|
-
size: GPUSize64;
|
|
900
|
-
usage: GPUBufferUsageFlags;
|
|
901
|
-
mappedAtCreation: boolean /* default=false */;
|
|
873
|
+
constructor(type: XRInputSourceEventType, eventInitDict?: XRInputSourceEventInit);
|
|
902
874
|
}
|
|
903
875
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
class GPUTexture implements GPUObjectBase {
|
|
909
|
-
label: string | undefined;
|
|
876
|
+
interface XRInputSourceEventHandler {
|
|
877
|
+
(evt: XRInputSourceEvent): any;
|
|
878
|
+
}
|
|
910
879
|
|
|
911
|
-
|
|
912
|
-
destroy(): void;
|
|
880
|
+
type XRSessionEventType = "end" | "visibilitychange" | "frameratechange";
|
|
913
881
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
readonly depthOrArrayLayers: GPUIntegerCoordinateOut;
|
|
917
|
-
readonly mipLevelCount: GPUIntegerCoordinateOut;
|
|
918
|
-
readonly sampleCount: GPUSize32Out;
|
|
919
|
-
readonly dimension: GPUTextureDimension;
|
|
920
|
-
readonly format: GPUTextureFormat;
|
|
921
|
-
readonly usage: GPUFlagsConstant;
|
|
882
|
+
interface XRSessionEventInit extends EventInit {
|
|
883
|
+
session: XRSession;
|
|
922
884
|
}
|
|
923
885
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
viewFormats?: GPUTextureFormat[] /* default=[] */;
|
|
886
|
+
/**
|
|
887
|
+
* XRSessionEvents are fired to indicate changes to the state of an XRSession.
|
|
888
|
+
* ref: https://immersive-web.github.io/webxr/#xrsessionevent-interface
|
|
889
|
+
*/
|
|
890
|
+
class XRSessionEvent extends Event {
|
|
891
|
+
readonly session: XRSession;
|
|
892
|
+
constructor(type: XRSessionEventType, eventInitDict?: XRSessionEventInit);
|
|
932
893
|
}
|
|
933
894
|
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
895
|
+
interface XRSessionEventHandler {
|
|
896
|
+
(evt: XRSessionEvent): any;
|
|
897
|
+
}
|
|
937
898
|
|
|
938
|
-
|
|
939
|
-
|
|
899
|
+
/**
|
|
900
|
+
* ref: https://immersive-web.github.io/webxr/#feature-dependencies
|
|
901
|
+
*/
|
|
902
|
+
interface XRSessionInit {
|
|
903
|
+
optionalFeatures?: string[] | undefined;
|
|
904
|
+
requiredFeatures?: string[] | undefined;
|
|
940
905
|
}
|
|
941
906
|
|
|
942
|
-
interface
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
907
|
+
interface XRSessionEventMap {
|
|
908
|
+
inputsourceschange: XRInputSourceChangeEvent;
|
|
909
|
+
end: XRSessionEvent;
|
|
910
|
+
visibilitychange: XRSessionEvent;
|
|
911
|
+
frameratechange: XRSessionEvent;
|
|
912
|
+
select: XRInputSourceEvent;
|
|
913
|
+
selectstart: XRInputSourceEvent;
|
|
914
|
+
selectend: XRInputSourceEvent;
|
|
915
|
+
squeeze: XRInputSourceEvent;
|
|
916
|
+
squeezestart: XRInputSourceEvent;
|
|
917
|
+
squeezeend: XRInputSourceEvent;
|
|
918
|
+
eyetrackingstart: XREyeTrackingSourceEvent;
|
|
919
|
+
eyetrackingend: XREyeTrackingSourceEvent;
|
|
950
920
|
}
|
|
951
921
|
|
|
952
|
-
|
|
922
|
+
/**
|
|
923
|
+
* Any interaction with XR hardware is done via an XRSession object, which can only be
|
|
924
|
+
* retrieved by calling requestSession() on the XRSystem object. Once a session has been
|
|
925
|
+
* successfully acquired, it can be used to poll the viewer pose, query information about
|
|
926
|
+
* the user's environment, and present imagery to the user.
|
|
927
|
+
*
|
|
928
|
+
* ref: https://immersive-web.github.io/webxr/#xrsession-interface
|
|
929
|
+
*/
|
|
930
|
+
interface XRSession extends EventTarget {
|
|
931
|
+
/**
|
|
932
|
+
* Returns a list of this session's XRInputSources, each representing an input device
|
|
933
|
+
* used to control the camera and/or scene.
|
|
934
|
+
*/
|
|
935
|
+
readonly inputSources: XRInputSourceArray;
|
|
936
|
+
/**
|
|
937
|
+
* object which contains options affecting how the imagery is rendered.
|
|
938
|
+
* This includes things such as the near and far clipping planes
|
|
939
|
+
*/
|
|
940
|
+
readonly renderState: XRRenderState;
|
|
941
|
+
readonly environmentBlendMode: XREnvironmentBlendMode;
|
|
942
|
+
readonly visibilityState: XRVisibilityState;
|
|
943
|
+
readonly frameRate?: number | undefined;
|
|
944
|
+
readonly supportedFrameRates?: Float32Array | undefined;
|
|
953
945
|
|
|
954
|
-
|
|
946
|
+
/**
|
|
947
|
+
* Removes a callback from the animation frame painting callback from
|
|
948
|
+
* XRSession's set of animation frame rendering callbacks, given the
|
|
949
|
+
* identifying handle returned by a previous call to requestAnimationFrame().
|
|
950
|
+
*/
|
|
951
|
+
cancelAnimationFrame(id: number): void;
|
|
955
952
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
| "r8sint"
|
|
953
|
+
/**
|
|
954
|
+
* Ends the WebXR session. Returns a promise which resolves when the
|
|
955
|
+
* session has been shut down.
|
|
956
|
+
*/
|
|
957
|
+
end(): Promise<void>;
|
|
962
958
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
959
|
+
/**
|
|
960
|
+
* Schedules the specified method to be called the next time the user agent
|
|
961
|
+
* is working on rendering an animation frame for the WebXR device. Returns an
|
|
962
|
+
* integer value which can be used to identify the request for the purposes of
|
|
963
|
+
* canceling the callback using cancelAnimationFrame(). This method is comparable
|
|
964
|
+
* to the Window.requestAnimationFrame() method.
|
|
965
|
+
*/
|
|
966
|
+
requestAnimationFrame(callback: XRFrameRequestCallback): number;
|
|
971
967
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
|
979
|
-
| "rgba8unorm"
|
|
980
|
-
| "rgba8unorm-srgb"
|
|
981
|
-
| "rgba8snorm"
|
|
982
|
-
| "rgba8uint"
|
|
983
|
-
| "rgba8sint"
|
|
984
|
-
| "bgra8unorm"
|
|
985
|
-
| "bgra8unorm-srgb"
|
|
986
|
-
// Packed 32-bit formats
|
|
987
|
-
| "rgb9e5ufloat"
|
|
988
|
-
| "rgb10a2uint"
|
|
989
|
-
| "rgb10a2unorm"
|
|
990
|
-
| "rg11b10ufloat"
|
|
968
|
+
/**
|
|
969
|
+
* Requests that a new XRReferenceSpace of the specified type be created.
|
|
970
|
+
* Returns a promise which resolves with the XRReferenceSpace or
|
|
971
|
+
* XRBoundedReferenceSpace which was requested, or throws a NotSupportedError if
|
|
972
|
+
* the requested space type isn't supported by the device.
|
|
973
|
+
*/
|
|
974
|
+
requestReferenceSpace(type: XRReferenceSpaceType): Promise<XRReferenceSpace | XRBoundedReferenceSpace>;
|
|
991
975
|
|
|
992
|
-
|
|
993
|
-
| "rg32uint"
|
|
994
|
-
| "rg32sint"
|
|
995
|
-
| "rg32float"
|
|
996
|
-
| "rgba16uint"
|
|
997
|
-
| "rgba16sint"
|
|
998
|
-
| "rgba16float"
|
|
976
|
+
updateRenderState(renderStateInit?: XRRenderStateInit): Promise<void>;
|
|
999
977
|
|
|
1000
|
-
|
|
1001
|
-
| "rgba32uint"
|
|
1002
|
-
| "rgba32sint"
|
|
1003
|
-
| "rgba32float"
|
|
978
|
+
updateTargetFrameRate(rate: number): Promise<void>;
|
|
1004
979
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
980
|
+
onend: XRSessionEventHandler;
|
|
981
|
+
oninputsourceschange: XRInputSourceChangeEventHandler;
|
|
982
|
+
onselect: XRInputSourceEventHandler;
|
|
983
|
+
onselectstart: XRInputSourceEventHandler;
|
|
984
|
+
onselectend: XRInputSourceEventHandler;
|
|
985
|
+
onsqueeze: XRInputSourceEventHandler;
|
|
986
|
+
onsqueezestart: XRInputSourceEventHandler;
|
|
987
|
+
onsqueezeend: XRInputSourceEventHandler;
|
|
988
|
+
onvisibilitychange: XRSessionEventHandler;
|
|
989
|
+
onframeratechange: XRSessionEventHandler;
|
|
1011
990
|
|
|
1012
|
-
|
|
1013
|
-
|
|
|
991
|
+
addEventListener<K extends keyof XRSessionEventMap>(type: K, listener: (this: XRSession, ev: XRSessionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
992
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
993
|
+
removeEventListener<K extends keyof XRSessionEventMap>(type: K, listener: (this: XRSession, ev: XRSessionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
994
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
995
|
+
}
|
|
1014
996
|
|
|
1015
|
-
|
|
1016
|
-
// supported by the device/user agent and enabled in requestDevice.
|
|
1017
|
-
| "bc1-rgba-unorm"
|
|
1018
|
-
| "bc1-rgba-unorm-srgb"
|
|
1019
|
-
| "bc2-rgba-unorm"
|
|
1020
|
-
| "bc2-rgba-unorm-srgb"
|
|
1021
|
-
| "bc3-rgba-unorm"
|
|
1022
|
-
| "bc3-rgba-unorm-srgb"
|
|
1023
|
-
| "bc4-r-unorm"
|
|
1024
|
-
| "bc4-r-snorm"
|
|
1025
|
-
| "bc5-rg-unorm"
|
|
1026
|
-
| "bc5-rg-snorm"
|
|
1027
|
-
| "bc6h-rgb-ufloat"
|
|
1028
|
-
| "bc6h-rgb-float"
|
|
1029
|
-
| "bc7-rgba-unorm"
|
|
1030
|
-
| "bc7-rgba-unorm-srgb"
|
|
997
|
+
abstract class XRSession implements XRSession {}
|
|
1031
998
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
999
|
+
/**
|
|
1000
|
+
* An XRPose describing the state of a viewer of the XR scene as tracked by the XR
|
|
1001
|
+
* device. A viewer may represent a tracked piece of hardware, the observed position
|
|
1002
|
+
* of a user's head relative to the hardware, or some other means of computing a series
|
|
1003
|
+
* of viewpoints into the XR scene. XRViewerPoses can only be queried relative to an
|
|
1004
|
+
* XRReferenceSpace. It provides, in addition to the XRPose values, an array of views
|
|
1005
|
+
* which include rigid transforms to indicate the viewpoint and projection matrices.
|
|
1006
|
+
* These values should be used by the application when rendering a frame of an XR scene.
|
|
1007
|
+
*
|
|
1008
|
+
* ref: https://immersive-web.github.io/webxr/#xrviewerpose-interface
|
|
1009
|
+
*/
|
|
1010
|
+
interface XRViewerPose extends XRPose {
|
|
1011
|
+
readonly views: ReadonlyArray<XRView>;
|
|
1012
|
+
}
|
|
1044
1013
|
|
|
1045
|
-
|
|
1046
|
-
// supported by the device/user agent and enabled in requestDevice.
|
|
1047
|
-
| "astc-4x4-unorm"
|
|
1048
|
-
| "astc-4x4-unorm-srgb"
|
|
1049
|
-
| "astc-5x4-unorm"
|
|
1050
|
-
| "astc-5x4-unorm-srgb"
|
|
1051
|
-
| "astc-5x5-unorm"
|
|
1052
|
-
| "astc-5x5-unorm-srgb"
|
|
1053
|
-
| "astc-6x5-unorm"
|
|
1054
|
-
| "astc-6x5-unorm-srgb"
|
|
1055
|
-
| "astc-6x6-unorm"
|
|
1056
|
-
| "astc-6x6-unorm-srgb"
|
|
1057
|
-
| "astc-8x5-unorm"
|
|
1058
|
-
| "astc-8x5-unorm-srgb"
|
|
1059
|
-
| "astc-8x6-unorm"
|
|
1060
|
-
| "astc-8x6-unorm-srgb"
|
|
1061
|
-
| "astc-8x8-unorm"
|
|
1062
|
-
| "astc-8x8-unorm-srgb"
|
|
1063
|
-
| "astc-10x5-unorm"
|
|
1064
|
-
| "astc-10x5-unorm-srgb"
|
|
1065
|
-
| "astc-10x6-unorm"
|
|
1066
|
-
| "astc-10x6-unorm-srgb"
|
|
1067
|
-
| "astc-10x8-unorm"
|
|
1068
|
-
| "astc-10x8-unorm-srgb"
|
|
1069
|
-
| "astc-10x10-unorm"
|
|
1070
|
-
| "astc-10x10-unorm-srgb"
|
|
1071
|
-
| "astc-12x10-unorm"
|
|
1072
|
-
| "astc-12x10-unorm-srgb"
|
|
1073
|
-
| "astc-12x12-unorm"
|
|
1074
|
-
| "astc-12x12-unorm-srgb";
|
|
1014
|
+
abstract class XRViewerPose implements XRViewerPose {}
|
|
1075
1015
|
|
|
1076
|
-
|
|
1077
|
-
|
|
1016
|
+
/**
|
|
1017
|
+
* A transform described by a position and orientation. When interpreting an
|
|
1018
|
+
* XRRigidTransform the orientation is always applied prior to the position.
|
|
1019
|
+
*
|
|
1020
|
+
* ref: https://immersive-web.github.io/webxr/#xrrigidtransform-interface
|
|
1021
|
+
*/
|
|
1022
|
+
class XRRigidTransform {
|
|
1023
|
+
readonly position: DOMPointReadOnly;
|
|
1024
|
+
readonly orientation: DOMPointReadOnly;
|
|
1025
|
+
readonly matrix: Float32Array;
|
|
1026
|
+
readonly inverse: XRRigidTransform;
|
|
1027
|
+
|
|
1028
|
+
constructor(position?: DOMPointInit, direction?: DOMPointInit);
|
|
1078
1029
|
}
|
|
1079
1030
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1031
|
+
/**
|
|
1032
|
+
* Describes a single view into an XR scene for a given frame.
|
|
1033
|
+
*
|
|
1034
|
+
* ref: https://immersive-web.github.io/webxr/#xrview-interface
|
|
1035
|
+
*/
|
|
1036
|
+
interface XRView {
|
|
1037
|
+
readonly eye: XREye;
|
|
1038
|
+
readonly projectionMatrix: Float32Array;
|
|
1039
|
+
readonly transform: XRRigidTransform;
|
|
1040
|
+
readonly recommendedViewportScale?: number | undefined;
|
|
1041
|
+
requestViewportScale(scale: number): void;
|
|
1083
1042
|
}
|
|
1084
1043
|
|
|
1085
|
-
class
|
|
1086
|
-
|
|
1044
|
+
abstract class XRView implements XRView {}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* XRInputSourcesChangeEvents are fired to indicate changes to the XRInputSources that are
|
|
1048
|
+
* available to an XRSession.
|
|
1049
|
+
* ref: https://immersive-web.github.io/webxr/#xrinputsourceschangeevent-interface
|
|
1050
|
+
*/
|
|
1051
|
+
interface XRInputSourceChangeEvent extends XRSessionEvent {
|
|
1052
|
+
readonly removed: ReadonlyArray<XRInputSource>;
|
|
1053
|
+
readonly added: ReadonlyArray<XRInputSource>;
|
|
1087
1054
|
}
|
|
1088
1055
|
|
|
1089
|
-
interface
|
|
1090
|
-
|
|
1091
|
-
addressModeV?: GPUAddressMode /* default="clamp-to-edge" */;
|
|
1092
|
-
addressModeW?: GPUAddressMode /* default="clamp-to-edge" */;
|
|
1093
|
-
magFilter?: GPUFilterMode /* default="nearest" */;
|
|
1094
|
-
minFilter?: GPUFilterMode /* default="nearest" */;
|
|
1095
|
-
mipmapFilter?: GPUMipmapFilterMode /* default="nearest" */;
|
|
1096
|
-
lodMinClamp?: number /* default=0 */;
|
|
1097
|
-
lodMaxClamp?: number /* default=32 */;
|
|
1098
|
-
compare?: GPUCompareFunction;
|
|
1099
|
-
maxAnisotropy?: number /* default=1 */;
|
|
1056
|
+
interface XRInputSourceChangeEventHandler {
|
|
1057
|
+
(evt: XRInputSourceChangeEvent): any;
|
|
1100
1058
|
}
|
|
1101
1059
|
|
|
1102
|
-
|
|
1060
|
+
// Experimental/Draft features
|
|
1103
1061
|
|
|
1104
|
-
|
|
1062
|
+
// Anchors
|
|
1063
|
+
type XRAnchorSet = Set<XRAnchor>;
|
|
1105
1064
|
|
|
1106
|
-
|
|
1065
|
+
interface XRAnchor {
|
|
1066
|
+
anchorSpace: XRSpace;
|
|
1067
|
+
delete(): void;
|
|
1068
|
+
}
|
|
1107
1069
|
|
|
1108
|
-
|
|
1070
|
+
abstract class XRAnchor implements XRAnchor {}
|
|
1109
1071
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1072
|
+
interface XRFrame {
|
|
1073
|
+
trackedAnchors?: XRAnchorSet | undefined;
|
|
1074
|
+
createAnchor?: (pose: XRRigidTransform, space: XRSpace) => Promise<XRAnchor>;
|
|
1112
1075
|
}
|
|
1113
1076
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1077
|
+
// AR Hit testing
|
|
1078
|
+
class XRRay {
|
|
1079
|
+
readonly origin: DOMPointReadOnly;
|
|
1080
|
+
readonly direction: DOMPointReadOnly;
|
|
1081
|
+
readonly matrix: Float32Array;
|
|
1082
|
+
|
|
1083
|
+
constructor(transformOrOrigin?: XRRigidTransform | DOMPointInit, direction?: DOMPointInit);
|
|
1116
1084
|
}
|
|
1117
1085
|
|
|
1118
|
-
|
|
1119
|
-
binding: GPUIndex32;
|
|
1120
|
-
visibility: GPUShaderStageFlags;
|
|
1086
|
+
type XRHitTestTrackableType = "point" | "plane" | "mesh";
|
|
1121
1087
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
storageTexture?: GPUStorageTextureBindingLayout;
|
|
1126
|
-
externalTexture?: GPUExternalTextureBindingLayout;
|
|
1088
|
+
interface XRTransientInputHitTestResult {
|
|
1089
|
+
readonly inputSource: XRInputSource;
|
|
1090
|
+
readonly results: ReadonlyArray<XRHitTestResult>;
|
|
1127
1091
|
}
|
|
1128
1092
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
|
|
1132
|
-
|
|
1133
|
-
interface GPUBufferBindingLayout {
|
|
1134
|
-
type?: GPUBufferBindingType /* default="uniform" */;
|
|
1135
|
-
hasDynamicOffset?: boolean /* default=false */;
|
|
1136
|
-
minBindingSize?: GPUSize64 /* default=0 */;
|
|
1093
|
+
class XRTransientInputHitTestResult {
|
|
1094
|
+
prototype: XRTransientInputHitTestResult;
|
|
1137
1095
|
}
|
|
1138
1096
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1097
|
+
interface XRHitTestResult {
|
|
1098
|
+
getPose(baseSpace: XRSpace): XRPose | undefined;
|
|
1099
|
+
// When anchor system is enabled
|
|
1100
|
+
createAnchor?: (pose: XRRigidTransform) => Promise<XRAnchor> | undefined;
|
|
1143
1101
|
}
|
|
1144
1102
|
|
|
1145
|
-
|
|
1103
|
+
abstract class XRHitTestResult implements XRHitTestResult {}
|
|
1146
1104
|
|
|
1147
|
-
interface
|
|
1148
|
-
|
|
1149
|
-
viewDimension?: GPUTextureViewDimension /* default="2d" */;
|
|
1150
|
-
multisampled?: boolean /* default=false */;
|
|
1105
|
+
interface XRHitTestSource {
|
|
1106
|
+
cancel(): void;
|
|
1151
1107
|
}
|
|
1152
1108
|
|
|
1153
|
-
|
|
1109
|
+
abstract class XRHitTestSource implements XRHitTestSource {}
|
|
1154
1110
|
|
|
1155
|
-
interface
|
|
1156
|
-
|
|
1157
|
-
format: GPUTextureFormat;
|
|
1158
|
-
viewDimension?: GPUTextureViewDimension /* default="2d" */;
|
|
1111
|
+
interface XRTransientInputHitTestSource {
|
|
1112
|
+
cancel(): void;
|
|
1159
1113
|
}
|
|
1160
1114
|
|
|
1161
|
-
|
|
1115
|
+
abstract class XRTransientInputHitTestSource implements XRTransientInputHitTestSource {}
|
|
1162
1116
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1117
|
+
interface XRHitTestOptionsInit {
|
|
1118
|
+
space: XRSpace;
|
|
1119
|
+
entityTypes?: XRHitTestTrackableType[] | undefined;
|
|
1120
|
+
offsetRay?: XRRay | undefined;
|
|
1165
1121
|
}
|
|
1166
1122
|
|
|
1167
|
-
interface
|
|
1168
|
-
|
|
1169
|
-
|
|
1123
|
+
interface XRTransientInputHitTestOptionsInit {
|
|
1124
|
+
profile: string;
|
|
1125
|
+
entityTypes?: XRHitTestTrackableType[] | undefined;
|
|
1126
|
+
offsetRay?: XRRay | undefined;
|
|
1170
1127
|
}
|
|
1171
1128
|
|
|
1172
|
-
|
|
1129
|
+
interface XRSession {
|
|
1130
|
+
requestHitTestSource?: (options: XRHitTestOptionsInit) => Promise<XRHitTestSource>;
|
|
1131
|
+
requestHitTestSourceForTransientInput?: (options: XRTransientInputHitTestOptionsInit) => Promise<XRTransientInputHitTestSource>;
|
|
1173
1132
|
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
resource: GPUBindingResource;
|
|
1133
|
+
// Legacy
|
|
1134
|
+
requestHitTest?: (ray: XRRay, referenceSpace: XRReferenceSpace) => Promise<XRHitResult[]>;
|
|
1177
1135
|
}
|
|
1178
1136
|
|
|
1179
|
-
interface
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
size?: GPUSize64 /* default=size_of_buffer - offset */;
|
|
1137
|
+
interface XRFrame {
|
|
1138
|
+
getHitTestResults(hitTestSource: XRHitTestSource): XRHitTestResult[];
|
|
1139
|
+
getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource): XRTransientInputHitTestResult[];
|
|
1183
1140
|
}
|
|
1184
1141
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1142
|
+
// Legacy
|
|
1143
|
+
interface XRHitResult {
|
|
1144
|
+
hitMatrix: Float32Array;
|
|
1187
1145
|
}
|
|
1188
1146
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}
|
|
1147
|
+
// Plane detection
|
|
1148
|
+
type XRPlaneSet = Set<XRPlane>;
|
|
1192
1149
|
|
|
1193
|
-
|
|
1194
|
-
label: string | undefined;
|
|
1150
|
+
type XRPlaneOrientation = "horizontal" | "vertical";
|
|
1195
1151
|
|
|
1196
|
-
|
|
1152
|
+
interface XRPlane {
|
|
1153
|
+
orientation: XRPlaneOrientation;
|
|
1154
|
+
planeSpace: XRSpace;
|
|
1155
|
+
polygon: DOMPointReadOnly[];
|
|
1156
|
+
lastChangedTime: number;
|
|
1197
1157
|
}
|
|
1198
1158
|
|
|
1199
|
-
|
|
1200
|
-
code: string | Uint32Array;
|
|
1201
|
-
sourceMap?: object;
|
|
1202
|
-
compilationHints?: GPUShaderModuleCompilationHint[] /* default=[] */;
|
|
1203
|
-
}
|
|
1159
|
+
abstract class XRPlane implements XRPlane {}
|
|
1204
1160
|
|
|
1205
|
-
interface
|
|
1206
|
-
|
|
1207
|
-
|
|
1161
|
+
interface XRSession {
|
|
1162
|
+
// Legacy
|
|
1163
|
+
updateWorldTrackingState?: (options: { planeDetectionState?: { enabled: boolean } | undefined }) => void | undefined;
|
|
1208
1164
|
}
|
|
1209
1165
|
|
|
1210
|
-
|
|
1166
|
+
// interface XRFrame {
|
|
1167
|
+
// worldInformation?:
|
|
1168
|
+
// | {
|
|
1169
|
+
// detectedPlanes?: XRPlaneSet | undefined;
|
|
1170
|
+
// }
|
|
1171
|
+
// | undefined;
|
|
1172
|
+
// }
|
|
1211
1173
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1174
|
+
// Hand Tracking
|
|
1175
|
+
type XRHandJoint =
|
|
1176
|
+
| "wrist"
|
|
1177
|
+
| "thumb-metacarpal"
|
|
1178
|
+
| "thumb-phalanx-proximal"
|
|
1179
|
+
| "thumb-phalanx-distal"
|
|
1180
|
+
| "thumb-tip"
|
|
1181
|
+
| "index-finger-metacarpal"
|
|
1182
|
+
| "index-finger-phalanx-proximal"
|
|
1183
|
+
| "index-finger-phalanx-intermediate"
|
|
1184
|
+
| "index-finger-phalanx-distal"
|
|
1185
|
+
| "index-finger-tip"
|
|
1186
|
+
| "middle-finger-metacarpal"
|
|
1187
|
+
| "middle-finger-phalanx-proximal"
|
|
1188
|
+
| "middle-finger-phalanx-intermediate"
|
|
1189
|
+
| "middle-finger-phalanx-distal"
|
|
1190
|
+
| "middle-finger-tip"
|
|
1191
|
+
| "ring-finger-metacarpal"
|
|
1192
|
+
| "ring-finger-phalanx-proximal"
|
|
1193
|
+
| "ring-finger-phalanx-intermediate"
|
|
1194
|
+
| "ring-finger-phalanx-distal"
|
|
1195
|
+
| "ring-finger-tip"
|
|
1196
|
+
| "pinky-finger-metacarpal"
|
|
1197
|
+
| "pinky-finger-phalanx-proximal"
|
|
1198
|
+
| "pinky-finger-phalanx-intermediate"
|
|
1199
|
+
| "pinky-finger-phalanx-distal"
|
|
1200
|
+
| "pinky-finger-tip";
|
|
1220
1201
|
|
|
1221
|
-
interface
|
|
1222
|
-
readonly
|
|
1202
|
+
interface XRJointSpace extends XRSpace {
|
|
1203
|
+
readonly jointName: XRHandJoint;
|
|
1223
1204
|
}
|
|
1224
1205
|
|
|
1225
|
-
class
|
|
1226
|
-
constructor(message: string | undefined, options: GPUPipelineErrorInit);
|
|
1227
|
-
readonly reason: GPUPipelineErrorReason;
|
|
1228
|
-
}
|
|
1206
|
+
abstract class XRJointSpace implements XRJointSpace {}
|
|
1229
1207
|
|
|
1230
|
-
interface
|
|
1231
|
-
|
|
1208
|
+
interface XRJointPose extends XRPose {
|
|
1209
|
+
readonly radius: number | undefined;
|
|
1232
1210
|
}
|
|
1233
1211
|
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
type GPUAutoLayoutMode = "auto";
|
|
1237
|
-
|
|
1238
|
-
interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
|
|
1239
|
-
layout: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
1240
|
-
}
|
|
1212
|
+
abstract class XRJointPose implements XRJointPose {}
|
|
1241
1213
|
|
|
1242
|
-
interface
|
|
1243
|
-
|
|
1244
|
-
}
|
|
1214
|
+
interface XRHand extends Map<XRHandJoint, XRJointSpace> {
|
|
1215
|
+
readonly WRIST: number;
|
|
1245
1216
|
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
}
|
|
1217
|
+
readonly THUMB_METACARPAL: number;
|
|
1218
|
+
readonly THUMB_PHALANX_PROXIMAL: number;
|
|
1219
|
+
readonly THUMB_PHALANX_DISTAL: number;
|
|
1220
|
+
readonly THUMB_PHALANX_TIP: number;
|
|
1251
1221
|
|
|
1252
|
-
|
|
1222
|
+
readonly INDEX_METACARPAL: number;
|
|
1223
|
+
readonly INDEX_PHALANX_PROXIMAL: number;
|
|
1224
|
+
readonly INDEX_PHALANX_INTERMEDIATE: number;
|
|
1225
|
+
readonly INDEX_PHALANX_DISTAL: number;
|
|
1226
|
+
readonly INDEX_PHALANX_TIP: number;
|
|
1253
1227
|
|
|
1254
|
-
|
|
1255
|
-
|
|
1228
|
+
readonly MIDDLE_METACARPAL: number;
|
|
1229
|
+
readonly MIDDLE_PHALANX_PROXIMAL: number;
|
|
1230
|
+
readonly MIDDLE_PHALANX_INTERMEDIATE: number;
|
|
1231
|
+
readonly MIDDLE_PHALANX_DISTAL: number;
|
|
1232
|
+
readonly MIDDLE_PHALANX_TIP: number;
|
|
1256
1233
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1234
|
+
readonly RING_METACARPAL: number;
|
|
1235
|
+
readonly RING_PHALANX_PROXIMAL: number;
|
|
1236
|
+
readonly RING_PHALANX_INTERMEDIATE: number;
|
|
1237
|
+
readonly RING_PHALANX_DISTAL: number;
|
|
1238
|
+
readonly RING_PHALANX_TIP: number;
|
|
1259
1239
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1240
|
+
readonly LITTLE_METACARPAL: number;
|
|
1241
|
+
readonly LITTLE_PHALANX_PROXIMAL: number;
|
|
1242
|
+
readonly LITTLE_PHALANX_INTERMEDIATE: number;
|
|
1243
|
+
readonly LITTLE_PHALANX_DISTAL: number;
|
|
1244
|
+
readonly LITTLE_PHALANX_TIP: number;
|
|
1262
1245
|
}
|
|
1263
1246
|
|
|
1264
|
-
class
|
|
1265
|
-
label: string | undefined;
|
|
1247
|
+
abstract class XRHand extends Map<XRHandJoint, XRJointSpace> implements XRHand {}
|
|
1266
1248
|
|
|
1267
|
-
|
|
1268
|
-
}
|
|
1249
|
+
// WebXR Layers
|
|
1269
1250
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1251
|
+
/**
|
|
1252
|
+
* The base class for XRWebGLLayer and other layer types introduced by future extensions.
|
|
1253
|
+
* ref: https://immersive-web.github.io/webxr/#xrlayer-interface
|
|
1254
|
+
*/
|
|
1255
|
+
// tslint:disable-next-line no-empty-interface
|
|
1256
|
+
interface XRLayer extends EventTarget {}
|
|
1277
1257
|
|
|
1278
|
-
|
|
1279
|
-
topology?: GPUPrimitiveTopology /* default="triangle-list" */;
|
|
1280
|
-
stripIndexFormat?: GPUIndexFormat;
|
|
1281
|
-
frontFace?: GPUFrontFace /* default="ccw" */;
|
|
1282
|
-
cullMode?: GPUCullMode /* default="none" */;
|
|
1258
|
+
abstract class XRLayer implements XRLayer {}
|
|
1283
1259
|
|
|
1284
|
-
|
|
1285
|
-
|
|
1260
|
+
interface XRWebGLLayerInit {
|
|
1261
|
+
antialias?: boolean | undefined;
|
|
1262
|
+
depth?: boolean | undefined;
|
|
1263
|
+
stencil?: boolean | undefined;
|
|
1264
|
+
alpha?: boolean | undefined;
|
|
1265
|
+
ignoreDepthValues?: boolean | undefined;
|
|
1266
|
+
framebufferScaleFactor?: number | undefined;
|
|
1286
1267
|
}
|
|
1287
1268
|
|
|
1288
|
-
|
|
1269
|
+
/**
|
|
1270
|
+
* A layer which provides a WebGL framebuffer to render into, enabling hardware accelerated
|
|
1271
|
+
* rendering of 3D graphics to be presented on the XR device. *
|
|
1272
|
+
* ref: https://immersive-web.github.io/webxr/#xrwebgllayer-interface
|
|
1273
|
+
*/
|
|
1274
|
+
class XRWebGLLayer extends XRLayer {
|
|
1275
|
+
static getNativeFramebufferScaleFactor(session: XRSession): number;
|
|
1289
1276
|
|
|
1290
|
-
|
|
1277
|
+
constructor(session: XRSession, context: WebGLRenderingContext | WebGL2RenderingContext, layerInit?: XRWebGLLayerInit);
|
|
1291
1278
|
|
|
1292
|
-
|
|
1279
|
+
readonly antialias: boolean;
|
|
1280
|
+
readonly ignoreDepthValues: boolean;
|
|
1281
|
+
fixedFoveation?: number | undefined;
|
|
1293
1282
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1283
|
+
readonly framebuffer: WebGLFramebuffer;
|
|
1284
|
+
readonly framebufferWidth: number;
|
|
1285
|
+
readonly framebufferHeight: number;
|
|
1286
|
+
|
|
1287
|
+
getViewport(view: XRView): XRViewport | undefined;
|
|
1298
1288
|
}
|
|
1299
1289
|
|
|
1300
|
-
interface
|
|
1301
|
-
|
|
1290
|
+
interface XRRenderStateInit {
|
|
1291
|
+
layers?: XRLayer[] | undefined;
|
|
1302
1292
|
}
|
|
1303
1293
|
|
|
1304
|
-
interface
|
|
1305
|
-
|
|
1294
|
+
interface XRRenderState {
|
|
1295
|
+
readonly layers?: XRLayer[] | undefined;
|
|
1296
|
+
}
|
|
1306
1297
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1298
|
+
type XRLayerEventType = "redraw";
|
|
1299
|
+
|
|
1300
|
+
interface XRLayerEvent extends Event {
|
|
1301
|
+
readonly type: XRLayerEventType;
|
|
1302
|
+
readonly layer: XRLayer;
|
|
1309
1303
|
}
|
|
1310
1304
|
|
|
1311
|
-
interface
|
|
1312
|
-
|
|
1313
|
-
alpha: GPUBlendComponent;
|
|
1305
|
+
interface XRCompositionLayerEventMap {
|
|
1306
|
+
redraw: XRLayerEvent;
|
|
1314
1307
|
}
|
|
1315
1308
|
|
|
1316
|
-
|
|
1309
|
+
interface XRCompositionLayer extends XRLayer {
|
|
1310
|
+
readonly layout: XRLayerLayout;
|
|
1311
|
+
blendTextureSourceAlpha: boolean;
|
|
1312
|
+
chromaticAberrationCorrection?: boolean | undefined;
|
|
1313
|
+
readonly mipLevels: number;
|
|
1314
|
+
readonly needsRedraw: boolean;
|
|
1315
|
+
destroy(): void;
|
|
1317
1316
|
|
|
1318
|
-
|
|
1319
|
-
operation?: GPUBlendOperation /* default="add" */;
|
|
1320
|
-
srcFactor?: GPUBlendFactor /* default="one" */;
|
|
1321
|
-
dstFactor?: GPUBlendFactor /* default="zero" */;
|
|
1322
|
-
}
|
|
1317
|
+
space: XRSpace;
|
|
1323
1318
|
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
| "one"
|
|
1327
|
-
| "src"
|
|
1328
|
-
| "one-minus-src"
|
|
1329
|
-
| "src-alpha"
|
|
1330
|
-
| "one-minus-src-alpha"
|
|
1331
|
-
| "dst"
|
|
1332
|
-
| "one-minus-dst"
|
|
1333
|
-
| "dst-alpha"
|
|
1334
|
-
| "one-minus-dst-alpha"
|
|
1335
|
-
| "src-alpha-saturated"
|
|
1336
|
-
| "constant"
|
|
1337
|
-
| "one-minus-constant";
|
|
1319
|
+
// Events
|
|
1320
|
+
onredraw: (evt: XRCompositionLayerEventMap["redraw"]) => any;
|
|
1338
1321
|
|
|
1339
|
-
|
|
1322
|
+
addEventListener<K extends keyof XRCompositionLayerEventMap>(
|
|
1323
|
+
this: XRCompositionLayer,
|
|
1324
|
+
type: K,
|
|
1325
|
+
callback: (evt: XRCompositionLayerEventMap[K]) => any,
|
|
1326
|
+
options?: boolean | AddEventListenerOptions
|
|
1327
|
+
): void;
|
|
1328
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1340
1329
|
|
|
1341
|
-
|
|
1342
|
-
|
|
1330
|
+
removeEventListener<K extends keyof XRCompositionLayerEventMap>(this: XRCompositionLayer, type: K, callback: (evt: XRCompositionLayerEventMap[K]) => any): void;
|
|
1331
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1332
|
+
}
|
|
1343
1333
|
|
|
1344
|
-
|
|
1345
|
-
depthCompare?: GPUCompareFunction /* default="always" */;
|
|
1334
|
+
abstract class XRCompositionLayer implements XRCompositionLayer {}
|
|
1346
1335
|
|
|
1347
|
-
|
|
1348
|
-
stencilBack?: GPUStencilFaceState /* default={} */;
|
|
1336
|
+
type XRTextureType = "texture" | "texture-array";
|
|
1349
1337
|
|
|
1350
|
-
|
|
1351
|
-
stencilWriteMask?: GPUStencilValue /* default=0xFFFFFFFF */;
|
|
1338
|
+
type XRLayerLayout = "default" | "mono" | "stereo" | "stereo-left-right" | "stereo-top-bottom";
|
|
1352
1339
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1340
|
+
interface XRProjectionLayerInit {
|
|
1341
|
+
scaleFactor?: number | undefined;
|
|
1342
|
+
textureType?: XRTextureType | undefined;
|
|
1343
|
+
colorFormat?: GLenum | undefined;
|
|
1344
|
+
depthFormat?: GLenum | undefined;
|
|
1345
|
+
clearOnAccess?: boolean | undefined;
|
|
1356
1346
|
}
|
|
1357
1347
|
|
|
1358
|
-
interface
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1348
|
+
interface XRProjectionLayer extends XRCompositionLayer {
|
|
1349
|
+
readonly textureWidth: number;
|
|
1350
|
+
readonly textureHeight: number;
|
|
1351
|
+
readonly textureArrayLength: number;
|
|
1352
|
+
readonly ignoreDepthValues: number;
|
|
1353
|
+
fixedFoveation: number;
|
|
1363
1354
|
}
|
|
1364
1355
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
type GPUIndexFormat = "uint16" | "uint32";
|
|
1368
|
-
|
|
1369
|
-
type GPUVertexFormat =
|
|
1370
|
-
| "uint8x2"
|
|
1371
|
-
| "uint8x4"
|
|
1372
|
-
| "sint8x2"
|
|
1373
|
-
| "sint8x4"
|
|
1374
|
-
| "unorm8x2"
|
|
1375
|
-
| "unorm8x4"
|
|
1376
|
-
| "snorm8x2"
|
|
1377
|
-
| "snorm8x4"
|
|
1378
|
-
| "uint16x2"
|
|
1379
|
-
| "uint16x4"
|
|
1380
|
-
| "sint16x2"
|
|
1381
|
-
| "sint16x4"
|
|
1382
|
-
| "unorm16x2"
|
|
1383
|
-
| "unorm16x4"
|
|
1384
|
-
| "snorm16x2"
|
|
1385
|
-
| "snorm16x4"
|
|
1386
|
-
| "float16x2"
|
|
1387
|
-
| "float16x4"
|
|
1388
|
-
| "float32"
|
|
1389
|
-
| "float32x2"
|
|
1390
|
-
| "float32x3"
|
|
1391
|
-
| "float32x4"
|
|
1392
|
-
| "uint32"
|
|
1393
|
-
| "uint32x2"
|
|
1394
|
-
| "uint32x3"
|
|
1395
|
-
| "uint32x4"
|
|
1396
|
-
| "sint32"
|
|
1397
|
-
| "sint32x2"
|
|
1398
|
-
| "sint32x3"
|
|
1399
|
-
| "sint32x4"
|
|
1400
|
-
| "unorm10-10-10-2";
|
|
1356
|
+
abstract class XRProjectionLayer implements XRProjectionLayer {}
|
|
1401
1357
|
|
|
1402
|
-
|
|
1358
|
+
interface XRLayerInit {
|
|
1359
|
+
mipLevels?: number | undefined;
|
|
1360
|
+
viewPixelWidth: number;
|
|
1361
|
+
viewPixelHeight: number;
|
|
1362
|
+
isStatic?: boolean | undefined;
|
|
1363
|
+
colorFormat?: GLenum | undefined;
|
|
1364
|
+
depthFormat?: GLenum | undefined;
|
|
1365
|
+
space: XRSpace;
|
|
1366
|
+
layout?: XRLayerLayout | undefined;
|
|
1367
|
+
clearOnAccess?: boolean | undefined;
|
|
1368
|
+
}
|
|
1403
1369
|
|
|
1404
|
-
interface
|
|
1405
|
-
|
|
1370
|
+
interface XRMediaLayerInit {
|
|
1371
|
+
invertStereo?: boolean | undefined;
|
|
1372
|
+
space: XRSpace;
|
|
1373
|
+
layout?: XRLayerLayout | undefined;
|
|
1406
1374
|
}
|
|
1407
1375
|
|
|
1408
|
-
interface
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1376
|
+
interface XRCylinderLayerInit extends XRLayerInit {
|
|
1377
|
+
textureType?: XRTextureType | undefined;
|
|
1378
|
+
transform: XRRigidTransform;
|
|
1379
|
+
radius?: number | undefined;
|
|
1380
|
+
centralAngle?: number | undefined;
|
|
1381
|
+
aspectRatio?: number | undefined;
|
|
1412
1382
|
}
|
|
1413
1383
|
|
|
1414
|
-
interface
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1384
|
+
interface XRMediaCylinderLayerInit extends XRMediaLayerInit {
|
|
1385
|
+
transform?: XRRigidTransform | undefined;
|
|
1386
|
+
radius?: number | undefined;
|
|
1387
|
+
centralAngle?: number | undefined;
|
|
1388
|
+
aspectRatio?: number | undefined;
|
|
1418
1389
|
}
|
|
1419
1390
|
|
|
1420
|
-
interface
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1391
|
+
interface XRCylinderLayer extends XRCompositionLayer {
|
|
1392
|
+
transform: XRRigidTransform;
|
|
1393
|
+
radius: number;
|
|
1394
|
+
centralAngle: number;
|
|
1395
|
+
aspectRatio: number;
|
|
1424
1396
|
}
|
|
1425
1397
|
|
|
1426
|
-
|
|
1427
|
-
|
|
1398
|
+
abstract class XRCylinderLayer implements XRCylinderLayer {}
|
|
1399
|
+
|
|
1400
|
+
interface XRQuadLayerInit extends XRLayerInit {
|
|
1401
|
+
textureType?: XRTextureType | undefined;
|
|
1402
|
+
transform?: XRRigidTransform | undefined;
|
|
1403
|
+
width?: number | undefined;
|
|
1404
|
+
height?: number | undefined;
|
|
1428
1405
|
}
|
|
1429
1406
|
|
|
1430
|
-
interface
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
aspect?: GPUTextureAspect /* default="all" */;
|
|
1407
|
+
interface XRMediaQuadLayerInit extends XRMediaLayerInit {
|
|
1408
|
+
transform?: XRRigidTransform | undefined;
|
|
1409
|
+
width?: number | undefined;
|
|
1410
|
+
height?: number | undefined;
|
|
1435
1411
|
}
|
|
1436
1412
|
|
|
1437
|
-
interface
|
|
1438
|
-
|
|
1439
|
-
|
|
1413
|
+
interface XRQuadLayer extends XRCompositionLayer {
|
|
1414
|
+
transform: XRRigidTransform;
|
|
1415
|
+
width: number;
|
|
1416
|
+
height: number;
|
|
1440
1417
|
}
|
|
1441
1418
|
|
|
1442
|
-
|
|
1419
|
+
abstract class XRQuadLayer implements XRQuadLayer {}
|
|
1443
1420
|
|
|
1444
|
-
interface
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1421
|
+
interface XREquirectLayerInit extends XRLayerInit {
|
|
1422
|
+
textureType?: XRTextureType | undefined;
|
|
1423
|
+
transform?: XRRigidTransform | undefined;
|
|
1424
|
+
radius?: number | undefined;
|
|
1425
|
+
centralHorizontalAngle?: number | undefined;
|
|
1426
|
+
upperVerticalAngle?: number | undefined;
|
|
1427
|
+
lowerVerticalAngle?: number | undefined;
|
|
1448
1428
|
}
|
|
1449
1429
|
|
|
1450
|
-
|
|
1451
|
-
|
|
1430
|
+
interface XRMediaEquirectLayerInit extends XRMediaLayerInit {
|
|
1431
|
+
transform?: XRRigidTransform | undefined;
|
|
1432
|
+
radius?: number | undefined;
|
|
1433
|
+
centralHorizontalAngle?: number | undefined;
|
|
1434
|
+
upperVerticalAngle?: number | undefined;
|
|
1435
|
+
lowerVerticalAngle?: number | undefined;
|
|
1452
1436
|
}
|
|
1453
1437
|
|
|
1454
|
-
interface
|
|
1455
|
-
|
|
1456
|
-
|
|
1438
|
+
interface XREquirectLayer extends XRCompositionLayer {
|
|
1439
|
+
transform: XRRigidTransform;
|
|
1440
|
+
radius: number;
|
|
1441
|
+
centralHorizontalAngle: number;
|
|
1442
|
+
upperVerticalAngle: number;
|
|
1443
|
+
lowerVerticalAngle: number;
|
|
1444
|
+
}
|
|
1457
1445
|
|
|
1458
|
-
class
|
|
1459
|
-
label: string | undefined;
|
|
1446
|
+
abstract class XREquirectLayer implements XREquirectLayer {}
|
|
1460
1447
|
|
|
1461
|
-
|
|
1462
|
-
|
|
1448
|
+
interface XRCubeLayerInit extends XRLayerInit {
|
|
1449
|
+
orientation?: DOMPointReadOnly | undefined;
|
|
1450
|
+
}
|
|
1463
1451
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
1468
|
-
clearBuffer(buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
|
|
1452
|
+
interface XRCubeLayer extends XRCompositionLayer {
|
|
1453
|
+
orientation: DOMPointReadOnly;
|
|
1454
|
+
}
|
|
1469
1455
|
|
|
1470
|
-
|
|
1456
|
+
abstract class XRCubeLayer implements XRCubeLayer {}
|
|
1471
1457
|
|
|
1472
|
-
|
|
1458
|
+
interface XRSubImage {
|
|
1459
|
+
readonly viewport: XRViewport;
|
|
1460
|
+
}
|
|
1473
1461
|
|
|
1474
|
-
|
|
1462
|
+
abstract class XRSubImage implements XRSubImage {}
|
|
1475
1463
|
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1464
|
+
interface XRWebGLSubImage extends XRSubImage {
|
|
1465
|
+
readonly colorTexture: WebGLTexture;
|
|
1466
|
+
readonly depthStencilTexture?: WebGLTexture;
|
|
1467
|
+
readonly motionVectorTexture?: WebGLTexture;
|
|
1468
|
+
readonly imageIndex: number;
|
|
1469
|
+
readonly textureWidth: number;
|
|
1470
|
+
readonly textureHeight: number;
|
|
1471
|
+
readonly colorTextureWidth?: number;
|
|
1472
|
+
readonly colorTextureHeight?: number;
|
|
1473
|
+
readonly depthStencilTextureWidth?: number;
|
|
1474
|
+
readonly depthStencilTextureHeight?: number;
|
|
1475
|
+
readonly motionVectorTextureWidth?: number;
|
|
1476
|
+
readonly motionVectorTextureHeight?: number;
|
|
1479
1477
|
}
|
|
1480
1478
|
|
|
1481
|
-
|
|
1479
|
+
abstract class XRWebGLSubImage implements XRWebGLSubImage {}
|
|
1482
1480
|
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
1486
|
-
}
|
|
1481
|
+
class XRWebGLBinding {
|
|
1482
|
+
readonly nativeProjectionScaleFactor: number;
|
|
1487
1483
|
|
|
1488
|
-
|
|
1489
|
-
pushDebugGroup(groupLabel: string): void;
|
|
1490
|
-
popDebugGroup(): void;
|
|
1491
|
-
insertDebugMarker(markerLabel: string): void;
|
|
1492
|
-
}
|
|
1484
|
+
constructor(session: XRSession, context: WebGLRenderingContext);
|
|
1493
1485
|
|
|
1494
|
-
|
|
1495
|
-
|
|
1486
|
+
createProjectionLayer(init?: XRProjectionLayerInit): XRProjectionLayer;
|
|
1487
|
+
createQuadLayer(init?: XRQuadLayerInit): XRQuadLayer;
|
|
1488
|
+
createCylinderLayer(init?: XRCylinderLayerInit): XRCylinderLayer;
|
|
1489
|
+
createEquirectLayer(init?: XREquirectLayerInit): XREquirectLayer;
|
|
1490
|
+
createCubeLayer(init?: XRCubeLayerInit): XRCubeLayer;
|
|
1496
1491
|
|
|
1497
|
-
|
|
1498
|
-
|
|
1492
|
+
getSubImage(layer: XRCompositionLayer, frame: XRFrame, eye?: XREye): XRWebGLSubImage;
|
|
1493
|
+
getViewSubImage(layer: XRProjectionLayer, view: XRView): XRWebGLSubImage;
|
|
1499
1494
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1495
|
+
// BABYLON addition
|
|
1496
|
+
getReflectionCubeMap: (lightProbe: XRLightProbe) => WebGLTexture;
|
|
1497
|
+
}
|
|
1503
1498
|
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
1499
|
+
class XRMediaBinding {
|
|
1500
|
+
constructor(sesion: XRSession);
|
|
1507
1501
|
|
|
1508
|
-
|
|
1502
|
+
createQuadLayer(video: HTMLVideoElement, init?: XRMediaQuadLayerInit): XRQuadLayer;
|
|
1503
|
+
createCylinderLayer(video: HTMLVideoElement, init?: XRMediaCylinderLayerInit): XRCylinderLayer;
|
|
1504
|
+
createEquirectLayer(video: HTMLVideoElement, init?: XRMediaEquirectLayerInit): XREquirectLayer;
|
|
1509
1505
|
}
|
|
1510
1506
|
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
endOfPassWriteIndex: GPUSize32;
|
|
1507
|
+
// WebGL extensions
|
|
1508
|
+
interface WebGLRenderingContextBase {
|
|
1509
|
+
getExtension(extensionName: "OCULUS_multiview"): OCULUS_multiview | null;
|
|
1515
1510
|
}
|
|
1516
1511
|
|
|
1517
|
-
|
|
1518
|
-
|
|
1512
|
+
enum XOVR_multiview2 {
|
|
1513
|
+
FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630,
|
|
1514
|
+
FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632,
|
|
1515
|
+
MAX_VIEWS_OVR = 0x9631,
|
|
1516
|
+
FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633,
|
|
1519
1517
|
}
|
|
1520
1518
|
|
|
1521
|
-
|
|
1522
|
-
|
|
1519
|
+
// Oculus extensions
|
|
1520
|
+
interface XRSessionGrant {
|
|
1521
|
+
mode: XRSessionMode;
|
|
1522
|
+
}
|
|
1523
1523
|
|
|
1524
|
-
|
|
1525
|
-
|
|
1524
|
+
interface XRSystemSessionGrantedEvent extends Event {
|
|
1525
|
+
type: "sessiongranted";
|
|
1526
|
+
session: XRSessionGrant;
|
|
1527
|
+
}
|
|
1526
1528
|
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1529
|
+
interface XRSystemSessionGrantedEventHandler {
|
|
1530
|
+
(event: XRSystemSessionGrantedEvent): any;
|
|
1531
|
+
}
|
|
1530
1532
|
|
|
1531
|
-
|
|
1533
|
+
interface XRSystemEventMap {
|
|
1534
|
+
// Session Grant events are an Meta Oculus Browser extension
|
|
1535
|
+
sessiongranted: XRSystemSessionGrantedEvent;
|
|
1536
|
+
}
|
|
1532
1537
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1538
|
+
interface XRSystem {
|
|
1539
|
+
onsessiongranted: XRSystemSessionGrantedEventHandler | null;
|
|
1540
|
+
}
|
|
1535
1541
|
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1542
|
+
interface OCULUS_multiview extends OVR_multiview2 {
|
|
1543
|
+
framebufferTextureMultisampleMultiviewOVR(
|
|
1544
|
+
target: GLenum,
|
|
1545
|
+
attachment: GLenum,
|
|
1546
|
+
texture: WebGLTexture | null,
|
|
1547
|
+
level: GLint,
|
|
1548
|
+
samples: GLsizei,
|
|
1549
|
+
baseViewIndex: GLint,
|
|
1550
|
+
numViews: GLsizei
|
|
1543
1551
|
): void;
|
|
1552
|
+
}
|
|
1544
1553
|
|
|
1545
|
-
|
|
1546
|
-
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
1554
|
+
abstract class OCULUS_multiview implements OCULUS_multiview {}
|
|
1547
1555
|
|
|
1548
|
-
|
|
1556
|
+
/**
|
|
1557
|
+
* BEGIN: WebXR DOM Overlays Module
|
|
1558
|
+
* https://immersive-web.github.io/dom-overlays/
|
|
1559
|
+
*/
|
|
1549
1560
|
|
|
1550
|
-
|
|
1561
|
+
interface GlobalEventHandlersEventMap {
|
|
1562
|
+
beforexrselect: XRSessionEvent;
|
|
1563
|
+
}
|
|
1551
1564
|
|
|
1552
|
-
|
|
1553
|
-
|
|
1565
|
+
interface GlobalEventHandlers {
|
|
1566
|
+
/**
|
|
1567
|
+
* An XRSessionEvent of type beforexrselect is dispatched on the DOM overlay
|
|
1568
|
+
* element before generating a WebXR selectstart input event if the -Z axis
|
|
1569
|
+
* of the input source's targetRaySpace intersects the DOM overlay element
|
|
1570
|
+
* at the time the input device's primary action is triggered.
|
|
1571
|
+
*/
|
|
1572
|
+
onbeforexrselect: ((this: GlobalEventHandlers, ev: XRSessionEvent) => any) | null;
|
|
1573
|
+
}
|
|
1554
1574
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1575
|
+
interface XRDOMOverlayInit {
|
|
1576
|
+
root: Element;
|
|
1577
|
+
}
|
|
1557
1578
|
|
|
1558
|
-
|
|
1559
|
-
|
|
1579
|
+
interface XRSessionInit {
|
|
1580
|
+
domOverlay?: XRDOMOverlayInit | undefined;
|
|
1560
1581
|
}
|
|
1561
1582
|
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1583
|
+
type XRDOMOverlayType = "screen" | "floating" | "head-locked";
|
|
1584
|
+
|
|
1585
|
+
interface XRDOMOverlayState {
|
|
1586
|
+
type: XRDOMOverlayType;
|
|
1566
1587
|
}
|
|
1567
1588
|
|
|
1568
|
-
interface
|
|
1569
|
-
|
|
1570
|
-
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
1571
|
-
occlusionQuerySet?: GPUQuerySet;
|
|
1572
|
-
timestampWrites?: GPURenderPassTimestampWrites;
|
|
1573
|
-
maxDrawCount?: GPUSize64 /* default=50000000 */;
|
|
1589
|
+
interface XRSession {
|
|
1590
|
+
readonly domOverlayState?: XRDOMOverlayState | undefined;
|
|
1574
1591
|
}
|
|
1575
1592
|
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1593
|
+
/// BABYLON EDITS
|
|
1594
|
+
interface XREyeTrackingSourceEvent extends XRSessionEvent {
|
|
1595
|
+
readonly gazeSpace: XRSpace;
|
|
1596
|
+
}
|
|
1580
1597
|
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1598
|
+
interface XRFrame {
|
|
1599
|
+
fillPoses?(spaces: XRSpace[], baseSpace: XRSpace, transforms: Float32Array): boolean;
|
|
1600
|
+
// Anchors
|
|
1601
|
+
trackedAnchors?: XRAnchorSet;
|
|
1602
|
+
// World geometries. DEPRECATED
|
|
1603
|
+
worldInformation?: XRWorldInformation | undefined;
|
|
1604
|
+
detectedPlanes?: XRPlaneSet | undefined;
|
|
1605
|
+
// Hand tracking
|
|
1606
|
+
getJointPose?(joint: XRJointSpace, baseSpace: XRSpace): XRJointPose;
|
|
1607
|
+
fillJointRadii?(jointSpaces: XRJointSpace[], radii: Float32Array): boolean;
|
|
1608
|
+
// Image tracking
|
|
1609
|
+
getImageTrackingResults?(): Array<XRImageTrackingResult>;
|
|
1610
|
+
getLightEstimate(xrLightProbe: XRLightProbe): XRLightEstimate;
|
|
1584
1611
|
}
|
|
1585
1612
|
|
|
1586
|
-
|
|
1587
|
-
|
|
1613
|
+
// Plane detection
|
|
1614
|
+
interface XRSession {
|
|
1615
|
+
initiateRoomCapture?(): Promise<void>;
|
|
1616
|
+
}
|
|
1588
1617
|
|
|
1589
|
-
|
|
1590
|
-
depthLoadOp: GPULoadOp;
|
|
1591
|
-
depthStoreOp: GPUStoreOp;
|
|
1592
|
-
depthReadOnly?: boolean /* default=false */;
|
|
1618
|
+
type XREventType = keyof XRSessionEventMap;
|
|
1593
1619
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
stencilStoreOp?: GPUStoreOp;
|
|
1597
|
-
stencilReadOnly?: boolean /* default=false */;
|
|
1598
|
-
}
|
|
1620
|
+
type XRImageTrackingState = "tracked" | "emulated";
|
|
1621
|
+
type XRImageTrackingScore = "untrackable" | "trackable";
|
|
1599
1622
|
|
|
1600
|
-
|
|
1623
|
+
interface XRTrackedImageInit {
|
|
1624
|
+
image: ImageBitmap;
|
|
1625
|
+
widthInMeters: number;
|
|
1626
|
+
}
|
|
1601
1627
|
|
|
1602
|
-
|
|
1628
|
+
interface XRImageTrackingResult {
|
|
1629
|
+
readonly imageSpace: XRSpace;
|
|
1630
|
+
readonly index: number;
|
|
1631
|
+
readonly trackingState: XRImageTrackingState;
|
|
1632
|
+
readonly measuredWidthInMeters: number;
|
|
1633
|
+
}
|
|
1603
1634
|
|
|
1604
|
-
interface
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
sampleCount?: GPUSize32 /* default=1 */;
|
|
1635
|
+
interface XRPose {
|
|
1636
|
+
readonly linearVelocity?: DOMPointReadOnly;
|
|
1637
|
+
readonly angularVelocity?: DOMPointReadOnly;
|
|
1608
1638
|
}
|
|
1609
1639
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1640
|
+
type XRLightProbeInit = {
|
|
1641
|
+
reflectionFormat: XRReflectionFormat;
|
|
1642
|
+
};
|
|
1612
1643
|
|
|
1613
|
-
|
|
1614
|
-
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
|
|
1644
|
+
type XRReflectionFormat = "srgba8" | "rgba16f";
|
|
1615
1645
|
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1646
|
+
interface XRSession {
|
|
1647
|
+
readonly preferredReflectionFormat?: XRReflectionFormat;
|
|
1648
|
+
/**
|
|
1649
|
+
* The XRSession interface is extended with the ability to create new XRLightProbe instances.
|
|
1650
|
+
* XRLightProbe instances have a session object, which is the XRSession that created this XRLightProbe.
|
|
1651
|
+
*
|
|
1652
|
+
* Can reject with with a "NotSupportedError" DOMException
|
|
1653
|
+
*/
|
|
1654
|
+
requestLightProbe(options?: XRLightProbeInit): Promise<XRLightProbe>;
|
|
1624
1655
|
|
|
1625
|
-
|
|
1626
|
-
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
1656
|
+
getTrackedImageScores?(): Promise<XRImageTrackingScore[]>;
|
|
1627
1657
|
}
|
|
1628
1658
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1659
|
+
interface XRWorldInformation {
|
|
1660
|
+
detectedPlanes?: XRPlaneSet;
|
|
1631
1661
|
}
|
|
1632
1662
|
|
|
1633
|
-
interface
|
|
1663
|
+
interface XRSessionInit {
|
|
1664
|
+
trackedImages?: XRTrackedImageInit[];
|
|
1665
|
+
}
|
|
1634
1666
|
|
|
1635
|
-
|
|
1636
|
-
|
|
1667
|
+
interface XRLightEstimate {
|
|
1668
|
+
readonly sphericalHarmonicsCoefficients: Float32Array;
|
|
1669
|
+
readonly primaryLightDirection: DOMPointReadOnly;
|
|
1670
|
+
readonly primaryLightIntensity: DOMPointReadOnly;
|
|
1671
|
+
}
|
|
1637
1672
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1673
|
+
interface XREventHandler {
|
|
1674
|
+
(evt: Event): any;
|
|
1675
|
+
}
|
|
1640
1676
|
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1677
|
+
interface XRLightProbe extends EventTarget {
|
|
1678
|
+
readonly probeSpace: XRSpace;
|
|
1679
|
+
onreflectionchange: XREventHandler;
|
|
1680
|
+
}
|
|
1644
1681
|
|
|
1645
|
-
|
|
1682
|
+
/**
|
|
1683
|
+
* END: WebXR DOM Overlays Module
|
|
1684
|
+
* https://immersive-web.github.io/dom-overlays/
|
|
1685
|
+
*/
|
|
1646
1686
|
|
|
1647
|
-
|
|
1648
|
-
|
|
1687
|
+
/**
|
|
1688
|
+
* BEGIN: WebXR Depth Sensing Moudle
|
|
1689
|
+
* https://www.w3.org/TR/webxr-depth-sensing-1/
|
|
1690
|
+
*/
|
|
1649
1691
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
indexCount: GPUSize32,
|
|
1653
|
-
instanceCount?: GPUSize32 /* default=1 */,
|
|
1654
|
-
firstIndex?: GPUSize32 /* default=0 */,
|
|
1655
|
-
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
1656
|
-
firstInstance?: GPUSize32 /* default=0 */
|
|
1657
|
-
): void;
|
|
1692
|
+
type XRDepthUsage = "cpu-optimized" | "gpu-optimized";
|
|
1693
|
+
type XRDepthDataFormat = "luminance-alpha" | "float32";
|
|
1658
1694
|
|
|
1659
|
-
|
|
1660
|
-
|
|
1695
|
+
type XRDepthStateInit = {
|
|
1696
|
+
readonly usagePreference: XRDepthUsage[];
|
|
1697
|
+
readonly dataFormatPreference: XRDepthDataFormat[];
|
|
1698
|
+
};
|
|
1661
1699
|
|
|
1662
|
-
|
|
1700
|
+
interface XRSessionInit {
|
|
1701
|
+
depthSensing?: XRDepthStateInit;
|
|
1663
1702
|
}
|
|
1664
1703
|
|
|
1665
|
-
interface
|
|
1666
|
-
|
|
1667
|
-
|
|
1704
|
+
interface XRSession {
|
|
1705
|
+
readonly depthUsage: XRDepthUsage;
|
|
1706
|
+
readonly depthDataFormat: XRDepthDataFormat;
|
|
1668
1707
|
}
|
|
1669
1708
|
|
|
1670
|
-
interface
|
|
1709
|
+
interface XRDepthInformation {
|
|
1710
|
+
readonly width: number;
|
|
1711
|
+
readonly height: number;
|
|
1671
1712
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1713
|
+
readonly normDepthBufferFromNormView: XRRigidTransform;
|
|
1714
|
+
readonly rawValueToMeters: number;
|
|
1715
|
+
}
|
|
1674
1716
|
|
|
1675
|
-
|
|
1717
|
+
interface XRCPUDepthInformation extends XRDepthInformation {
|
|
1718
|
+
readonly data: ArrayBuffer;
|
|
1676
1719
|
|
|
1677
|
-
|
|
1720
|
+
getDepthInMeters(x: number, y: number): number;
|
|
1721
|
+
}
|
|
1678
1722
|
|
|
1679
|
-
|
|
1723
|
+
interface XRFrame {
|
|
1724
|
+
getDepthInformation(view: XRView): XRCPUDepthInformation | undefined;
|
|
1725
|
+
}
|
|
1680
1726
|
|
|
1681
|
-
|
|
1727
|
+
interface XRWebGLDepthInformation extends XRDepthInformation {
|
|
1728
|
+
readonly texture: WebGLTexture;
|
|
1729
|
+
}
|
|
1682
1730
|
|
|
1683
|
-
|
|
1731
|
+
interface XRWebGLBinding {
|
|
1732
|
+
getDepthInformation(view: XRView): XRWebGLDepthInformation | undefined;
|
|
1684
1733
|
}
|
|
1685
1734
|
|
|
1686
|
-
|
|
1687
|
-
|
|
1735
|
+
// enabledFeatures
|
|
1736
|
+
interface XRSession {
|
|
1737
|
+
enabledFeatures: string[];
|
|
1738
|
+
}
|
|
1688
1739
|
|
|
1689
|
-
|
|
1740
|
+
// Raw camera access
|
|
1690
1741
|
|
|
1691
|
-
|
|
1692
|
-
readonly
|
|
1742
|
+
interface XRView {
|
|
1743
|
+
readonly camera: XRCamera | undefined;
|
|
1693
1744
|
}
|
|
1694
1745
|
|
|
1695
|
-
interface
|
|
1696
|
-
|
|
1697
|
-
|
|
1746
|
+
interface XRCamera {
|
|
1747
|
+
readonly width: number;
|
|
1748
|
+
readonly height: number;
|
|
1698
1749
|
}
|
|
1699
1750
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
1751
|
+
interface XRWebGLBinding {
|
|
1752
|
+
getCameraImage(camera: XRCamera): WebGLTexture | undefined;
|
|
1753
|
+
}
|
|
1704
1754
|
|
|
1705
|
-
|
|
1706
|
-
unconfigure(): void;
|
|
1755
|
+
// Mesh Detection
|
|
1707
1756
|
|
|
1708
|
-
|
|
1757
|
+
interface XRMesh {
|
|
1758
|
+
meshSpace: XRSpace;
|
|
1759
|
+
vertices: Float32Array;
|
|
1760
|
+
indices: Uint32Array;
|
|
1761
|
+
lastChangedTime: DOMHighResTimeStamp;
|
|
1709
1762
|
}
|
|
1710
1763
|
|
|
1711
|
-
type
|
|
1764
|
+
type XRMeshSet = Set<XRMesh>;
|
|
1712
1765
|
|
|
1713
|
-
interface
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1766
|
+
interface XRFrame {
|
|
1767
|
+
detectedMeshes?: XRMeshSet;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/* eslint-disable babylonjs/available */
|
|
1771
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1772
|
+
interface GPUObjectBase {
|
|
1773
|
+
label: string | undefined;
|
|
1720
1774
|
}
|
|
1721
1775
|
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
class GPUDeviceLostInfo {
|
|
1725
|
-
readonly reason?: GPUDeviceLostReason;
|
|
1726
|
-
readonly message: string;
|
|
1776
|
+
interface GPUObjectDescriptorBase {
|
|
1777
|
+
label?: string;
|
|
1727
1778
|
}
|
|
1728
1779
|
|
|
1729
|
-
|
|
1730
|
-
|
|
1780
|
+
interface GPUSupportedLimits {
|
|
1781
|
+
[name: string]: number;
|
|
1782
|
+
|
|
1783
|
+
readonly maxTextureDimension1D: number;
|
|
1784
|
+
readonly maxTextureDimension2D: number;
|
|
1785
|
+
readonly maxTextureDimension3D: number;
|
|
1786
|
+
readonly maxTextureArrayLayers: number;
|
|
1787
|
+
readonly maxBindGroups: number;
|
|
1788
|
+
readonly maxBindGroupsPlusVertexBuffers: number;
|
|
1789
|
+
readonly maxBindingsPerBindGroup: number;
|
|
1790
|
+
readonly maxDynamicUniformBuffersPerPipelineLayout: number;
|
|
1791
|
+
readonly maxDynamicStorageBuffersPerPipelineLayout: number;
|
|
1792
|
+
readonly maxSampledTexturesPerShaderStage: number;
|
|
1793
|
+
readonly maxSamplersPerShaderStage: number;
|
|
1794
|
+
readonly maxStorageBuffersPerShaderStage: number;
|
|
1795
|
+
readonly maxStorageTexturesPerShaderStage: number;
|
|
1796
|
+
readonly maxUniformBuffersPerShaderStage: number;
|
|
1797
|
+
readonly maxUniformBufferBindingSize: number;
|
|
1798
|
+
readonly maxStorageBufferBindingSize: number;
|
|
1799
|
+
readonly minUniformBufferOffsetAlignment: number;
|
|
1800
|
+
readonly minStorageBufferOffsetAlignment: number;
|
|
1801
|
+
readonly maxVertexBuffers: number;
|
|
1802
|
+
readonly maxBufferSize: number;
|
|
1803
|
+
readonly maxVertexAttributes: number;
|
|
1804
|
+
readonly maxVertexBufferArrayStride: number;
|
|
1805
|
+
readonly maxInterStageShaderComponents: number;
|
|
1806
|
+
readonly maxInterStageShaderVariables: number;
|
|
1807
|
+
readonly maxColorAttachments: number;
|
|
1808
|
+
readonly maxColorAttachmentBytesPerSample: number;
|
|
1809
|
+
readonly maxComputeWorkgroupStorageSize: number;
|
|
1810
|
+
readonly maxComputeInvocationsPerWorkgroup: number;
|
|
1811
|
+
readonly maxComputeWorkgroupSizeX: number;
|
|
1812
|
+
readonly maxComputeWorkgroupSizeY: number;
|
|
1813
|
+
readonly maxComputeWorkgroupSizeZ: number;
|
|
1814
|
+
readonly maxComputeWorkgroupsPerDimension: number;
|
|
1731
1815
|
}
|
|
1732
1816
|
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1817
|
+
type GPUSupportedFeatures = ReadonlySet<string>;
|
|
1818
|
+
|
|
1819
|
+
type WGSLLanguageFeatures = ReadonlySet<string>;
|
|
1820
|
+
|
|
1821
|
+
interface GPUAdapterInfo {
|
|
1822
|
+
readonly vendor: string;
|
|
1823
|
+
readonly architecture: string;
|
|
1824
|
+
readonly device: string;
|
|
1825
|
+
readonly description: string;
|
|
1736
1826
|
}
|
|
1737
1827
|
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
readonly message: string;
|
|
1828
|
+
interface Navigator {
|
|
1829
|
+
readonly gpu: GPU | undefined;
|
|
1741
1830
|
}
|
|
1742
1831
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
readonly message: string;
|
|
1832
|
+
interface WorkerNavigator {
|
|
1833
|
+
readonly gpu: GPU | undefined;
|
|
1746
1834
|
}
|
|
1747
1835
|
|
|
1748
|
-
|
|
1836
|
+
class GPU {
|
|
1837
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | undefined>;
|
|
1838
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
1749
1839
|
|
|
1750
|
-
|
|
1751
|
-
constructor(type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit);
|
|
1752
|
-
readonly error: GPUError;
|
|
1840
|
+
readonly wgslLanguageFeatures: WGSLLanguageFeatures;
|
|
1753
1841
|
}
|
|
1754
1842
|
|
|
1755
|
-
interface
|
|
1756
|
-
|
|
1843
|
+
interface GPURequestAdapterOptions {
|
|
1844
|
+
powerPreference?: GPUPowerPreference;
|
|
1845
|
+
forceFallbackAdapter?: boolean /* default=false */;
|
|
1757
1846
|
}
|
|
1758
1847
|
|
|
1759
|
-
type
|
|
1760
|
-
type GPUStencilValue = number; /* unsigned long */
|
|
1761
|
-
type GPUSampleMask = number; /* unsigned long */
|
|
1762
|
-
type GPUDepthBias = number; /* long */
|
|
1763
|
-
|
|
1764
|
-
type GPUSize64 = number; /* unsigned long long */
|
|
1765
|
-
type GPUIntegerCoordinate = number; /* unsigned long */
|
|
1766
|
-
type GPUIndex32 = number; /* unsigned long */
|
|
1767
|
-
type GPUSize32 = number; /* unsigned long */
|
|
1768
|
-
type GPUSignedOffset32 = number; /* long */
|
|
1769
|
-
|
|
1770
|
-
type GPUSize64Out = number; /* unsigned long long */
|
|
1771
|
-
type GPUIntegerCoordinateOut = number; /* unsigned long */
|
|
1772
|
-
type GPUSize32Out = number; /* unsigned long */
|
|
1848
|
+
type GPUPowerPreference = "low-power" | "high-performance";
|
|
1773
1849
|
|
|
1774
|
-
|
|
1850
|
+
class GPUAdapter {
|
|
1851
|
+
// https://michalzalecki.com/nominal-typing-in-typescript/#approach-1-class-with-a-private-property
|
|
1852
|
+
readonly name: string;
|
|
1853
|
+
readonly features: GPUSupportedFeatures;
|
|
1854
|
+
readonly limits: GPUSupportedLimits;
|
|
1855
|
+
readonly isFallbackAdapter: boolean;
|
|
1775
1856
|
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
g: number;
|
|
1779
|
-
b: number;
|
|
1780
|
-
a: number;
|
|
1857
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
1858
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
1781
1859
|
}
|
|
1782
|
-
type GPUColor = [number, number, number, number] | GPUColorDict;
|
|
1783
1860
|
|
|
1784
|
-
interface
|
|
1785
|
-
|
|
1786
|
-
|
|
1861
|
+
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
1862
|
+
requiredFeatures?: GPUFeatureName[] /* default=[] */;
|
|
1863
|
+
requiredLimits?: { [name: string]: GPUSize64 } /* default={} */;
|
|
1864
|
+
defaultQueue?: GPUQueueDescriptor /* default={} */;
|
|
1787
1865
|
}
|
|
1788
|
-
type GPUOrigin2D = [GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUOrigin2DDict;
|
|
1789
1866
|
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1867
|
+
type GPUFeatureName =
|
|
1868
|
+
| "depth-clip-control"
|
|
1869
|
+
| "depth32float-stencil8"
|
|
1870
|
+
| "texture-compression-bc"
|
|
1871
|
+
| "texture-compression-etc2"
|
|
1872
|
+
| "texture-compression-astc"
|
|
1873
|
+
| "timestamp-query"
|
|
1874
|
+
| "indirect-first-instance"
|
|
1875
|
+
| "shader-f16"
|
|
1876
|
+
| "rg11b10ufloat-renderable"
|
|
1877
|
+
| "bgra8unorm-storage"
|
|
1878
|
+
| "float32-filterable";
|
|
1796
1879
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
height?: GPUIntegerCoordinate /* default=1 */;
|
|
1800
|
-
depthOrArrayLayers?: GPUIntegerCoordinate /* default=1 */;
|
|
1801
|
-
}
|
|
1802
|
-
type GPUExtent3D = [GPUIntegerCoordinate, GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUExtent3DDict;
|
|
1803
|
-
|
|
1804
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1805
|
-
// Type definitions for non-npm package webxr 0.5
|
|
1806
|
-
// Project: https://www.w3.org/TR/webxr/
|
|
1807
|
-
// Definitions by: Rob Rohan <https://github.com/robrohan>
|
|
1808
|
-
// Raanan Weber <https://github.com/RaananW>
|
|
1809
|
-
// Sean T. McBeth <https://github.com/capnmidnight>
|
|
1810
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
1811
|
-
// Minimum TypeScript Version: 3.7
|
|
1880
|
+
class GPUDevice extends EventTarget implements GPUObjectBase {
|
|
1881
|
+
label: string | undefined;
|
|
1812
1882
|
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
// https://www.w3.org/TR/webxr/
|
|
1816
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API
|
|
1817
|
-
// https://www.w3.org/immersive-web/
|
|
1818
|
-
// https://github.com/immersive-web
|
|
1819
|
-
//
|
|
1883
|
+
readonly features: GPUSupportedFeatures;
|
|
1884
|
+
readonly limits: GPUSupportedLimits;
|
|
1820
1885
|
|
|
1821
|
-
|
|
1822
|
-
* ref: https://immersive-web.github.io/webxr/#navigator-xr-attribute
|
|
1823
|
-
*/
|
|
1824
|
-
interface Navigator {
|
|
1825
|
-
/**
|
|
1826
|
-
* An XRSystem object is the entry point to the API, used to query for XR features
|
|
1827
|
-
* available to the user agent and initiate communication with XR hardware via the
|
|
1828
|
-
* creation of XRSessions.
|
|
1829
|
-
*/
|
|
1830
|
-
xr?: XRSystem | undefined;
|
|
1831
|
-
}
|
|
1886
|
+
readonly queue: GPUQueue;
|
|
1832
1887
|
|
|
1833
|
-
|
|
1834
|
-
* WebGL Context Compatability
|
|
1835
|
-
*
|
|
1836
|
-
* ref: https://immersive-web.github.io/webxr/#contextcompatibility
|
|
1837
|
-
*/
|
|
1838
|
-
interface WebGLContextAttributes {
|
|
1839
|
-
xrCompatible?: boolean | undefined;
|
|
1840
|
-
}
|
|
1888
|
+
destroy(): void;
|
|
1841
1889
|
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1890
|
+
createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer;
|
|
1891
|
+
createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
|
|
1892
|
+
createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
|
|
1893
|
+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
|
|
1845
1894
|
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
* ref: https://immersive-web.github.io/webxr/#xrsessionmode-enum
|
|
1850
|
-
*/
|
|
1851
|
-
type XRSessionMode = "inline" | "immersive-vr" | "immersive-ar";
|
|
1895
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
1896
|
+
createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout;
|
|
1897
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
1852
1898
|
|
|
1853
|
-
|
|
1854
|
-
* Reference space types
|
|
1855
|
-
*/
|
|
1856
|
-
type XRReferenceSpaceType = "viewer" | "local" | "local-floor" | "bounded-floor" | "unbounded";
|
|
1899
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
1857
1900
|
|
|
1858
|
-
|
|
1901
|
+
createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline;
|
|
1902
|
+
createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
|
|
1903
|
+
createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>;
|
|
1904
|
+
createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
|
|
1859
1905
|
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
*/
|
|
1863
|
-
type XRVisibilityState = "visible" | "visible-blurred" | "hidden";
|
|
1906
|
+
createCommandEncoder(descriptor?: GPUCommandEncoderDescriptor): GPUCommandEncoder;
|
|
1907
|
+
createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
|
|
1864
1908
|
|
|
1865
|
-
|
|
1866
|
-
* Handedness types
|
|
1867
|
-
*/
|
|
1868
|
-
type XRHandedness = "none" | "left" | "right";
|
|
1909
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
1869
1910
|
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1911
|
+
readonly lost: Promise<GPUDeviceLostInfo>;
|
|
1912
|
+
pushErrorScope(filter: GPUErrorFilter): void;
|
|
1913
|
+
popErrorScope(): Promise<GPUError | undefined>;
|
|
1914
|
+
onuncapturederror: Event | undefined;
|
|
1915
|
+
}
|
|
1874
1916
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
*/
|
|
1878
|
-
type XREye = "none" | "left" | "right";
|
|
1917
|
+
class GPUBuffer implements GPUObjectBase {
|
|
1918
|
+
label: string | undefined;
|
|
1879
1919
|
|
|
1880
|
-
|
|
1920
|
+
readonly size: GPUSize64Out;
|
|
1921
|
+
readonly usage: GPUFlagsConstant;
|
|
1922
|
+
readonly mapState: GPUBufferMapState;
|
|
1881
1923
|
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1924
|
+
mapAsync(mode: GPUMapModeFlags, offset?: GPUSize64 /*default=0*/, size?: GPUSize64): Promise<void>;
|
|
1925
|
+
getMappedRange(offset?: GPUSize64 /*default=0*/, size?: GPUSize64): ArrayBuffer;
|
|
1926
|
+
unmap(): void;
|
|
1885
1927
|
|
|
1886
|
-
|
|
1887
|
-
(event: XRSystemDeviceChangeEvent): any;
|
|
1928
|
+
destroy(): void;
|
|
1888
1929
|
}
|
|
1889
1930
|
|
|
1890
|
-
|
|
1891
|
-
devicechange: XRSystemDeviceChangeEvent;
|
|
1892
|
-
}
|
|
1931
|
+
type GPUBufferMapState = "unmapped" | "pending" | "mapped";
|
|
1893
1932
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
* ref: https://immersive-web.github.io/webxr/#xrsystem-interface
|
|
1900
|
-
*/
|
|
1901
|
-
interface XRSystem extends EventTarget {
|
|
1902
|
-
/**
|
|
1903
|
-
* Attempts to initialize an XRSession for the given mode if possible, entering immersive
|
|
1904
|
-
* mode if necessary.
|
|
1905
|
-
* @param mode
|
|
1906
|
-
* @param options
|
|
1907
|
-
*/
|
|
1908
|
-
requestSession(mode: XRSessionMode, options?: XRSessionInit): Promise<XRSession>;
|
|
1933
|
+
interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
1934
|
+
size: GPUSize64;
|
|
1935
|
+
usage: GPUBufferUsageFlags;
|
|
1936
|
+
mappedAtCreation: boolean /* default=false */;
|
|
1937
|
+
}
|
|
1909
1938
|
|
|
1910
|
-
|
|
1911
|
-
* Queries if a given mode may be supported by the user agent and device capabilities.
|
|
1912
|
-
* @param mode
|
|
1913
|
-
*/
|
|
1914
|
-
isSessionSupported(mode: XRSessionMode): Promise<boolean>;
|
|
1939
|
+
type GPUBufferUsageFlags = number;
|
|
1915
1940
|
|
|
1916
|
-
|
|
1941
|
+
type GPUMapModeFlags = number;
|
|
1917
1942
|
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
removeEventListener<K extends keyof XRSystemEventMap>(type: K, listener: (this: XRSystem, ev: XRSystemEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1921
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1922
|
-
}
|
|
1943
|
+
class GPUTexture implements GPUObjectBase {
|
|
1944
|
+
label: string | undefined;
|
|
1923
1945
|
|
|
1924
|
-
|
|
1946
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
1947
|
+
destroy(): void;
|
|
1925
1948
|
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
readonly
|
|
1933
|
-
readonly
|
|
1934
|
-
readonly width: number;
|
|
1935
|
-
readonly height: number;
|
|
1949
|
+
readonly width: GPUIntegerCoordinateOut;
|
|
1950
|
+
readonly height: GPUIntegerCoordinateOut;
|
|
1951
|
+
readonly depthOrArrayLayers: GPUIntegerCoordinateOut;
|
|
1952
|
+
readonly mipLevelCount: GPUIntegerCoordinateOut;
|
|
1953
|
+
readonly sampleCount: GPUSize32Out;
|
|
1954
|
+
readonly dimension: GPUTextureDimension;
|
|
1955
|
+
readonly format: GPUTextureFormat;
|
|
1956
|
+
readonly usage: GPUFlagsConstant;
|
|
1936
1957
|
}
|
|
1937
1958
|
|
|
1938
|
-
|
|
1959
|
+
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
1960
|
+
size: GPUExtent3D;
|
|
1961
|
+
mipLevelCount?: GPUIntegerCoordinate /* default=1 */;
|
|
1962
|
+
sampleCount?: GPUSize32 /* default=1 */;
|
|
1963
|
+
dimension?: GPUTextureDimension /* default="2d" */;
|
|
1964
|
+
format: GPUTextureFormat;
|
|
1965
|
+
usage: GPUTextureUsageFlags;
|
|
1966
|
+
viewFormats?: GPUTextureFormat[] /* default=[] */;
|
|
1967
|
+
}
|
|
1939
1968
|
|
|
1940
|
-
|
|
1941
|
-
* Represents a virtual coordinate system with an origin that corresponds to a physical location.
|
|
1942
|
-
* Spatial data that is requested from the API or given to the API is always expressed in relation
|
|
1943
|
-
* to a specific XRSpace at the time of a specific XRFrame. Numeric values such as pose positions
|
|
1944
|
-
* are coordinates in that space relative to its origin. The interface is intentionally opaque.
|
|
1945
|
-
*
|
|
1946
|
-
* ref: https://immersive-web.github.io/webxr/#xrspace-interface
|
|
1947
|
-
*/
|
|
1948
|
-
// tslint:disable-next-line no-empty-interface
|
|
1949
|
-
interface XRSpace extends EventTarget {}
|
|
1969
|
+
type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
1950
1970
|
|
|
1951
|
-
|
|
1971
|
+
type GPUTextureUsageFlags = number;
|
|
1952
1972
|
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
depthFar?: number | undefined;
|
|
1956
|
-
depthNear?: number | undefined;
|
|
1957
|
-
inlineVerticalFieldOfView?: number | undefined;
|
|
1973
|
+
class GPUTextureView implements GPUObjectBase {
|
|
1974
|
+
label: string | undefined;
|
|
1958
1975
|
}
|
|
1959
1976
|
|
|
1960
|
-
interface
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1977
|
+
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
|
|
1978
|
+
format: GPUTextureFormat;
|
|
1979
|
+
dimension: GPUTextureViewDimension;
|
|
1980
|
+
aspect?: GPUTextureAspect /* default="all" */;
|
|
1981
|
+
baseMipLevel?: GPUIntegerCoordinate /* default=0 */;
|
|
1982
|
+
mipLevelCount: GPUIntegerCoordinate;
|
|
1983
|
+
baseArrayLayer?: GPUIntegerCoordinate /* default=0*/;
|
|
1984
|
+
arrayLayerCount: GPUIntegerCoordinate;
|
|
1965
1985
|
}
|
|
1966
1986
|
|
|
1967
|
-
|
|
1987
|
+
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d";
|
|
1968
1988
|
|
|
1969
|
-
|
|
1970
|
-
referenceSpace?: XRReferenceSpace | undefined;
|
|
1971
|
-
transform?: XRRigidTransform | undefined;
|
|
1972
|
-
}
|
|
1989
|
+
type GPUTextureAspect = "all" | "stencil-only" | "depth-only";
|
|
1973
1990
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
readonly type: "reset";
|
|
1981
|
-
readonly referenceSpace: XRReferenceSpace;
|
|
1982
|
-
readonly transform?: XRRigidTransform | undefined;
|
|
1983
|
-
}
|
|
1991
|
+
type GPUTextureFormat =
|
|
1992
|
+
// 8-bit formats
|
|
1993
|
+
| "r8unorm"
|
|
1994
|
+
| "r8snorm"
|
|
1995
|
+
| "r8uint"
|
|
1996
|
+
| "r8sint"
|
|
1984
1997
|
|
|
1985
|
-
//
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1998
|
+
// 16-bit formats
|
|
1999
|
+
| "r16uint"
|
|
2000
|
+
| "r16sint"
|
|
2001
|
+
| "r16float"
|
|
2002
|
+
| "rg8unorm"
|
|
2003
|
+
| "rg8snorm"
|
|
2004
|
+
| "rg8uint"
|
|
2005
|
+
| "rg8sint"
|
|
1989
2006
|
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
2007
|
+
// 32-bit formats
|
|
2008
|
+
| "r32uint"
|
|
2009
|
+
| "r32sint"
|
|
2010
|
+
| "r32float"
|
|
2011
|
+
| "rg16uint"
|
|
2012
|
+
| "rg16sint"
|
|
2013
|
+
| "rg16float"
|
|
2014
|
+
| "rgba8unorm"
|
|
2015
|
+
| "rgba8unorm-srgb"
|
|
2016
|
+
| "rgba8snorm"
|
|
2017
|
+
| "rgba8uint"
|
|
2018
|
+
| "rgba8sint"
|
|
2019
|
+
| "bgra8unorm"
|
|
2020
|
+
| "bgra8unorm-srgb"
|
|
2021
|
+
// Packed 32-bit formats
|
|
2022
|
+
| "rgb9e5ufloat"
|
|
2023
|
+
| "rgb10a2uint"
|
|
2024
|
+
| "rgb10a2unorm"
|
|
2025
|
+
| "rg11b10ufloat"
|
|
1993
2026
|
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2027
|
+
// 64-bit formats
|
|
2028
|
+
| "rg32uint"
|
|
2029
|
+
| "rg32sint"
|
|
2030
|
+
| "rg32float"
|
|
2031
|
+
| "rgba16uint"
|
|
2032
|
+
| "rgba16sint"
|
|
2033
|
+
| "rgba16float"
|
|
1997
2034
|
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
* ref: https://immersive-web.github.io/webxr/#xrreferencespace-interface
|
|
2003
|
-
*/
|
|
2004
|
-
interface XRReferenceSpace extends XRSpace {
|
|
2005
|
-
getOffsetReferenceSpace(originOffset: XRRigidTransform): XRReferenceSpace;
|
|
2006
|
-
onreset: XRReferenceSpaceEventHandler;
|
|
2035
|
+
// 128-bit formats
|
|
2036
|
+
| "rgba32uint"
|
|
2037
|
+
| "rgba32sint"
|
|
2038
|
+
| "rgba32float"
|
|
2007
2039
|
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
removeEventListener<K extends keyof XRReferenceSpaceEventMap>(
|
|
2015
|
-
type: K,
|
|
2016
|
-
listener: (this: XRReferenceSpace, ev: XRReferenceSpaceEventMap[K]) => any,
|
|
2017
|
-
options?: boolean | EventListenerOptions
|
|
2018
|
-
): void;
|
|
2019
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2020
|
-
}
|
|
2040
|
+
// Depth and stencil formats
|
|
2041
|
+
| "stencil8"
|
|
2042
|
+
| "depth16unorm"
|
|
2043
|
+
| "depth24plus"
|
|
2044
|
+
| "depth24plus-stencil8"
|
|
2045
|
+
| "depth32float"
|
|
2021
2046
|
|
|
2022
|
-
|
|
2047
|
+
// "depth32float-stencil8" feature
|
|
2048
|
+
| "depth32float-stencil8"
|
|
2023
2049
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2050
|
+
// BC compressed formats usable if "texture-compression-bc" is both
|
|
2051
|
+
// supported by the device/user agent and enabled in requestDevice.
|
|
2052
|
+
| "bc1-rgba-unorm"
|
|
2053
|
+
| "bc1-rgba-unorm-srgb"
|
|
2054
|
+
| "bc2-rgba-unorm"
|
|
2055
|
+
| "bc2-rgba-unorm-srgb"
|
|
2056
|
+
| "bc3-rgba-unorm"
|
|
2057
|
+
| "bc3-rgba-unorm-srgb"
|
|
2058
|
+
| "bc4-r-unorm"
|
|
2059
|
+
| "bc4-r-snorm"
|
|
2060
|
+
| "bc5-rg-unorm"
|
|
2061
|
+
| "bc5-rg-snorm"
|
|
2062
|
+
| "bc6h-rgb-ufloat"
|
|
2063
|
+
| "bc6h-rgb-float"
|
|
2064
|
+
| "bc7-rgba-unorm"
|
|
2065
|
+
| "bc7-rgba-unorm-srgb"
|
|
2066
|
+
|
|
2067
|
+
// ETC2 compressed formats usable if "texture-compression-etc2" is both
|
|
2068
|
+
// supported by the device/user agent and enabled in requestDevice.
|
|
2069
|
+
| "etc2-rgb8unorm"
|
|
2070
|
+
| "etc2-rgb8unorm-srgb"
|
|
2071
|
+
| "etc2-rgb8a1unorm"
|
|
2072
|
+
| "etc2-rgb8a1unorm-srgb"
|
|
2073
|
+
| "etc2-rgba8unorm"
|
|
2074
|
+
| "etc2-rgba8unorm-srgb"
|
|
2075
|
+
| "eac-r11unorm"
|
|
2076
|
+
| "eac-r11snorm"
|
|
2077
|
+
| "eac-rg11unorm"
|
|
2078
|
+
| "eac-rg11snorm"
|
|
2079
|
+
|
|
2080
|
+
// ASTC compressed formats usable if "texture-compression-astc" is both
|
|
2081
|
+
// supported by the device/user agent and enabled in requestDevice.
|
|
2082
|
+
| "astc-4x4-unorm"
|
|
2083
|
+
| "astc-4x4-unorm-srgb"
|
|
2084
|
+
| "astc-5x4-unorm"
|
|
2085
|
+
| "astc-5x4-unorm-srgb"
|
|
2086
|
+
| "astc-5x5-unorm"
|
|
2087
|
+
| "astc-5x5-unorm-srgb"
|
|
2088
|
+
| "astc-6x5-unorm"
|
|
2089
|
+
| "astc-6x5-unorm-srgb"
|
|
2090
|
+
| "astc-6x6-unorm"
|
|
2091
|
+
| "astc-6x6-unorm-srgb"
|
|
2092
|
+
| "astc-8x5-unorm"
|
|
2093
|
+
| "astc-8x5-unorm-srgb"
|
|
2094
|
+
| "astc-8x6-unorm"
|
|
2095
|
+
| "astc-8x6-unorm-srgb"
|
|
2096
|
+
| "astc-8x8-unorm"
|
|
2097
|
+
| "astc-8x8-unorm-srgb"
|
|
2098
|
+
| "astc-10x5-unorm"
|
|
2099
|
+
| "astc-10x5-unorm-srgb"
|
|
2100
|
+
| "astc-10x6-unorm"
|
|
2101
|
+
| "astc-10x6-unorm-srgb"
|
|
2102
|
+
| "astc-10x8-unorm"
|
|
2103
|
+
| "astc-10x8-unorm-srgb"
|
|
2104
|
+
| "astc-10x10-unorm"
|
|
2105
|
+
| "astc-10x10-unorm-srgb"
|
|
2106
|
+
| "astc-12x10-unorm"
|
|
2107
|
+
| "astc-12x10-unorm-srgb"
|
|
2108
|
+
| "astc-12x12-unorm"
|
|
2109
|
+
| "astc-12x12-unorm-srgb";
|
|
2110
|
+
|
|
2111
|
+
class GPUExternalTexture implements GPUObjectBase {
|
|
2112
|
+
label: string | undefined;
|
|
2032
2113
|
}
|
|
2033
2114
|
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
* Represents an XR input source, which is any input mechanism which allows the user to perform
|
|
2038
|
-
* targeted actions in the same virtual space as the viewer. Example XR input sources include,
|
|
2039
|
-
* but are not limited to, handheld controllers, optically tracked hands, and gaze-based input
|
|
2040
|
-
* methods that operate on the viewer's pose. Input mechanisms which are not explicitly associated
|
|
2041
|
-
* with the XR device, such as traditional gamepads, mice, or keyboards SHOULD NOT be considered
|
|
2042
|
-
* XR input sources.
|
|
2043
|
-
* ref: https://immersive-web.github.io/webxr/#xrinputsource-interface
|
|
2044
|
-
*/
|
|
2045
|
-
interface XRInputSource {
|
|
2046
|
-
readonly handedness: XRHandedness;
|
|
2047
|
-
readonly targetRayMode: XRTargetRayMode;
|
|
2048
|
-
readonly targetRaySpace: XRSpace;
|
|
2049
|
-
readonly gripSpace?: XRSpace | undefined;
|
|
2050
|
-
readonly gamepad?: Gamepad | undefined;
|
|
2051
|
-
readonly profiles: string[];
|
|
2052
|
-
readonly hand?: XRHand;
|
|
2115
|
+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
|
|
2116
|
+
source: HTMLVideoElement | VideoFrame;
|
|
2117
|
+
colorSpace?: PredefinedColorSpace /* default="srgb" */;
|
|
2053
2118
|
}
|
|
2054
2119
|
|
|
2055
|
-
|
|
2120
|
+
class GPUSampler implements GPUObjectBase {
|
|
2121
|
+
label: string | undefined;
|
|
2122
|
+
}
|
|
2056
2123
|
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2124
|
+
interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
2125
|
+
addressModeU?: GPUAddressMode /* default="clamp-to-edge" */;
|
|
2126
|
+
addressModeV?: GPUAddressMode /* default="clamp-to-edge" */;
|
|
2127
|
+
addressModeW?: GPUAddressMode /* default="clamp-to-edge" */;
|
|
2128
|
+
magFilter?: GPUFilterMode /* default="nearest" */;
|
|
2129
|
+
minFilter?: GPUFilterMode /* default="nearest" */;
|
|
2130
|
+
mipmapFilter?: GPUMipmapFilterMode /* default="nearest" */;
|
|
2131
|
+
lodMinClamp?: number /* default=0 */;
|
|
2132
|
+
lodMaxClamp?: number /* default=32 */;
|
|
2133
|
+
compare?: GPUCompareFunction;
|
|
2134
|
+
maxAnisotropy?: number /* default=1 */;
|
|
2135
|
+
}
|
|
2065
2136
|
|
|
2066
|
-
|
|
2137
|
+
type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat";
|
|
2067
2138
|
|
|
2068
|
-
|
|
2069
|
-
keys(): IterableIterator<number>;
|
|
2070
|
-
values(): IterableIterator<XRInputSource>;
|
|
2139
|
+
type GPUFilterMode = "nearest" | "linear";
|
|
2071
2140
|
|
|
2072
|
-
|
|
2073
|
-
}
|
|
2141
|
+
type GPUMipmapFilterMode = "nearest" | "linear";
|
|
2074
2142
|
|
|
2075
|
-
|
|
2143
|
+
type GPUCompareFunction = "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always";
|
|
2076
2144
|
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
*
|
|
2080
|
-
* ref: https://immersive-web.github.io/webxr/#xrpose-interface
|
|
2081
|
-
*/
|
|
2082
|
-
interface XRPose {
|
|
2083
|
-
readonly transform: XRRigidTransform;
|
|
2084
|
-
readonly emulatedPosition: boolean;
|
|
2145
|
+
class GPUBindGroupLayout implements GPUObjectBase {
|
|
2146
|
+
label: string | undefined;
|
|
2085
2147
|
}
|
|
2086
2148
|
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
* Represents a snapshot of the state of all of the tracked objects for an XRSession. Applications
|
|
2091
|
-
* can acquire an XRFrame by calling requestAnimationFrame() on an XRSession with an
|
|
2092
|
-
* XRFrameRequestCallback. When the callback is called it will be passed an XRFrame.
|
|
2093
|
-
* Events which need to communicate tracking state, such as the select event, will also provide an
|
|
2094
|
-
* XRFrame.
|
|
2095
|
-
*
|
|
2096
|
-
* ref: https://immersive-web.github.io/webxr/#xrframe-interface
|
|
2097
|
-
*/
|
|
2098
|
-
interface XRFrame {
|
|
2099
|
-
readonly session: XRSession;
|
|
2100
|
-
// BABYLON CHANGE - switched to optional
|
|
2101
|
-
readonly predictedDisplayTime?: DOMHighResTimeStamp;
|
|
2149
|
+
interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
2150
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2151
|
+
}
|
|
2102
2152
|
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
*
|
|
2107
|
-
* @param space
|
|
2108
|
-
* @param baseSpace
|
|
2109
|
-
*/
|
|
2110
|
-
getPose(space: XRSpace, baseSpace: XRSpace): XRPose | undefined;
|
|
2153
|
+
interface GPUBindGroupLayoutEntry {
|
|
2154
|
+
binding: GPUIndex32;
|
|
2155
|
+
visibility: GPUShaderStageFlags;
|
|
2111
2156
|
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
*/
|
|
2118
|
-
getViewerPose(referenceSpace: XRReferenceSpace): XRViewerPose | undefined;
|
|
2157
|
+
buffer?: GPUBufferBindingLayout;
|
|
2158
|
+
sampler?: GPUSamplerBindingLayout;
|
|
2159
|
+
texture?: GPUTextureBindingLayout;
|
|
2160
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2161
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
2119
2162
|
}
|
|
2120
2163
|
|
|
2121
|
-
|
|
2164
|
+
type GPUShaderStageFlags = number;
|
|
2122
2165
|
|
|
2123
|
-
|
|
2124
|
-
* Type of XR events available
|
|
2125
|
-
*/
|
|
2126
|
-
type XRInputSourceEventType = "select" | "selectend" | "selectstart" | "squeeze" | "squeezeend" | "squeezestart";
|
|
2166
|
+
type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
|
|
2127
2167
|
|
|
2128
|
-
interface
|
|
2129
|
-
|
|
2130
|
-
|
|
2168
|
+
interface GPUBufferBindingLayout {
|
|
2169
|
+
type?: GPUBufferBindingType /* default="uniform" */;
|
|
2170
|
+
hasDynamicOffset?: boolean /* default=false */;
|
|
2171
|
+
minBindingSize?: GPUSize64 /* default=0 */;
|
|
2131
2172
|
}
|
|
2132
2173
|
|
|
2133
|
-
|
|
2134
|
-
* XRInputSourceEvents are fired to indicate changes to the state of an XRInputSource.
|
|
2135
|
-
* ref: https://immersive-web.github.io/webxr/#xrinputsourceevent-interface
|
|
2136
|
-
*/
|
|
2137
|
-
class XRInputSourceEvent extends Event {
|
|
2138
|
-
readonly type: XRInputSourceEventType;
|
|
2139
|
-
readonly frame: XRFrame;
|
|
2140
|
-
readonly inputSource: XRInputSource;
|
|
2174
|
+
type GPUSamplerBindingType = "filtering" | "non-filtering" | "comparison";
|
|
2141
2175
|
|
|
2142
|
-
|
|
2176
|
+
interface GPUSamplerBindingLayout {
|
|
2177
|
+
type?: GPUSamplerBindingType /* default="filtering" */;
|
|
2143
2178
|
}
|
|
2144
2179
|
|
|
2145
|
-
|
|
2146
|
-
|
|
2180
|
+
type GPUTextureSampleType = "float" | "unfilterable-float" | "depth" | "sint" | "uint";
|
|
2181
|
+
|
|
2182
|
+
interface GPUTextureBindingLayout {
|
|
2183
|
+
sampleType?: GPUTextureSampleType /* default="float" */;
|
|
2184
|
+
viewDimension?: GPUTextureViewDimension /* default="2d" */;
|
|
2185
|
+
multisampled?: boolean /* default=false */;
|
|
2147
2186
|
}
|
|
2148
2187
|
|
|
2149
|
-
type
|
|
2188
|
+
type GPUStorageTextureAccess = "write-only" | "read-only" | "read-write";
|
|
2150
2189
|
|
|
2151
|
-
interface
|
|
2152
|
-
|
|
2190
|
+
interface GPUStorageTextureBindingLayout {
|
|
2191
|
+
access?: GPUStorageTextureAccess /* default=write-only */;
|
|
2192
|
+
format: GPUTextureFormat;
|
|
2193
|
+
viewDimension?: GPUTextureViewDimension /* default="2d" */;
|
|
2153
2194
|
}
|
|
2154
2195
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
class XRSessionEvent extends Event {
|
|
2160
|
-
readonly session: XRSession;
|
|
2161
|
-
constructor(type: XRSessionEventType, eventInitDict?: XRSessionEventInit);
|
|
2196
|
+
interface GPUExternalTextureBindingLayout {}
|
|
2197
|
+
|
|
2198
|
+
class GPUBindGroup implements GPUObjectBase {
|
|
2199
|
+
label: string | undefined;
|
|
2162
2200
|
}
|
|
2163
2201
|
|
|
2164
|
-
interface
|
|
2165
|
-
|
|
2202
|
+
interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase {
|
|
2203
|
+
layout: GPUBindGroupLayout;
|
|
2204
|
+
entries: GPUBindGroupEntry[];
|
|
2166
2205
|
}
|
|
2167
2206
|
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
requiredFeatures?: string[] | undefined;
|
|
2207
|
+
type GPUBindingResource = GPUSampler | GPUTextureView | GPUBufferBinding | GPUExternalTexture;
|
|
2208
|
+
|
|
2209
|
+
interface GPUBindGroupEntry {
|
|
2210
|
+
binding: GPUIndex32;
|
|
2211
|
+
resource: GPUBindingResource;
|
|
2174
2212
|
}
|
|
2175
2213
|
|
|
2176
|
-
interface
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
frameratechange: XRSessionEvent;
|
|
2181
|
-
select: XRInputSourceEvent;
|
|
2182
|
-
selectstart: XRInputSourceEvent;
|
|
2183
|
-
selectend: XRInputSourceEvent;
|
|
2184
|
-
squeeze: XRInputSourceEvent;
|
|
2185
|
-
squeezestart: XRInputSourceEvent;
|
|
2186
|
-
squeezeend: XRInputSourceEvent;
|
|
2187
|
-
eyetrackingstart: XREyeTrackingSourceEvent;
|
|
2188
|
-
eyetrackingend: XREyeTrackingSourceEvent;
|
|
2214
|
+
interface GPUBufferBinding {
|
|
2215
|
+
buffer: GPUBuffer;
|
|
2216
|
+
offset?: GPUSize64 /* default=0 */;
|
|
2217
|
+
size?: GPUSize64 /* default=size_of_buffer - offset */;
|
|
2189
2218
|
}
|
|
2190
2219
|
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
* successfully acquired, it can be used to poll the viewer pose, query information about
|
|
2195
|
-
* the user's environment, and present imagery to the user.
|
|
2196
|
-
*
|
|
2197
|
-
* ref: https://immersive-web.github.io/webxr/#xrsession-interface
|
|
2198
|
-
*/
|
|
2199
|
-
interface XRSession extends EventTarget {
|
|
2200
|
-
/**
|
|
2201
|
-
* Returns a list of this session's XRInputSources, each representing an input device
|
|
2202
|
-
* used to control the camera and/or scene.
|
|
2203
|
-
*/
|
|
2204
|
-
readonly inputSources: XRInputSourceArray;
|
|
2205
|
-
/**
|
|
2206
|
-
* object which contains options affecting how the imagery is rendered.
|
|
2207
|
-
* This includes things such as the near and far clipping planes
|
|
2208
|
-
*/
|
|
2209
|
-
readonly renderState: XRRenderState;
|
|
2210
|
-
readonly environmentBlendMode: XREnvironmentBlendMode;
|
|
2211
|
-
readonly visibilityState: XRVisibilityState;
|
|
2212
|
-
readonly frameRate?: number | undefined;
|
|
2213
|
-
readonly supportedFrameRates?: Float32Array | undefined;
|
|
2220
|
+
class GPUPipelineLayout implements GPUObjectBase {
|
|
2221
|
+
label: string | undefined;
|
|
2222
|
+
}
|
|
2214
2223
|
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
* identifying handle returned by a previous call to requestAnimationFrame().
|
|
2219
|
-
*/
|
|
2220
|
-
cancelAnimationFrame(id: number): void;
|
|
2224
|
+
interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
2225
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2226
|
+
}
|
|
2221
2227
|
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
* session has been shut down.
|
|
2225
|
-
*/
|
|
2226
|
-
end(): Promise<void>;
|
|
2228
|
+
class GPUShaderModule implements GPUObjectBase {
|
|
2229
|
+
label: string | undefined;
|
|
2227
2230
|
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
* is working on rendering an animation frame for the WebXR device. Returns an
|
|
2231
|
-
* integer value which can be used to identify the request for the purposes of
|
|
2232
|
-
* canceling the callback using cancelAnimationFrame(). This method is comparable
|
|
2233
|
-
* to the Window.requestAnimationFrame() method.
|
|
2234
|
-
*/
|
|
2235
|
-
requestAnimationFrame(callback: XRFrameRequestCallback): number;
|
|
2231
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2232
|
+
}
|
|
2236
2233
|
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
*/
|
|
2243
|
-
requestReferenceSpace(type: XRReferenceSpaceType): Promise<XRReferenceSpace | XRBoundedReferenceSpace>;
|
|
2234
|
+
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
|
|
2235
|
+
code: string | Uint32Array;
|
|
2236
|
+
sourceMap?: object;
|
|
2237
|
+
compilationHints?: GPUShaderModuleCompilationHint[] /* default=[] */;
|
|
2238
|
+
}
|
|
2244
2239
|
|
|
2245
|
-
|
|
2240
|
+
interface GPUShaderModuleCompilationHint {
|
|
2241
|
+
entryPoint: string | Uint32Array;
|
|
2242
|
+
layout: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
2243
|
+
}
|
|
2246
2244
|
|
|
2247
|
-
|
|
2245
|
+
type GPUCompilationMessageType = "error" | "warning" | "info";
|
|
2248
2246
|
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
onvisibilitychange: XRSessionEventHandler;
|
|
2258
|
-
onframeratechange: XRSessionEventHandler;
|
|
2247
|
+
interface GPUCompilationMessage {
|
|
2248
|
+
readonly message: string;
|
|
2249
|
+
readonly type: GPUCompilationMessageType;
|
|
2250
|
+
readonly lineNum: number;
|
|
2251
|
+
readonly linePos: number;
|
|
2252
|
+
readonly offset: number;
|
|
2253
|
+
readonly length: number;
|
|
2254
|
+
}
|
|
2259
2255
|
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
removeEventListener<K extends keyof XRSessionEventMap>(type: K, listener: (this: XRSession, ev: XRSessionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
2263
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2256
|
+
interface GPUCompilationInfo {
|
|
2257
|
+
readonly messages: readonly GPUCompilationMessage[];
|
|
2264
2258
|
}
|
|
2265
2259
|
|
|
2266
|
-
|
|
2260
|
+
class GPUPipelineError extends DOMException {
|
|
2261
|
+
constructor(message: string | undefined, options: GPUPipelineErrorInit);
|
|
2262
|
+
readonly reason: GPUPipelineErrorReason;
|
|
2263
|
+
}
|
|
2267
2264
|
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
* device. A viewer may represent a tracked piece of hardware, the observed position
|
|
2271
|
-
* of a user's head relative to the hardware, or some other means of computing a series
|
|
2272
|
-
* of viewpoints into the XR scene. XRViewerPoses can only be queried relative to an
|
|
2273
|
-
* XRReferenceSpace. It provides, in addition to the XRPose values, an array of views
|
|
2274
|
-
* which include rigid transforms to indicate the viewpoint and projection matrices.
|
|
2275
|
-
* These values should be used by the application when rendering a frame of an XR scene.
|
|
2276
|
-
*
|
|
2277
|
-
* ref: https://immersive-web.github.io/webxr/#xrviewerpose-interface
|
|
2278
|
-
*/
|
|
2279
|
-
interface XRViewerPose extends XRPose {
|
|
2280
|
-
readonly views: ReadonlyArray<XRView>;
|
|
2265
|
+
interface GPUPipelineErrorInit {
|
|
2266
|
+
reason: GPUPipelineErrorReason;
|
|
2281
2267
|
}
|
|
2282
2268
|
|
|
2283
|
-
|
|
2269
|
+
type GPUPipelineErrorReason = "validation" | "internal";
|
|
2284
2270
|
|
|
2285
|
-
|
|
2286
|
-
* A transform described by a position and orientation. When interpreting an
|
|
2287
|
-
* XRRigidTransform the orientation is always applied prior to the position.
|
|
2288
|
-
*
|
|
2289
|
-
* ref: https://immersive-web.github.io/webxr/#xrrigidtransform-interface
|
|
2290
|
-
*/
|
|
2291
|
-
class XRRigidTransform {
|
|
2292
|
-
readonly position: DOMPointReadOnly;
|
|
2293
|
-
readonly orientation: DOMPointReadOnly;
|
|
2294
|
-
readonly matrix: Float32Array;
|
|
2295
|
-
readonly inverse: XRRigidTransform;
|
|
2271
|
+
type GPUAutoLayoutMode = "auto";
|
|
2296
2272
|
|
|
2297
|
-
|
|
2273
|
+
interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
|
|
2274
|
+
layout: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
2298
2275
|
}
|
|
2299
2276
|
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
*
|
|
2303
|
-
* ref: https://immersive-web.github.io/webxr/#xrview-interface
|
|
2304
|
-
*/
|
|
2305
|
-
interface XRView {
|
|
2306
|
-
readonly eye: XREye;
|
|
2307
|
-
readonly projectionMatrix: Float32Array;
|
|
2308
|
-
readonly transform: XRRigidTransform;
|
|
2309
|
-
readonly recommendedViewportScale?: number | undefined;
|
|
2310
|
-
requestViewportScale(scale: number): void;
|
|
2277
|
+
interface GPUPipelineBase {
|
|
2278
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2311
2279
|
}
|
|
2312
2280
|
|
|
2313
|
-
|
|
2281
|
+
interface GPUProgrammableStage {
|
|
2282
|
+
module: GPUShaderModule;
|
|
2283
|
+
entryPoint: string | Uint32Array;
|
|
2284
|
+
constants?: { [name: string]: GPUPipelineConstantValue };
|
|
2285
|
+
}
|
|
2314
2286
|
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
readonly removed: ReadonlyArray<XRInputSource>;
|
|
2322
|
-
readonly added: ReadonlyArray<XRInputSource>;
|
|
2287
|
+
type GPUPipelineConstantValue = number; // May represent WGSL’s bool, f32, i32, u32, and f16 if enabled.
|
|
2288
|
+
|
|
2289
|
+
class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
|
|
2290
|
+
label: string | undefined;
|
|
2291
|
+
|
|
2292
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2323
2293
|
}
|
|
2324
2294
|
|
|
2325
|
-
interface
|
|
2326
|
-
|
|
2295
|
+
interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
2296
|
+
compute: GPUProgrammableStage;
|
|
2327
2297
|
}
|
|
2328
2298
|
|
|
2329
|
-
|
|
2299
|
+
class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase {
|
|
2300
|
+
label: string | undefined;
|
|
2330
2301
|
|
|
2331
|
-
|
|
2332
|
-
|
|
2302
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2303
|
+
}
|
|
2333
2304
|
|
|
2334
|
-
interface
|
|
2335
|
-
|
|
2336
|
-
|
|
2305
|
+
interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
2306
|
+
vertex: GPUVertexState;
|
|
2307
|
+
primitive?: GPUPrimitiveState /* default={} */;
|
|
2308
|
+
depthStencil?: GPUDepthStencilState;
|
|
2309
|
+
multisample?: GPUMultisampleState /* default={} */;
|
|
2310
|
+
fragment?: GPUFragmentState;
|
|
2337
2311
|
}
|
|
2338
2312
|
|
|
2339
|
-
|
|
2313
|
+
interface GPUPrimitiveState {
|
|
2314
|
+
topology?: GPUPrimitiveTopology /* default="triangle-list" */;
|
|
2315
|
+
stripIndexFormat?: GPUIndexFormat;
|
|
2316
|
+
frontFace?: GPUFrontFace /* default="ccw" */;
|
|
2317
|
+
cullMode?: GPUCullMode /* default="none" */;
|
|
2340
2318
|
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
createAnchor?: (pose: XRRigidTransform, space: XRSpace) => Promise<XRAnchor>;
|
|
2319
|
+
// Requires "depth-clip-control" feature.
|
|
2320
|
+
unclippedDepth?: boolean /* default=false */;
|
|
2344
2321
|
}
|
|
2345
2322
|
|
|
2346
|
-
|
|
2347
|
-
class XRRay {
|
|
2348
|
-
readonly origin: DOMPointReadOnly;
|
|
2349
|
-
readonly direction: DOMPointReadOnly;
|
|
2350
|
-
readonly matrix: Float32Array;
|
|
2323
|
+
type GPUPrimitiveTopology = "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip";
|
|
2351
2324
|
|
|
2352
|
-
|
|
2353
|
-
}
|
|
2325
|
+
type GPUFrontFace = "ccw" | "cw";
|
|
2354
2326
|
|
|
2355
|
-
type
|
|
2327
|
+
type GPUCullMode = "none" | "front" | "back";
|
|
2356
2328
|
|
|
2357
|
-
interface
|
|
2358
|
-
|
|
2359
|
-
|
|
2329
|
+
interface GPUMultisampleState {
|
|
2330
|
+
count?: GPUSize32 /* default=1 */;
|
|
2331
|
+
mask?: GPUSampleMask /* default=0xFFFFFFFF */;
|
|
2332
|
+
alphaToCoverageEnabled?: boolean /* default=false */;
|
|
2360
2333
|
}
|
|
2361
2334
|
|
|
2362
|
-
|
|
2363
|
-
|
|
2335
|
+
interface GPUFragmentState extends GPUProgrammableStage {
|
|
2336
|
+
targets: (GPUColorTargetState | null)[];
|
|
2364
2337
|
}
|
|
2365
2338
|
|
|
2366
|
-
interface
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2339
|
+
interface GPUColorTargetState {
|
|
2340
|
+
format: GPUTextureFormat;
|
|
2341
|
+
|
|
2342
|
+
blend?: GPUBlendState;
|
|
2343
|
+
writeMask?: GPUColorWriteFlags /* default=0xF - GPUColorWrite.ALL */;
|
|
2370
2344
|
}
|
|
2371
2345
|
|
|
2372
|
-
|
|
2346
|
+
interface GPUBlendState {
|
|
2347
|
+
color: GPUBlendComponent;
|
|
2348
|
+
alpha: GPUBlendComponent;
|
|
2349
|
+
}
|
|
2373
2350
|
|
|
2374
|
-
|
|
2375
|
-
|
|
2351
|
+
type GPUColorWriteFlags = number;
|
|
2352
|
+
|
|
2353
|
+
interface GPUBlendComponent {
|
|
2354
|
+
operation?: GPUBlendOperation /* default="add" */;
|
|
2355
|
+
srcFactor?: GPUBlendFactor /* default="one" */;
|
|
2356
|
+
dstFactor?: GPUBlendFactor /* default="zero" */;
|
|
2376
2357
|
}
|
|
2377
2358
|
|
|
2378
|
-
|
|
2359
|
+
type GPUBlendFactor =
|
|
2360
|
+
| "zero"
|
|
2361
|
+
| "one"
|
|
2362
|
+
| "src"
|
|
2363
|
+
| "one-minus-src"
|
|
2364
|
+
| "src-alpha"
|
|
2365
|
+
| "one-minus-src-alpha"
|
|
2366
|
+
| "dst"
|
|
2367
|
+
| "one-minus-dst"
|
|
2368
|
+
| "dst-alpha"
|
|
2369
|
+
| "one-minus-dst-alpha"
|
|
2370
|
+
| "src-alpha-saturated"
|
|
2371
|
+
| "constant"
|
|
2372
|
+
| "one-minus-constant";
|
|
2379
2373
|
|
|
2380
|
-
|
|
2381
|
-
|
|
2374
|
+
type GPUBlendOperation = "add" | "subtract" | "reverse-subtract" | "min" | "max";
|
|
2375
|
+
|
|
2376
|
+
interface GPUDepthStencilState {
|
|
2377
|
+
format: GPUTextureFormat;
|
|
2378
|
+
|
|
2379
|
+
depthWriteEnabled?: boolean /* default=false */;
|
|
2380
|
+
depthCompare?: GPUCompareFunction /* default="always" */;
|
|
2381
|
+
|
|
2382
|
+
stencilFront?: GPUStencilFaceState /* default={} */;
|
|
2383
|
+
stencilBack?: GPUStencilFaceState /* default={} */;
|
|
2384
|
+
|
|
2385
|
+
stencilReadMask?: GPUStencilValue /* default=0xFFFFFFFF */;
|
|
2386
|
+
stencilWriteMask?: GPUStencilValue /* default=0xFFFFFFFF */;
|
|
2387
|
+
|
|
2388
|
+
depthBias?: GPUDepthBias /* default=0 */;
|
|
2389
|
+
depthBiasSlopeScale?: number /* default= 0 */;
|
|
2390
|
+
depthBiasClamp?: number /* default=0 */;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
interface GPUStencilFaceState {
|
|
2394
|
+
compare?: GPUCompareFunction /* default="always" */;
|
|
2395
|
+
failOp?: GPUStencilOperation /* default="keep" */;
|
|
2396
|
+
depthFailOp?: GPUStencilOperation /* default="keep" */;
|
|
2397
|
+
passOp?: GPUStencilOperation /* default="keep" */;
|
|
2382
2398
|
}
|
|
2383
2399
|
|
|
2384
|
-
|
|
2400
|
+
type GPUStencilOperation = "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap";
|
|
2401
|
+
|
|
2402
|
+
type GPUIndexFormat = "uint16" | "uint32";
|
|
2403
|
+
|
|
2404
|
+
type GPUVertexFormat =
|
|
2405
|
+
| "uint8x2"
|
|
2406
|
+
| "uint8x4"
|
|
2407
|
+
| "sint8x2"
|
|
2408
|
+
| "sint8x4"
|
|
2409
|
+
| "unorm8x2"
|
|
2410
|
+
| "unorm8x4"
|
|
2411
|
+
| "snorm8x2"
|
|
2412
|
+
| "snorm8x4"
|
|
2413
|
+
| "uint16x2"
|
|
2414
|
+
| "uint16x4"
|
|
2415
|
+
| "sint16x2"
|
|
2416
|
+
| "sint16x4"
|
|
2417
|
+
| "unorm16x2"
|
|
2418
|
+
| "unorm16x4"
|
|
2419
|
+
| "snorm16x2"
|
|
2420
|
+
| "snorm16x4"
|
|
2421
|
+
| "float16x2"
|
|
2422
|
+
| "float16x4"
|
|
2423
|
+
| "float32"
|
|
2424
|
+
| "float32x2"
|
|
2425
|
+
| "float32x3"
|
|
2426
|
+
| "float32x4"
|
|
2427
|
+
| "uint32"
|
|
2428
|
+
| "uint32x2"
|
|
2429
|
+
| "uint32x3"
|
|
2430
|
+
| "uint32x4"
|
|
2431
|
+
| "sint32"
|
|
2432
|
+
| "sint32x2"
|
|
2433
|
+
| "sint32x3"
|
|
2434
|
+
| "sint32x4"
|
|
2435
|
+
| "unorm10-10-10-2";
|
|
2436
|
+
|
|
2437
|
+
type GPUVertexStepMode = "vertex" | "instance";
|
|
2385
2438
|
|
|
2386
|
-
interface
|
|
2387
|
-
|
|
2388
|
-
entityTypes?: XRHitTestTrackableType[] | undefined;
|
|
2389
|
-
offsetRay?: XRRay | undefined;
|
|
2439
|
+
interface GPUVertexState extends GPUProgrammableStage {
|
|
2440
|
+
buffers?: GPUVertexBufferLayout[] /* default=[] */;
|
|
2390
2441
|
}
|
|
2391
2442
|
|
|
2392
|
-
interface
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2443
|
+
interface GPUVertexBufferLayout {
|
|
2444
|
+
arrayStride: GPUSize64;
|
|
2445
|
+
stepMode?: GPUVertexStepMode /* default="vertex" */;
|
|
2446
|
+
attributes: GPUVertexAttribute[];
|
|
2396
2447
|
}
|
|
2397
2448
|
|
|
2398
|
-
interface
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
// Legacy
|
|
2403
|
-
requestHitTest?: (ray: XRRay, referenceSpace: XRReferenceSpace) => Promise<XRHitResult[]>;
|
|
2449
|
+
interface GPUVertexAttribute {
|
|
2450
|
+
format: GPUVertexFormat;
|
|
2451
|
+
offset: GPUSize64;
|
|
2452
|
+
shaderLocation: GPUIndex32;
|
|
2404
2453
|
}
|
|
2405
2454
|
|
|
2406
|
-
interface
|
|
2407
|
-
|
|
2408
|
-
|
|
2455
|
+
interface GPUImageDataLayout {
|
|
2456
|
+
offset?: GPUSize64 /* default=0 */;
|
|
2457
|
+
bytesPerRow: GPUSize32;
|
|
2458
|
+
rowsPerImage?: GPUSize32;
|
|
2409
2459
|
}
|
|
2410
2460
|
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
hitMatrix: Float32Array;
|
|
2461
|
+
interface GPUImageCopyBuffer extends GPUImageDataLayout {
|
|
2462
|
+
buffer: GPUBuffer;
|
|
2414
2463
|
}
|
|
2415
2464
|
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
interface XRPlane {
|
|
2422
|
-
orientation: XRPlaneOrientation;
|
|
2423
|
-
planeSpace: XRSpace;
|
|
2424
|
-
polygon: DOMPointReadOnly[];
|
|
2425
|
-
lastChangedTime: number;
|
|
2465
|
+
interface GPUImageCopyTexture {
|
|
2466
|
+
texture: GPUTexture;
|
|
2467
|
+
mipLevel?: GPUIntegerCoordinate /* default=0 */;
|
|
2468
|
+
origin?: GPUOrigin3D /* default={} */;
|
|
2469
|
+
aspect?: GPUTextureAspect /* default="all" */;
|
|
2426
2470
|
}
|
|
2427
2471
|
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
// Legacy
|
|
2432
|
-
updateWorldTrackingState?: (options: { planeDetectionState?: { enabled: boolean } | undefined }) => void | undefined;
|
|
2472
|
+
interface GPUImageCopyTextureTagged extends GPUImageCopyTexture {
|
|
2473
|
+
colorSpace?: PredefinedColorSpace /* default="srgb" */;
|
|
2474
|
+
premultipliedAlpha?: boolean /* default=false */;
|
|
2433
2475
|
}
|
|
2434
2476
|
|
|
2435
|
-
|
|
2436
|
-
// worldInformation?:
|
|
2437
|
-
// | {
|
|
2438
|
-
// detectedPlanes?: XRPlaneSet | undefined;
|
|
2439
|
-
// }
|
|
2440
|
-
// | undefined;
|
|
2441
|
-
// }
|
|
2442
|
-
|
|
2443
|
-
// Hand Tracking
|
|
2444
|
-
type XRHandJoint =
|
|
2445
|
-
| "wrist"
|
|
2446
|
-
| "thumb-metacarpal"
|
|
2447
|
-
| "thumb-phalanx-proximal"
|
|
2448
|
-
| "thumb-phalanx-distal"
|
|
2449
|
-
| "thumb-tip"
|
|
2450
|
-
| "index-finger-metacarpal"
|
|
2451
|
-
| "index-finger-phalanx-proximal"
|
|
2452
|
-
| "index-finger-phalanx-intermediate"
|
|
2453
|
-
| "index-finger-phalanx-distal"
|
|
2454
|
-
| "index-finger-tip"
|
|
2455
|
-
| "middle-finger-metacarpal"
|
|
2456
|
-
| "middle-finger-phalanx-proximal"
|
|
2457
|
-
| "middle-finger-phalanx-intermediate"
|
|
2458
|
-
| "middle-finger-phalanx-distal"
|
|
2459
|
-
| "middle-finger-tip"
|
|
2460
|
-
| "ring-finger-metacarpal"
|
|
2461
|
-
| "ring-finger-phalanx-proximal"
|
|
2462
|
-
| "ring-finger-phalanx-intermediate"
|
|
2463
|
-
| "ring-finger-phalanx-distal"
|
|
2464
|
-
| "ring-finger-tip"
|
|
2465
|
-
| "pinky-finger-metacarpal"
|
|
2466
|
-
| "pinky-finger-phalanx-proximal"
|
|
2467
|
-
| "pinky-finger-phalanx-intermediate"
|
|
2468
|
-
| "pinky-finger-phalanx-distal"
|
|
2469
|
-
| "pinky-finger-tip";
|
|
2477
|
+
type GPUImageCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
|
|
2470
2478
|
|
|
2471
|
-
interface
|
|
2472
|
-
|
|
2479
|
+
interface GPUImageCopyExternalImage {
|
|
2480
|
+
source: GPUImageCopyExternalImageSource;
|
|
2481
|
+
origin?: GPUOrigin2D /* default={} */;
|
|
2482
|
+
flipY?: boolean /* default=false */;
|
|
2473
2483
|
}
|
|
2474
2484
|
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
interface XRJointPose extends XRPose {
|
|
2478
|
-
readonly radius: number | undefined;
|
|
2485
|
+
class GPUCommandBuffer implements GPUObjectBase {
|
|
2486
|
+
label: string | undefined;
|
|
2479
2487
|
}
|
|
2480
2488
|
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
interface XRHand extends Map<XRHandJoint, XRJointSpace> {
|
|
2484
|
-
readonly WRIST: number;
|
|
2489
|
+
interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {}
|
|
2485
2490
|
|
|
2486
|
-
|
|
2487
|
-
readonly THUMB_PHALANX_PROXIMAL: number;
|
|
2488
|
-
readonly THUMB_PHALANX_DISTAL: number;
|
|
2489
|
-
readonly THUMB_PHALANX_TIP: number;
|
|
2491
|
+
interface GPUCommandsMixin {}
|
|
2490
2492
|
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
readonly INDEX_PHALANX_INTERMEDIATE: number;
|
|
2494
|
-
readonly INDEX_PHALANX_DISTAL: number;
|
|
2495
|
-
readonly INDEX_PHALANX_TIP: number;
|
|
2493
|
+
class GPUCommandEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin {
|
|
2494
|
+
label: string | undefined;
|
|
2496
2495
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
readonly MIDDLE_PHALANX_INTERMEDIATE: number;
|
|
2500
|
-
readonly MIDDLE_PHALANX_DISTAL: number;
|
|
2501
|
-
readonly MIDDLE_PHALANX_TIP: number;
|
|
2496
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2497
|
+
beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
|
|
2502
2498
|
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2499
|
+
copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64): void;
|
|
2500
|
+
copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
2501
|
+
copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3D): void;
|
|
2502
|
+
copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3D): void;
|
|
2503
|
+
clearBuffer(buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
|
|
2508
2504
|
|
|
2509
|
-
|
|
2510
|
-
readonly LITTLE_PHALANX_PROXIMAL: number;
|
|
2511
|
-
readonly LITTLE_PHALANX_INTERMEDIATE: number;
|
|
2512
|
-
readonly LITTLE_PHALANX_DISTAL: number;
|
|
2513
|
-
readonly LITTLE_PHALANX_TIP: number;
|
|
2514
|
-
}
|
|
2505
|
+
writeTimestamp?(querySet: GPUQuerySet, queryIndex: GPUSize32): void; // not in the spec anymore, but may come back later, so keep it here for now
|
|
2515
2506
|
|
|
2516
|
-
|
|
2507
|
+
resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void;
|
|
2517
2508
|
|
|
2518
|
-
|
|
2509
|
+
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2519
2510
|
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
// tslint:disable-next-line no-empty-interface
|
|
2525
|
-
interface XRLayer extends EventTarget {}
|
|
2511
|
+
pushDebugGroup(groupLabel: string): void;
|
|
2512
|
+
popDebugGroup(): void;
|
|
2513
|
+
insertDebugMarker(markerLabel: string): void;
|
|
2514
|
+
}
|
|
2526
2515
|
|
|
2527
|
-
|
|
2516
|
+
interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {}
|
|
2528
2517
|
|
|
2529
|
-
interface
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
stencil?: boolean | undefined;
|
|
2533
|
-
alpha?: boolean | undefined;
|
|
2534
|
-
ignoreDepthValues?: boolean | undefined;
|
|
2535
|
-
framebufferScaleFactor?: number | undefined;
|
|
2518
|
+
interface GPUBindingCommandsMixin {
|
|
2519
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
|
|
2520
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
2536
2521
|
}
|
|
2537
2522
|
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
class XRWebGLLayer extends XRLayer {
|
|
2544
|
-
static getNativeFramebufferScaleFactor(session: XRSession): number;
|
|
2545
|
-
|
|
2546
|
-
constructor(session: XRSession, context: WebGLRenderingContext | WebGL2RenderingContext, layerInit?: XRWebGLLayerInit);
|
|
2523
|
+
interface GPUDebugCommandsMixin {
|
|
2524
|
+
pushDebugGroup(groupLabel: string): void;
|
|
2525
|
+
popDebugGroup(): void;
|
|
2526
|
+
insertDebugMarker(markerLabel: string): void;
|
|
2527
|
+
}
|
|
2547
2528
|
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
fixedFoveation?: number | undefined;
|
|
2529
|
+
class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin {
|
|
2530
|
+
label: string | undefined;
|
|
2551
2531
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
readonly framebufferHeight: number;
|
|
2532
|
+
setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
|
|
2533
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
2555
2534
|
|
|
2556
|
-
|
|
2557
|
-
|
|
2535
|
+
pushDebugGroup(groupLabel: string): void;
|
|
2536
|
+
popDebugGroup(): void;
|
|
2537
|
+
insertDebugMarker(markerLabel: string): void;
|
|
2558
2538
|
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2539
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2540
|
+
dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY?: GPUSize32 /* default=1 */, workgroupCountZ?: GPUSize32 /* default=1 */): void;
|
|
2541
|
+
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2562
2542
|
|
|
2563
|
-
|
|
2564
|
-
readonly layers?: XRLayer[] | undefined;
|
|
2543
|
+
end(): void;
|
|
2565
2544
|
}
|
|
2566
2545
|
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
readonly layer: XRLayer;
|
|
2546
|
+
interface GPUComputePassTimestampWrites {
|
|
2547
|
+
querySet: GPUQuerySet;
|
|
2548
|
+
beginningOfPassWriteIndex: GPUSize32;
|
|
2549
|
+
endOfPassWriteIndex: GPUSize32;
|
|
2572
2550
|
}
|
|
2573
2551
|
|
|
2574
|
-
interface
|
|
2575
|
-
|
|
2552
|
+
interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
|
|
2553
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2576
2554
|
}
|
|
2577
2555
|
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
blendTextureSourceAlpha: boolean;
|
|
2581
|
-
chromaticAberrationCorrection?: boolean | undefined;
|
|
2582
|
-
readonly mipLevels: number;
|
|
2583
|
-
readonly needsRedraw: boolean;
|
|
2584
|
-
destroy(): void;
|
|
2556
|
+
class GPURenderPassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
|
|
2557
|
+
label: string | undefined;
|
|
2585
2558
|
|
|
2586
|
-
|
|
2559
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
|
|
2560
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
2587
2561
|
|
|
2588
|
-
|
|
2589
|
-
|
|
2562
|
+
pushDebugGroup(groupLabel: string): void;
|
|
2563
|
+
popDebugGroup(): void;
|
|
2564
|
+
insertDebugMarker(markerLabel: string): void;
|
|
2590
2565
|
|
|
2591
|
-
|
|
2592
|
-
this: XRCompositionLayer,
|
|
2593
|
-
type: K,
|
|
2594
|
-
callback: (evt: XRCompositionLayerEventMap[K]) => any,
|
|
2595
|
-
options?: boolean | AddEventListenerOptions
|
|
2596
|
-
): void;
|
|
2597
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2566
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2598
2567
|
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
}
|
|
2568
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2569
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2602
2570
|
|
|
2603
|
-
|
|
2571
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
|
|
2572
|
+
drawIndexed(
|
|
2573
|
+
indexCount: GPUSize32,
|
|
2574
|
+
instanceCount?: GPUSize32 /* default=1 */,
|
|
2575
|
+
firstIndex?: GPUSize32 /* default=0 */,
|
|
2576
|
+
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
2577
|
+
firstInstance?: GPUSize32 /* default=0 */
|
|
2578
|
+
): void;
|
|
2604
2579
|
|
|
2605
|
-
|
|
2580
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2581
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2606
2582
|
|
|
2607
|
-
|
|
2583
|
+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
|
|
2608
2584
|
|
|
2609
|
-
|
|
2610
|
-
scaleFactor?: number | undefined;
|
|
2611
|
-
textureType?: XRTextureType | undefined;
|
|
2612
|
-
colorFormat?: GLenum | undefined;
|
|
2613
|
-
depthFormat?: GLenum | undefined;
|
|
2614
|
-
clearOnAccess?: boolean | undefined;
|
|
2615
|
-
}
|
|
2585
|
+
setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): void;
|
|
2616
2586
|
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
readonly textureHeight: number;
|
|
2620
|
-
readonly textureArrayLength: number;
|
|
2621
|
-
readonly ignoreDepthValues: number;
|
|
2622
|
-
fixedFoveation: number;
|
|
2623
|
-
}
|
|
2587
|
+
setBlendConstant(color: GPUColor): void;
|
|
2588
|
+
setStencilReference(reference: GPUStencilValue): void;
|
|
2624
2589
|
|
|
2625
|
-
|
|
2590
|
+
beginOcclusionQuery(queryIndex: GPUSize32): void;
|
|
2591
|
+
endOcclusionQuery(): void;
|
|
2626
2592
|
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
viewPixelWidth: number;
|
|
2630
|
-
viewPixelHeight: number;
|
|
2631
|
-
isStatic?: boolean | undefined;
|
|
2632
|
-
colorFormat?: GLenum | undefined;
|
|
2633
|
-
depthFormat?: GLenum | undefined;
|
|
2634
|
-
space: XRSpace;
|
|
2635
|
-
layout?: XRLayerLayout | undefined;
|
|
2636
|
-
clearOnAccess?: boolean | undefined;
|
|
2593
|
+
executeBundles(bundles: GPURenderBundle[]): void;
|
|
2594
|
+
end(): void;
|
|
2637
2595
|
}
|
|
2638
2596
|
|
|
2639
|
-
interface
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2597
|
+
interface GPURenderPassTimestampWrites {
|
|
2598
|
+
querySet: GPUQuerySet;
|
|
2599
|
+
beginningOfPassWriteIndex: GPUSize32;
|
|
2600
|
+
endOfPassWriteIndex: GPUSize32;
|
|
2643
2601
|
}
|
|
2644
2602
|
|
|
2645
|
-
interface
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2603
|
+
interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
|
|
2604
|
+
colorAttachments: (GPURenderPassColorAttachment | null)[];
|
|
2605
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
2606
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
2607
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2608
|
+
maxDrawCount?: GPUSize64 /* default=50000000 */;
|
|
2651
2609
|
}
|
|
2652
2610
|
|
|
2653
|
-
interface
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
aspectRatio?: number | undefined;
|
|
2658
|
-
}
|
|
2611
|
+
interface GPURenderPassColorAttachment {
|
|
2612
|
+
view: GPUTextureView;
|
|
2613
|
+
depthSlice?: GPUIntegerCoordinate;
|
|
2614
|
+
resolveTarget?: GPUTextureView;
|
|
2659
2615
|
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
centralAngle: number;
|
|
2664
|
-
aspectRatio: number;
|
|
2616
|
+
clearValue?: GPUColor;
|
|
2617
|
+
loadOp: GPULoadOp;
|
|
2618
|
+
storeOp: GPUStoreOp;
|
|
2665
2619
|
}
|
|
2666
2620
|
|
|
2667
|
-
|
|
2621
|
+
interface GPURenderPassDepthStencilAttachment {
|
|
2622
|
+
view: GPUTextureView;
|
|
2668
2623
|
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
height?: number | undefined;
|
|
2674
|
-
}
|
|
2624
|
+
depthClearValue?: number /* default=0 */;
|
|
2625
|
+
depthLoadOp: GPULoadOp;
|
|
2626
|
+
depthStoreOp: GPUStoreOp;
|
|
2627
|
+
depthReadOnly?: boolean /* default=false */;
|
|
2675
2628
|
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2629
|
+
stencilClearValue?: GPUStencilValue /* default=0 */;
|
|
2630
|
+
stencilLoadOp?: GPULoadOp;
|
|
2631
|
+
stencilStoreOp?: GPUStoreOp;
|
|
2632
|
+
stencilReadOnly?: boolean /* default=false */;
|
|
2680
2633
|
}
|
|
2681
2634
|
|
|
2682
|
-
|
|
2683
|
-
transform: XRRigidTransform;
|
|
2684
|
-
width: number;
|
|
2685
|
-
height: number;
|
|
2686
|
-
}
|
|
2635
|
+
type GPULoadOp = "load" | "clear";
|
|
2687
2636
|
|
|
2688
|
-
|
|
2637
|
+
type GPUStoreOp = "store" | "discard";
|
|
2689
2638
|
|
|
2690
|
-
interface
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
centralHorizontalAngle?: number | undefined;
|
|
2695
|
-
upperVerticalAngle?: number | undefined;
|
|
2696
|
-
lowerVerticalAngle?: number | undefined;
|
|
2639
|
+
interface GPURenderPassLayout extends GPUObjectDescriptorBase {
|
|
2640
|
+
colorFormats: (GPUTextureFormat | null)[];
|
|
2641
|
+
depthStencilFormat?: GPUTextureFormat;
|
|
2642
|
+
sampleCount?: GPUSize32 /* default=1 */;
|
|
2697
2643
|
}
|
|
2698
2644
|
|
|
2699
|
-
interface
|
|
2700
|
-
|
|
2701
|
-
radius?: number | undefined;
|
|
2702
|
-
centralHorizontalAngle?: number | undefined;
|
|
2703
|
-
upperVerticalAngle?: number | undefined;
|
|
2704
|
-
lowerVerticalAngle?: number | undefined;
|
|
2705
|
-
}
|
|
2645
|
+
interface GPURenderCommandsMixin {
|
|
2646
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2706
2647
|
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
radius: number;
|
|
2710
|
-
centralHorizontalAngle: number;
|
|
2711
|
-
upperVerticalAngle: number;
|
|
2712
|
-
lowerVerticalAngle: number;
|
|
2713
|
-
}
|
|
2648
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2649
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
|
|
2714
2650
|
|
|
2715
|
-
|
|
2651
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
|
|
2652
|
+
drawIndexed(
|
|
2653
|
+
indexCount: GPUSize32,
|
|
2654
|
+
instanceCount?: GPUSize32 /* default=1 */,
|
|
2655
|
+
firstIndex?: GPUSize32 /* default=0 */,
|
|
2656
|
+
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
2657
|
+
firstInstance?: GPUSize32 /* default=0 */
|
|
2658
|
+
): void;
|
|
2716
2659
|
|
|
2717
|
-
|
|
2718
|
-
|
|
2660
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2661
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2719
2662
|
}
|
|
2720
2663
|
|
|
2721
|
-
|
|
2722
|
-
|
|
2664
|
+
class GPURenderBundle implements GPUObjectBase {
|
|
2665
|
+
label: string | undefined;
|
|
2723
2666
|
}
|
|
2724
2667
|
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
interface XRSubImage {
|
|
2728
|
-
readonly viewport: XRViewport;
|
|
2729
|
-
}
|
|
2668
|
+
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
|
|
2730
2669
|
|
|
2731
|
-
|
|
2670
|
+
class GPURenderBundleEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
|
|
2671
|
+
label: string | undefined;
|
|
2732
2672
|
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
readonly depthStencilTexture?: WebGLTexture;
|
|
2736
|
-
readonly motionVectorTexture?: WebGLTexture;
|
|
2737
|
-
readonly imageIndex: number;
|
|
2738
|
-
readonly textureWidth: number;
|
|
2739
|
-
readonly textureHeight: number;
|
|
2740
|
-
readonly colorTextureWidth?: number;
|
|
2741
|
-
readonly colorTextureHeight?: number;
|
|
2742
|
-
readonly depthStencilTextureWidth?: number;
|
|
2743
|
-
readonly depthStencilTextureHeight?: number;
|
|
2744
|
-
readonly motionVectorTextureWidth?: number;
|
|
2745
|
-
readonly motionVectorTextureHeight?: number;
|
|
2746
|
-
}
|
|
2673
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
|
|
2674
|
+
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
2747
2675
|
|
|
2748
|
-
|
|
2676
|
+
pushDebugGroup(groupLabel: string): void;
|
|
2677
|
+
popDebugGroup(): void;
|
|
2678
|
+
insertDebugMarker(markerLabel: string): void;
|
|
2749
2679
|
|
|
2750
|
-
|
|
2751
|
-
readonly nativeProjectionScaleFactor: number;
|
|
2680
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2752
2681
|
|
|
2753
|
-
|
|
2682
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2683
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2754
2684
|
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2685
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
|
|
2686
|
+
drawIndexed(
|
|
2687
|
+
indexCount: GPUSize32,
|
|
2688
|
+
instanceCount?: GPUSize32 /* default=1 */,
|
|
2689
|
+
firstIndex?: GPUSize32 /* default=0 */,
|
|
2690
|
+
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
2691
|
+
firstInstance?: GPUSize32 /* default=0 */
|
|
2692
|
+
): void;
|
|
2760
2693
|
|
|
2761
|
-
|
|
2762
|
-
|
|
2694
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2695
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2763
2696
|
|
|
2764
|
-
|
|
2765
|
-
getReflectionCubeMap: (lightProbe: XRLightProbe) => WebGLTexture;
|
|
2697
|
+
finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle;
|
|
2766
2698
|
}
|
|
2767
2699
|
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
createQuadLayer(video: HTMLVideoElement, init?: XRMediaQuadLayerInit): XRQuadLayer;
|
|
2772
|
-
createCylinderLayer(video: HTMLVideoElement, init?: XRMediaCylinderLayerInit): XRCylinderLayer;
|
|
2773
|
-
createEquirectLayer(video: HTMLVideoElement, init?: XRMediaEquirectLayerInit): XREquirectLayer;
|
|
2700
|
+
interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
|
|
2701
|
+
depthReadOnly?: boolean /* default=false */;
|
|
2702
|
+
stencilReadOnly?: boolean /* default=false */;
|
|
2774
2703
|
}
|
|
2775
2704
|
|
|
2776
|
-
|
|
2777
|
-
interface WebGLRenderingContextBase {
|
|
2778
|
-
getExtension(extensionName: "OCULUS_multiview"): OCULUS_multiview | null;
|
|
2779
|
-
}
|
|
2705
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {}
|
|
2780
2706
|
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632,
|
|
2784
|
-
MAX_VIEWS_OVR = 0x9631,
|
|
2785
|
-
FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633,
|
|
2786
|
-
}
|
|
2707
|
+
class GPUQueue implements GPUObjectBase {
|
|
2708
|
+
label: string | undefined;
|
|
2787
2709
|
|
|
2788
|
-
|
|
2789
|
-
interface XRSessionGrant {
|
|
2790
|
-
mode: XRSessionMode;
|
|
2791
|
-
}
|
|
2710
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2792
2711
|
|
|
2793
|
-
|
|
2794
|
-
type: "sessiongranted";
|
|
2795
|
-
session: XRSessionGrant;
|
|
2796
|
-
}
|
|
2712
|
+
onSubmittedWorkDone(): Promise<void>;
|
|
2797
2713
|
|
|
2798
|
-
|
|
2799
|
-
(event: XRSystemSessionGrantedEvent): any;
|
|
2800
|
-
}
|
|
2714
|
+
writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
|
|
2801
2715
|
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2716
|
+
writeTexture(destination: GPUImageCopyTexture, data: BufferSource, dataLayout: GPUImageDataLayout, size: GPUExtent3D): void;
|
|
2717
|
+
|
|
2718
|
+
copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3D): void;
|
|
2805
2719
|
}
|
|
2806
2720
|
|
|
2807
|
-
|
|
2808
|
-
|
|
2721
|
+
class GPUQuerySet implements GPUObjectBase {
|
|
2722
|
+
label: string | undefined;
|
|
2723
|
+
|
|
2724
|
+
destroy(): void;
|
|
2725
|
+
|
|
2726
|
+
readonly type: GPUQueryType;
|
|
2727
|
+
readonly count: GPUSize32Out;
|
|
2809
2728
|
}
|
|
2810
2729
|
|
|
2811
|
-
interface
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
attachment: GLenum,
|
|
2815
|
-
texture: WebGLTexture | null,
|
|
2816
|
-
level: GLint,
|
|
2817
|
-
samples: GLsizei,
|
|
2818
|
-
baseViewIndex: GLint,
|
|
2819
|
-
numViews: GLsizei
|
|
2820
|
-
): void;
|
|
2730
|
+
interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
2731
|
+
type: GPUQueryType;
|
|
2732
|
+
count: GPUSize32;
|
|
2821
2733
|
}
|
|
2822
2734
|
|
|
2823
|
-
|
|
2735
|
+
type GPUQueryType = "occlusion" | "timestamp";
|
|
2824
2736
|
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
* https://immersive-web.github.io/dom-overlays/
|
|
2828
|
-
*/
|
|
2737
|
+
class GPUCanvasContext {
|
|
2738
|
+
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
2829
2739
|
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
}
|
|
2740
|
+
configure(configuration?: GPUCanvasConfiguration): void;
|
|
2741
|
+
unconfigure(): void;
|
|
2833
2742
|
|
|
2834
|
-
|
|
2835
|
-
/**
|
|
2836
|
-
* An XRSessionEvent of type beforexrselect is dispatched on the DOM overlay
|
|
2837
|
-
* element before generating a WebXR selectstart input event if the -Z axis
|
|
2838
|
-
* of the input source's targetRaySpace intersects the DOM overlay element
|
|
2839
|
-
* at the time the input device's primary action is triggered.
|
|
2840
|
-
*/
|
|
2841
|
-
onbeforexrselect: ((this: GlobalEventHandlers, ev: XRSessionEvent) => any) | null;
|
|
2743
|
+
getCurrentTexture(): GPUTexture;
|
|
2842
2744
|
}
|
|
2843
2745
|
|
|
2844
|
-
|
|
2845
|
-
root: Element;
|
|
2846
|
-
}
|
|
2746
|
+
type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
2847
2747
|
|
|
2848
|
-
interface
|
|
2849
|
-
|
|
2748
|
+
interface GPUCanvasConfiguration extends GPUObjectDescriptorBase {
|
|
2749
|
+
device: GPUDevice;
|
|
2750
|
+
format: GPUTextureFormat;
|
|
2751
|
+
usage?: GPUTextureUsageFlags /* default=0x10 - GPUTextureUsage.RENDER_ATTACHMENT */;
|
|
2752
|
+
viewFormats?: GPUTextureFormat[] /* default=[] */;
|
|
2753
|
+
colorSpace?: PredefinedColorSpace /* default="srgb" */;
|
|
2754
|
+
alphaMode?: GPUCanvasAlphaMode /* default="opaque" */;
|
|
2850
2755
|
}
|
|
2851
2756
|
|
|
2852
|
-
type
|
|
2757
|
+
type GPUDeviceLostReason = "unknown" | "destroyed";
|
|
2853
2758
|
|
|
2854
|
-
|
|
2855
|
-
|
|
2759
|
+
class GPUDeviceLostInfo {
|
|
2760
|
+
readonly reason?: GPUDeviceLostReason;
|
|
2761
|
+
readonly message: string;
|
|
2856
2762
|
}
|
|
2857
2763
|
|
|
2858
|
-
|
|
2859
|
-
readonly
|
|
2764
|
+
class GPUError {
|
|
2765
|
+
readonly message: string;
|
|
2860
2766
|
}
|
|
2861
2767
|
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
readonly
|
|
2768
|
+
class GPUValidationError extends GPUError {
|
|
2769
|
+
constructor(message: string);
|
|
2770
|
+
readonly message: string;
|
|
2865
2771
|
}
|
|
2866
2772
|
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
trackedAnchors?: XRAnchorSet;
|
|
2871
|
-
// World geometries. DEPRECATED
|
|
2872
|
-
worldInformation?: XRWorldInformation | undefined;
|
|
2873
|
-
detectedPlanes?: XRPlaneSet | undefined;
|
|
2874
|
-
// Hand tracking
|
|
2875
|
-
getJointPose?(joint: XRJointSpace, baseSpace: XRSpace): XRJointPose;
|
|
2876
|
-
fillJointRadii?(jointSpaces: XRJointSpace[], radii: Float32Array): boolean;
|
|
2877
|
-
// Image tracking
|
|
2878
|
-
getImageTrackingResults?(): Array<XRImageTrackingResult>;
|
|
2879
|
-
getLightEstimate(xrLightProbe: XRLightProbe): XRLightEstimate;
|
|
2773
|
+
class GPUOutOfMemoryError extends GPUError {
|
|
2774
|
+
constructor(message: string);
|
|
2775
|
+
readonly message: string;
|
|
2880
2776
|
}
|
|
2881
2777
|
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2778
|
+
class GPUInternalError extends GPUError {
|
|
2779
|
+
constructor(message: string);
|
|
2780
|
+
readonly message: string;
|
|
2885
2781
|
}
|
|
2886
2782
|
|
|
2887
|
-
type
|
|
2888
|
-
|
|
2889
|
-
type XRImageTrackingState = "tracked" | "emulated";
|
|
2890
|
-
type XRImageTrackingScore = "untrackable" | "trackable";
|
|
2783
|
+
type GPUErrorFilter = "validation" | "out-of-memory" | "internal";
|
|
2891
2784
|
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2785
|
+
class GPUUncapturedErrorEvent extends Event {
|
|
2786
|
+
constructor(type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit);
|
|
2787
|
+
readonly error: GPUError;
|
|
2895
2788
|
}
|
|
2896
2789
|
|
|
2897
|
-
interface
|
|
2898
|
-
|
|
2899
|
-
readonly index: number;
|
|
2900
|
-
readonly trackingState: XRImageTrackingState;
|
|
2901
|
-
readonly measuredWidthInMeters: number;
|
|
2790
|
+
interface GPUUncapturedErrorEventInit extends EventInit {
|
|
2791
|
+
error: GPUError;
|
|
2902
2792
|
}
|
|
2903
2793
|
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2794
|
+
type GPUBufferDynamicOffset = number; /* unsigned long */
|
|
2795
|
+
type GPUStencilValue = number; /* unsigned long */
|
|
2796
|
+
type GPUSampleMask = number; /* unsigned long */
|
|
2797
|
+
type GPUDepthBias = number; /* long */
|
|
2908
2798
|
|
|
2909
|
-
type
|
|
2910
|
-
|
|
2911
|
-
|
|
2799
|
+
type GPUSize64 = number; /* unsigned long long */
|
|
2800
|
+
type GPUIntegerCoordinate = number; /* unsigned long */
|
|
2801
|
+
type GPUIndex32 = number; /* unsigned long */
|
|
2802
|
+
type GPUSize32 = number; /* unsigned long */
|
|
2803
|
+
type GPUSignedOffset32 = number; /* long */
|
|
2912
2804
|
|
|
2913
|
-
type
|
|
2805
|
+
type GPUSize64Out = number; /* unsigned long long */
|
|
2806
|
+
type GPUIntegerCoordinateOut = number; /* unsigned long */
|
|
2807
|
+
type GPUSize32Out = number; /* unsigned long */
|
|
2914
2808
|
|
|
2915
|
-
|
|
2916
|
-
readonly preferredReflectionFormat?: XRReflectionFormat;
|
|
2917
|
-
/**
|
|
2918
|
-
* The XRSession interface is extended with the ability to create new XRLightProbe instances.
|
|
2919
|
-
* XRLightProbe instances have a session object, which is the XRSession that created this XRLightProbe.
|
|
2920
|
-
*
|
|
2921
|
-
* Can reject with with a "NotSupportedError" DOMException
|
|
2922
|
-
*/
|
|
2923
|
-
requestLightProbe(options?: XRLightProbeInit): Promise<XRLightProbe>;
|
|
2809
|
+
type GPUFlagsConstant = number; /* unsigned long */
|
|
2924
2810
|
|
|
2925
|
-
|
|
2811
|
+
interface GPUColorDict {
|
|
2812
|
+
r: number;
|
|
2813
|
+
g: number;
|
|
2814
|
+
b: number;
|
|
2815
|
+
a: number;
|
|
2926
2816
|
}
|
|
2817
|
+
type GPUColor = [number, number, number, number] | GPUColorDict;
|
|
2927
2818
|
|
|
2928
|
-
interface
|
|
2929
|
-
|
|
2819
|
+
interface GPUOrigin2DDict {
|
|
2820
|
+
x?: GPUIntegerCoordinate /* default=0 */;
|
|
2821
|
+
y?: GPUIntegerCoordinate /* default=0 */;
|
|
2930
2822
|
}
|
|
2823
|
+
type GPUOrigin2D = [GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUOrigin2DDict;
|
|
2931
2824
|
|
|
2932
|
-
interface
|
|
2933
|
-
|
|
2825
|
+
interface GPUOrigin3DDict {
|
|
2826
|
+
x?: GPUIntegerCoordinate /* default=0 */;
|
|
2827
|
+
y?: GPUIntegerCoordinate /* default=0 */;
|
|
2828
|
+
z?: GPUIntegerCoordinate /* default=0 */;
|
|
2934
2829
|
}
|
|
2830
|
+
type GPUOrigin3D = [GPUIntegerCoordinate, GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUOrigin3DDict;
|
|
2935
2831
|
|
|
2936
|
-
interface
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2832
|
+
interface GPUExtent3DDict {
|
|
2833
|
+
width: GPUIntegerCoordinate;
|
|
2834
|
+
height?: GPUIntegerCoordinate /* default=1 */;
|
|
2835
|
+
depthOrArrayLayers?: GPUIntegerCoordinate /* default=1 */;
|
|
2940
2836
|
}
|
|
2837
|
+
type GPUExtent3D = [GPUIntegerCoordinate, GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUExtent3DDict;
|
|
2838
|
+
|
|
2839
|
+
/* eslint-disable no-var */
|
|
2840
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2841
|
+
// Type definitions for WebGL 2 extended with Babylon specific types
|
|
2941
2842
|
|
|
2942
|
-
interface
|
|
2943
|
-
|
|
2843
|
+
interface WebGL2RenderingContext extends WebGL2RenderingContextBase {
|
|
2844
|
+
HALF_FLOAT_OES: number;
|
|
2845
|
+
RGBA16F: typeof WebGL2RenderingContext.RGBA16F;
|
|
2846
|
+
RGBA32F: typeof WebGL2RenderingContext.RGBA32F;
|
|
2847
|
+
DEPTH24_STENCIL8: typeof WebGL2RenderingContext.DEPTH24_STENCIL8;
|
|
2848
|
+
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;
|
|
2849
|
+
COMPRESSED_SRGB_S3TC_DXT1_EXT: number;
|
|
2850
|
+
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;
|
|
2851
|
+
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;
|
|
2852
|
+
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: number;
|
|
2853
|
+
COMPRESSED_SRGB8_ETC2: number;
|
|
2854
|
+
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: number;
|
|
2855
|
+
DRAW_FRAMEBUFFER: typeof WebGL2RenderingContext.DRAW_FRAMEBUFFER;
|
|
2856
|
+
UNSIGNED_INT_24_8: typeof WebGL2RenderingContext.UNSIGNED_INT_24_8;
|
|
2857
|
+
MIN: typeof WebGL2RenderingContext.MIN;
|
|
2858
|
+
MAX: typeof WebGL2RenderingContext.MAX;
|
|
2944
2859
|
}
|
|
2945
2860
|
|
|
2946
|
-
interface
|
|
2947
|
-
|
|
2948
|
-
|
|
2861
|
+
interface EXT_disjoint_timer_query {
|
|
2862
|
+
QUERY_COUNTER_BITS_EXT: number;
|
|
2863
|
+
TIME_ELAPSED_EXT: number;
|
|
2864
|
+
TIMESTAMP_EXT: number;
|
|
2865
|
+
GPU_DISJOINT_EXT: number;
|
|
2866
|
+
QUERY_RESULT_EXT: number;
|
|
2867
|
+
QUERY_RESULT_AVAILABLE_EXT: number;
|
|
2868
|
+
queryCounterEXT(query: WebGLQuery, target: number): void;
|
|
2869
|
+
createQueryEXT(): WebGLQuery;
|
|
2870
|
+
beginQueryEXT(target: number, query: WebGLQuery): void;
|
|
2871
|
+
endQueryEXT(target: number): void;
|
|
2872
|
+
getQueryObjectEXT(query: WebGLQuery, target: number): any;
|
|
2873
|
+
deleteQueryEXT(query: WebGLQuery): void;
|
|
2949
2874
|
}
|
|
2950
2875
|
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2876
|
+
interface WebGLProgram {
|
|
2877
|
+
__SPECTOR_rebuildProgram?:
|
|
2878
|
+
| ((vertexSourceCode: string, fragmentSourceCode: string, onCompiled: (program: WebGLProgram) => void, onError: (message: string) => void) => void)
|
|
2879
|
+
| null;
|
|
2880
|
+
}
|
|
2955
2881
|
|
|
2882
|
+
interface WebGLUniformLocation {
|
|
2883
|
+
_currentState: any;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2956
2886
|
/**
|
|
2957
|
-
*
|
|
2958
|
-
* https://www.w3.org/TR/webxr-depth-sensing-1/
|
|
2887
|
+
* TODO: remove this file when we upgrade to TypeScript 5.0
|
|
2959
2888
|
*/
|
|
2960
2889
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
readonly dataFormatPreference: XRDepthDataFormat[];
|
|
2967
|
-
};
|
|
2968
|
-
|
|
2969
|
-
interface XRSessionInit {
|
|
2970
|
-
depthSensing?: XRDepthStateInit;
|
|
2971
|
-
}
|
|
2972
|
-
|
|
2973
|
-
interface XRSession {
|
|
2974
|
-
readonly depthUsage: XRDepthUsage;
|
|
2975
|
-
readonly depthDataFormat: XRDepthDataFormat;
|
|
2890
|
+
/* eslint-disable no-var */
|
|
2891
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2892
|
+
interface OffscreenCanvasEventMap {
|
|
2893
|
+
contextlost: Event;
|
|
2894
|
+
contextrestored: Event;
|
|
2976
2895
|
}
|
|
2977
2896
|
|
|
2978
|
-
interface
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
readonly normDepthBufferFromNormView: XRRigidTransform;
|
|
2983
|
-
readonly rawValueToMeters: number;
|
|
2897
|
+
interface ImageEncodeOptions {
|
|
2898
|
+
quality?: number;
|
|
2899
|
+
type?: string;
|
|
2984
2900
|
}
|
|
2985
2901
|
|
|
2986
|
-
|
|
2987
|
-
|
|
2902
|
+
// These types are only needed for older versions of typescript.
|
|
2903
|
+
// The BJS addition is only needed because otherwise it is a type duplicate definition
|
|
2904
|
+
type OffscreenRenderingContextIdBJS = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
|
|
2905
|
+
type OffscreenRenderingContextBJS = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
|
|
2988
2906
|
|
|
2989
|
-
|
|
2907
|
+
interface OffscreenCanvas extends EventTarget {
|
|
2908
|
+
/**
|
|
2909
|
+
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
|
|
2910
|
+
*
|
|
2911
|
+
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
|
|
2912
|
+
*/
|
|
2913
|
+
height: number;
|
|
2914
|
+
oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
|
|
2915
|
+
oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
|
|
2916
|
+
/**
|
|
2917
|
+
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
|
|
2918
|
+
*
|
|
2919
|
+
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
|
|
2920
|
+
*/
|
|
2921
|
+
width: number;
|
|
2922
|
+
/**
|
|
2923
|
+
* Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.
|
|
2924
|
+
*
|
|
2925
|
+
* The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.
|
|
2926
|
+
*/
|
|
2927
|
+
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
|
|
2928
|
+
/**
|
|
2929
|
+
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
|
|
2930
|
+
*
|
|
2931
|
+
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
|
|
2932
|
+
*
|
|
2933
|
+
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
|
|
2934
|
+
*/
|
|
2935
|
+
getContext(contextId: "2d", options?: any): OffscreenCanvasRenderingContext2D | null;
|
|
2936
|
+
getContext(contextId: "bitmaprenderer", options?: any): ImageBitmapRenderingContext | null;
|
|
2937
|
+
getContext(contextId: "webgl", options?: any): WebGLRenderingContext | null;
|
|
2938
|
+
getContext(contextId: "webgl2", options?: any): WebGL2RenderingContext | null;
|
|
2939
|
+
getContext(contextId: OffscreenRenderingContextIdBJS, options?: any): OffscreenRenderingContextBJS | null;
|
|
2940
|
+
/** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. */
|
|
2941
|
+
transferToImageBitmap(): ImageBitmap;
|
|
2942
|
+
addEventListener<K extends keyof OffscreenCanvasEventMap>(
|
|
2943
|
+
type: K,
|
|
2944
|
+
listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any,
|
|
2945
|
+
options?: boolean | AddEventListenerOptions
|
|
2946
|
+
): void;
|
|
2947
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
2948
|
+
removeEventListener<K extends keyof OffscreenCanvasEventMap>(
|
|
2949
|
+
type: K,
|
|
2950
|
+
listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any,
|
|
2951
|
+
options?: boolean | EventListenerOptions
|
|
2952
|
+
): void;
|
|
2953
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2990
2954
|
}
|
|
2991
2955
|
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2956
|
+
var OffscreenCanvas: {
|
|
2957
|
+
prototype: OffscreenCanvas;
|
|
2958
|
+
new (width: number, height: number): OffscreenCanvas;
|
|
2959
|
+
};
|
|
2995
2960
|
|
|
2996
|
-
interface
|
|
2997
|
-
|
|
2961
|
+
interface OffscreenCanvasRenderingContext2D
|
|
2962
|
+
extends CanvasCompositing,
|
|
2963
|
+
CanvasDrawImage,
|
|
2964
|
+
CanvasDrawPath,
|
|
2965
|
+
CanvasFillStrokeStyles,
|
|
2966
|
+
CanvasFilters,
|
|
2967
|
+
CanvasImageData,
|
|
2968
|
+
CanvasImageSmoothing,
|
|
2969
|
+
CanvasPath,
|
|
2970
|
+
CanvasPathDrawingStyles,
|
|
2971
|
+
CanvasRect,
|
|
2972
|
+
CanvasShadowStyles,
|
|
2973
|
+
CanvasState,
|
|
2974
|
+
CanvasText,
|
|
2975
|
+
CanvasTextDrawingStyles,
|
|
2976
|
+
CanvasTransform {
|
|
2977
|
+
readonly canvas: OffscreenCanvas;
|
|
2978
|
+
commit(): void;
|
|
2998
2979
|
}
|
|
2999
2980
|
|
|
3000
|
-
|
|
3001
|
-
|
|
2981
|
+
var OffscreenCanvasRenderingContext2D: {
|
|
2982
|
+
prototype: OffscreenCanvasRenderingContext2D;
|
|
2983
|
+
new (): OffscreenCanvasRenderingContext2D;
|
|
2984
|
+
};
|
|
2985
|
+
|
|
2986
|
+
/* eslint-disable no-var */
|
|
2987
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2988
|
+
// Mixins
|
|
2989
|
+
interface Window {
|
|
2990
|
+
mozIndexedDB: IDBFactory;
|
|
2991
|
+
webkitIndexedDB: IDBFactory;
|
|
2992
|
+
msIndexedDB: IDBFactory;
|
|
2993
|
+
webkitURL: typeof URL;
|
|
2994
|
+
mozRequestAnimationFrame(callback: FrameRequestCallback): number;
|
|
2995
|
+
oRequestAnimationFrame(callback: FrameRequestCallback): number;
|
|
2996
|
+
WebGLRenderingContext: WebGLRenderingContext;
|
|
2997
|
+
CANNON: any;
|
|
2998
|
+
AudioContext: AudioContext;
|
|
2999
|
+
webkitAudioContext: AudioContext;
|
|
3000
|
+
PointerEvent: any;
|
|
3001
|
+
Math: Math;
|
|
3002
|
+
Uint8Array: Uint8ArrayConstructor;
|
|
3003
|
+
Float32Array: Float32ArrayConstructor;
|
|
3004
|
+
mozURL: typeof URL;
|
|
3005
|
+
msURL: typeof URL;
|
|
3006
|
+
DracoDecoderModule: any;
|
|
3007
|
+
setImmediate(handler: (...args: any[]) => void): number;
|
|
3002
3008
|
}
|
|
3003
3009
|
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
enabledFeatures: string[];
|
|
3010
|
+
interface WorkerGlobalScope {
|
|
3011
|
+
importScripts: (...args: string[]) => void;
|
|
3007
3012
|
}
|
|
3008
3013
|
|
|
3009
|
-
|
|
3014
|
+
type WorkerSelf = WindowOrWorkerGlobalScope & WorkerGlobalScope;
|
|
3010
3015
|
|
|
3011
|
-
interface
|
|
3012
|
-
|
|
3013
|
-
|
|
3016
|
+
interface HTMLCanvasElement {
|
|
3017
|
+
requestPointerLock(): void;
|
|
3018
|
+
msRequestPointerLock?(): void;
|
|
3019
|
+
mozRequestPointerLock?(): void;
|
|
3020
|
+
webkitRequestPointerLock?(): void;
|
|
3014
3021
|
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3022
|
+
/** Track whether a record is in progress */
|
|
3023
|
+
isRecording: boolean;
|
|
3024
|
+
/** Capture Stream method defined by some browsers */
|
|
3025
|
+
captureStream(fps?: number): MediaStream;
|
|
3018
3026
|
}
|
|
3019
3027
|
|
|
3020
|
-
interface
|
|
3021
|
-
|
|
3028
|
+
interface CanvasRenderingContext2D {
|
|
3029
|
+
msImageSmoothingEnabled: boolean;
|
|
3022
3030
|
}
|
|
3023
3031
|
|
|
3024
|
-
//
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
meshSpace: XRSpace;
|
|
3028
|
-
vertices: Float32Array;
|
|
3029
|
-
indices: Uint32Array;
|
|
3030
|
-
lastChangedTime: DOMHighResTimeStamp;
|
|
3032
|
+
// Babylon Extension to enable UIEvents to work with our IUIEvents
|
|
3033
|
+
interface UIEvent {
|
|
3034
|
+
inputIndex: number;
|
|
3031
3035
|
}
|
|
3032
3036
|
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
+
interface MouseEvent {
|
|
3038
|
+
mozMovementX: number;
|
|
3039
|
+
mozMovementY: number;
|
|
3040
|
+
webkitMovementX: number;
|
|
3041
|
+
webkitMovementY: number;
|
|
3042
|
+
msMovementX: number;
|
|
3043
|
+
msMovementY: number;
|
|
3037
3044
|
}
|
|
3038
|
-
|
|
3039
|
-
// This file contains native only extensions for WebXR. These APIs are not supported in the browser yet.
|
|
3040
|
-
// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
|
|
3041
|
-
// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
|
|
3042
|
-
|
|
3043
|
-
type XRSceneObjectType = "unknown" | "background" | "wall" | "floor" | "ceiling" | "platform" | "inferred" | "world";
|
|
3044
3045
|
|
|
3045
|
-
interface
|
|
3046
|
-
|
|
3047
|
-
|
|
3046
|
+
interface Navigator {
|
|
3047
|
+
mozGetVRDevices: (any: any) => any;
|
|
3048
|
+
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
3049
|
+
mozGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
3050
|
+
msGetUserMedia(constraints: MediaStreamConstraints, successCallback: any, errorCallback: any): void;
|
|
3048
3051
|
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
angleUp: number;
|
|
3053
|
-
angleDown: number;
|
|
3052
|
+
webkitGetGamepads(): Gamepad[];
|
|
3053
|
+
msGetGamepads(): Gamepad[];
|
|
3054
|
+
webkitGamepads(): Gamepad[];
|
|
3054
3055
|
}
|
|
3055
3056
|
|
|
3056
|
-
interface
|
|
3057
|
-
|
|
3058
|
-
orientation: DOMPointReadOnly;
|
|
3059
|
-
fieldOfView: XRFieldOfView;
|
|
3060
|
-
farDistance: number;
|
|
3057
|
+
interface HTMLVideoElement {
|
|
3058
|
+
mozSrcObject: any;
|
|
3061
3059
|
}
|
|
3062
3060
|
|
|
3063
|
-
interface
|
|
3064
|
-
|
|
3061
|
+
interface Math {
|
|
3062
|
+
fround(x: number): number;
|
|
3063
|
+
imul(a: number, b: number): number;
|
|
3064
|
+
log2(x: number): number;
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
parentSceneObject?: XRSceneObject;
|
|
3071
|
-
positions: Float32Array; // Babylon native!
|
|
3067
|
+
interface OffscreenCanvas extends EventTarget {
|
|
3068
|
+
width: number;
|
|
3069
|
+
height: number;
|
|
3072
3070
|
}
|
|
3073
3071
|
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
}
|
|
3072
|
+
var OffscreenCanvas: {
|
|
3073
|
+
prototype: OffscreenCanvas;
|
|
3074
|
+
new (width: number, height: number): OffscreenCanvas;
|
|
3075
|
+
};
|
|
3078
3076
|
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
radius: number;
|
|
3082
|
-
}
|
|
3077
|
+
// Experimental Pressure API https://wicg.github.io/compute-pressure/
|
|
3078
|
+
type PressureSource = "cpu";
|
|
3083
3079
|
|
|
3084
|
-
|
|
3085
|
-
type: "box";
|
|
3086
|
-
extent: DOMPointReadOnly;
|
|
3087
|
-
}
|
|
3080
|
+
type PressureState = "nominal" | "fair" | "serious" | "critical";
|
|
3088
3081
|
|
|
3089
|
-
type
|
|
3082
|
+
type PressureFactor = "thermal" | "power-supply";
|
|
3090
3083
|
|
|
3091
|
-
interface
|
|
3092
|
-
|
|
3093
|
-
|
|
3084
|
+
interface PressureRecord {
|
|
3085
|
+
source: PressureSource;
|
|
3086
|
+
state: PressureState;
|
|
3087
|
+
factors: ReadonlyArray<PressureFactor>;
|
|
3088
|
+
time: number;
|
|
3094
3089
|
}
|
|
3095
3090
|
|
|
3096
|
-
interface
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3091
|
+
interface PressureObserver {
|
|
3092
|
+
observe(source: PressureSource): void;
|
|
3093
|
+
unobserve(source: PressureSource): void;
|
|
3094
|
+
disconnect(): void;
|
|
3095
|
+
takeRecords(): Array<PressureRecord>;
|
|
3101
3096
|
}
|
|
3102
3097
|
|
|
3103
|
-
interface
|
|
3104
|
-
|
|
3098
|
+
interface PressureObserverOptions {
|
|
3099
|
+
sampleRate?: number;
|
|
3105
3100
|
}
|
|
3106
3101
|
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3102
|
+
type PressureUpdateCallback = (changes: Array<PressureRecord>, observer: PressureObserver) => void;
|
|
3103
|
+
|
|
3104
|
+
const PressureObserver: {
|
|
3105
|
+
prototype: PressureObserver;
|
|
3106
|
+
new (callback: PressureUpdateCallback, options?: PressureObserverOptions): PressureObserver;
|
|
3107
|
+
|
|
3108
|
+
knownSources: ReadonlyArray<PressureSource>;
|
|
3109
|
+
};
|
|
3110
3110
|
|
|
3111
3111
|
}
|