@babylonjs/core 9.2.2 → 9.3.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.
Files changed (76) hide show
  1. package/Engines/abstractEngine.js +2 -2
  2. package/Engines/abstractEngine.js.map +1 -1
  3. package/Engines/engine.d.ts +49 -1118
  4. package/FlowGraph/flowGraph.d.ts +11 -0
  5. package/FlowGraph/flowGraph.js +20 -0
  6. package/FlowGraph/flowGraph.js.map +1 -1
  7. package/FlowGraph/flowGraphContext.d.ts +30 -0
  8. package/FlowGraph/flowGraphContext.js +42 -0
  9. package/FlowGraph/flowGraphContext.js.map +1 -1
  10. package/FlowGraph/flowGraphParser.js +13 -0
  11. package/FlowGraph/flowGraphParser.js.map +1 -1
  12. package/FlowGraph/typeDefinitions.d.ts +16 -0
  13. package/FlowGraph/typeDefinitions.js.map +1 -1
  14. package/Layers/thinSelectionOutlineLayer.js +25 -1
  15. package/Layers/thinSelectionOutlineLayer.js.map +1 -1
  16. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +18 -0
  17. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +110 -1
  18. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  19. package/Materials/Textures/baseTexture.d.ts +1 -0
  20. package/Materials/Textures/baseTexture.js +1 -0
  21. package/Materials/Textures/baseTexture.js.map +1 -1
  22. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -1
  23. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +14 -4
  24. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  25. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.d.ts +24 -0
  26. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +128 -0
  27. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
  28. package/Misc/tools.js +1 -1
  29. package/Misc/tools.js.map +1 -1
  30. package/Particles/IParticleSystem.d.ts +7 -1
  31. package/Particles/IParticleSystem.js.map +1 -1
  32. package/Particles/baseParticleSystem.d.ts +18 -2
  33. package/Particles/baseParticleSystem.js +53 -11
  34. package/Particles/baseParticleSystem.js.map +1 -1
  35. package/Particles/computeShaderParticleSystem.js +16 -0
  36. package/Particles/computeShaderParticleSystem.js.map +1 -1
  37. package/Particles/gpuParticleSystem.d.ts +14 -72
  38. package/Particles/gpuParticleSystem.js +130 -106
  39. package/Particles/gpuParticleSystem.js.map +1 -1
  40. package/Particles/particleSystem.d.ts +0 -80
  41. package/Particles/particleSystem.functions.d.ts +16 -0
  42. package/Particles/particleSystem.functions.js +18 -0
  43. package/Particles/particleSystem.functions.js.map +1 -1
  44. package/Particles/particleSystem.js +0 -114
  45. package/Particles/particleSystem.js.map +1 -1
  46. package/Particles/webgl2ParticleSystem.js +12 -0
  47. package/Particles/webgl2ParticleSystem.js.map +1 -1
  48. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +17 -0
  49. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  50. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +10 -0
  51. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +146 -24
  52. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  53. package/Rendering/objectRenderer.d.ts +2 -0
  54. package/Rendering/objectRenderer.js +10 -0
  55. package/Rendering/objectRenderer.js.map +1 -1
  56. package/Shaders/ShadersInclude/gaussianSplatting.js +21 -1
  57. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  58. package/Shaders/gaussianSplattingVoxel.fragment.d.ts +5 -0
  59. package/Shaders/gaussianSplattingVoxel.fragment.js +27 -0
  60. package/Shaders/gaussianSplattingVoxel.fragment.js.map +1 -0
  61. package/Shaders/gaussianSplattingVoxel.vertex.d.ts +8 -0
  62. package/Shaders/gaussianSplattingVoxel.vertex.js +31 -0
  63. package/Shaders/gaussianSplattingVoxel.vertex.js.map +1 -0
  64. package/Shaders/gpuUpdateParticles.vertex.js +13 -0
  65. package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
  66. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +21 -1
  67. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  68. package/ShadersWGSL/gaussianSplattingVoxel.fragment.d.ts +5 -0
  69. package/ShadersWGSL/gaussianSplattingVoxel.fragment.js +22 -0
  70. package/ShadersWGSL/gaussianSplattingVoxel.fragment.js.map +1 -0
  71. package/ShadersWGSL/gaussianSplattingVoxel.vertex.d.ts +8 -0
  72. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +42 -0
  73. package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -0
  74. package/ShadersWGSL/gpuUpdateParticles.compute.js +19 -0
  75. package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
  76. package/package.json +1 -1
@@ -1783,1124 +1783,55 @@ interface XRFrame {
1783
1783
  detectedMeshes?: XRMeshSet;
1784
1784
  }
1785
1785
 
1786
- /* eslint-disable babylonjs/available */
1787
- /* eslint-disable @typescript-eslint/naming-convention */
1788
- interface GPUObjectBase {
1789
- label: string | undefined;
1790
- }
1791
-
1792
- interface GPUObjectDescriptorBase {
1793
- label?: string;
1794
- }
1795
-
1796
- interface GPUSupportedLimits {
1797
- [name: string]: number;
1798
-
1799
- readonly maxTextureDimension1D: number;
1800
- readonly maxTextureDimension2D: number;
1801
- readonly maxTextureDimension3D: number;
1802
- readonly maxTextureArrayLayers: number;
1803
- readonly maxBindGroups: number;
1804
- readonly maxBindGroupsPlusVertexBuffers: number;
1805
- readonly maxBindingsPerBindGroup: number;
1806
- readonly maxDynamicUniformBuffersPerPipelineLayout: number;
1807
- readonly maxDynamicStorageBuffersPerPipelineLayout: number;
1808
- readonly maxSampledTexturesPerShaderStage: number;
1809
- readonly maxSamplersPerShaderStage: number;
1810
- readonly maxStorageBuffersPerShaderStage: number;
1811
- readonly maxStorageBuffersInVertexStage: number;
1812
- readonly maxStorageBuffersInFragmentStage: number;
1813
- readonly maxStorageTexturesPerShaderStage: number;
1814
- readonly maxStorageTexturesInVertexStage: number;
1815
- readonly maxStorageTexturesInFragmentStage: number;
1816
- readonly maxUniformBuffersPerShaderStage: number;
1817
- readonly maxUniformBufferBindingSize: number;
1818
- readonly maxStorageBufferBindingSize: number;
1819
- readonly minUniformBufferOffsetAlignment: number;
1820
- readonly minStorageBufferOffsetAlignment: number;
1821
- readonly maxVertexBuffers: number;
1822
- readonly maxBufferSize: number;
1823
- readonly maxVertexAttributes: number;
1824
- readonly maxVertexBufferArrayStride: number;
1825
- readonly maxInterStageShaderVariables: number;
1826
- readonly maxColorAttachments: number;
1827
- readonly maxColorAttachmentBytesPerSample: number;
1828
- readonly maxComputeWorkgroupStorageSize: number;
1829
- readonly maxComputeInvocationsPerWorkgroup: number;
1830
- readonly maxComputeWorkgroupSizeX: number;
1831
- readonly maxComputeWorkgroupSizeY: number;
1832
- readonly maxComputeWorkgroupSizeZ: number;
1833
- readonly maxComputeWorkgroupsPerDimension: number;
1834
- }
1835
-
1836
- type GPUSupportedFeatures = ReadonlySet<string>;
1837
-
1838
- type WGSLLanguageFeatures = ReadonlySet<string>;
1839
-
1840
- interface GPUAdapterInfo {
1841
- readonly vendor: string;
1842
- readonly architecture: string;
1843
- readonly device: string;
1844
- readonly description: string;
1845
- readonly subgroupMinSize: number;
1846
- readonly subgroupMaxSize: number;
1847
- readonly isFallbackAdapter: boolean;
1848
- }
1849
-
1850
- interface Navigator {
1851
- readonly gpu: GPU | undefined;
1852
- }
1853
-
1854
- interface WorkerNavigator {
1855
- readonly gpu: GPU | undefined;
1856
- }
1857
-
1858
- class GPU {
1859
- requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
1860
- getPreferredCanvasFormat(): GPUTextureFormat;
1861
-
1862
- readonly wgslLanguageFeatures: WGSLLanguageFeatures;
1863
- }
1864
-
1865
- interface GPURequestAdapterOptions {
1866
- featureLevel?: string /* default="core" */;
1867
- powerPreference?: GPUPowerPreference;
1868
- forceFallbackAdapter?: boolean /* default=false */;
1869
- xrCompatible?: boolean /* default=false */;
1870
- }
1871
-
1872
- type GPUPowerPreference = "low-power" | "high-performance";
1873
-
1874
- class GPUAdapter {
1875
- readonly features: GPUSupportedFeatures;
1876
- readonly limits: GPUSupportedLimits;
1877
- readonly info: GPUAdapterInfo;
1878
-
1879
- requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
1880
- }
1881
-
1882
- interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
1883
- requiredFeatures?: GPUFeatureName[] /* default=[] */;
1884
- requiredLimits?: { [name: string]: GPUSize64 | undefined } /* default={} */;
1885
- defaultQueue?: GPUQueueDescriptor /* default={} */;
1886
- }
1887
-
1888
- type GPUFeatureName =
1889
- | "core-features-and-limits"
1890
- | "depth-clip-control"
1891
- | "depth32float-stencil8"
1892
- | "texture-compression-bc"
1893
- | "texture-compression-bc-sliced-3d"
1894
- | "texture-compression-etc2"
1895
- | "texture-compression-astc"
1896
- | "texture-compression-astc-sliced-3d"
1897
- | "timestamp-query"
1898
- | "indirect-first-instance"
1899
- | "shader-f16"
1900
- | "rg11b10ufloat-renderable"
1901
- | "bgra8unorm-storage"
1902
- | "float32-filterable"
1903
- | "float32-blendable"
1904
- | "clip-distances"
1905
- | "dual-source-blending"
1906
- | "subgroups"
1907
- | "texture-formats-tier1"
1908
- | "texture-formats-tier2"
1909
- | "primitive-index"
1910
- | "texture-component-swizzle";
1911
-
1912
- class GPUDevice extends EventTarget implements GPUObjectBase {
1913
- label: string | undefined;
1914
-
1915
- readonly features: GPUSupportedFeatures;
1916
- readonly limits: GPUSupportedLimits;
1917
- readonly adapterInfo: GPUAdapterInfo;
1918
-
1919
- readonly queue: GPUQueue;
1920
-
1921
- destroy(): void;
1922
-
1923
- createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer;
1924
- createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
1925
- createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
1926
- importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
1927
-
1928
- createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
1929
- createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout;
1930
- createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
1931
-
1932
- createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
1933
-
1934
- createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline;
1935
- createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
1936
- // eslint-disable-next-line no-restricted-syntax
1937
- createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise<GPUComputePipeline>;
1938
- // eslint-disable-next-line no-restricted-syntax
1939
- createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
1940
-
1941
- createCommandEncoder(descriptor?: GPUCommandEncoderDescriptor): GPUCommandEncoder;
1942
- createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
1943
-
1944
- createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
1945
-
1946
- readonly lost: Promise<GPUDeviceLostInfo>;
1947
- pushErrorScope(filter: GPUErrorFilter): void;
1948
- popErrorScope(): Promise<GPUError | null>;
1949
- onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
1950
- }
1951
-
1952
- class GPUBuffer implements GPUObjectBase {
1953
- label: string | undefined;
1954
-
1955
- readonly size: GPUSize64Out;
1956
- readonly usage: GPUFlagsConstant;
1957
- readonly mapState: GPUBufferMapState;
1958
-
1959
- // eslint-disable-next-line no-restricted-syntax
1960
- mapAsync(mode: GPUMapModeFlags, offset?: GPUSize64 /*default=0*/, size?: GPUSize64): Promise<void>;
1961
- getMappedRange(offset?: GPUSize64 /*default=0*/, size?: GPUSize64): ArrayBuffer;
1962
- unmap(): void;
1963
-
1964
- destroy(): void;
1965
- }
1966
-
1967
- type GPUBufferMapState = "unmapped" | "pending" | "mapped";
1968
-
1969
- interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
1970
- size: GPUSize64;
1971
- usage: GPUBufferUsageFlags;
1972
- mappedAtCreation?: boolean /* default=false */;
1973
- }
1974
-
1975
- type GPUBufferUsageFlags = number;
1976
-
1977
- type GPUMapModeFlags = number;
1978
-
1979
- class GPUTexture implements GPUObjectBase {
1980
- label: string | undefined;
1981
-
1982
- createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
1983
- destroy(): void;
1984
-
1985
- readonly width: GPUIntegerCoordinateOut;
1986
- readonly height: GPUIntegerCoordinateOut;
1987
- readonly depthOrArrayLayers: GPUIntegerCoordinateOut;
1988
- readonly mipLevelCount: GPUIntegerCoordinateOut;
1989
- readonly sampleCount: GPUSize32Out;
1990
- readonly dimension: GPUTextureDimension;
1991
- readonly format: GPUTextureFormat;
1992
- readonly usage: GPUFlagsConstant;
1993
- readonly textureBindingViewDimension: GPUTextureViewDimension | undefined;
1994
- }
1995
-
1996
- interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1997
- size: GPUExtent3D;
1998
- mipLevelCount?: GPUIntegerCoordinate /* default=1 */;
1999
- sampleCount?: GPUSize32 /* default=1 */;
2000
- dimension?: GPUTextureDimension /* default="2d" */;
2001
- format: GPUTextureFormat;
2002
- usage: GPUTextureUsageFlags;
2003
- viewFormats?: GPUTextureFormat[] /* default=[] */;
2004
- textureBindingViewDimension?: GPUTextureViewDimension;
2005
- }
2006
-
2007
- type GPUTextureDimension = "1d" | "2d" | "3d";
2008
-
2009
- type GPUTextureUsageFlags = number;
2010
-
2011
- class GPUTextureView implements GPUObjectBase {
2012
- label: string | undefined;
2013
- }
2014
-
2015
- interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
2016
- format?: GPUTextureFormat;
2017
- dimension?: GPUTextureViewDimension;
2018
- usage?: GPUTextureUsageFlags /* default=0 */;
2019
- aspect?: GPUTextureAspect /* default="all" */;
2020
- baseMipLevel?: GPUIntegerCoordinate /* default=0 */;
2021
- mipLevelCount?: GPUIntegerCoordinate;
2022
- baseArrayLayer?: GPUIntegerCoordinate /* default=0*/;
2023
- arrayLayerCount?: GPUIntegerCoordinate;
2024
- swizzle?: string /* default="rgba" */;
2025
- }
2026
-
2027
- type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d";
2028
-
2029
- type GPUTextureAspect = "all" | "stencil-only" | "depth-only";
2030
-
2031
- type GPUTextureFormat =
2032
- // 8-bit formats
2033
- | "r8unorm"
2034
- | "r8snorm"
2035
- | "r8uint"
2036
- | "r8sint"
2037
-
2038
- // 16-bit formats
2039
- | "r16unorm"
2040
- | "r16snorm"
2041
- | "r16uint"
2042
- | "r16sint"
2043
- | "r16float"
2044
- | "rg8unorm"
2045
- | "rg8snorm"
2046
- | "rg8uint"
2047
- | "rg8sint"
2048
-
2049
- // 32-bit formats
2050
- | "r32uint"
2051
- | "r32sint"
2052
- | "r32float"
2053
- | "rg16unorm"
2054
- | "rg16snorm"
2055
- | "rg16uint"
2056
- | "rg16sint"
2057
- | "rg16float"
2058
- | "rgba8unorm"
2059
- | "rgba8unorm-srgb"
2060
- | "rgba8snorm"
2061
- | "rgba8uint"
2062
- | "rgba8sint"
2063
- | "bgra8unorm"
2064
- | "bgra8unorm-srgb"
2065
- // Packed 32-bit formats
2066
- | "rgb9e5ufloat"
2067
- | "rgb10a2uint"
2068
- | "rgb10a2unorm"
2069
- | "rg11b10ufloat"
2070
-
2071
- // 64-bit formats
2072
- | "rg32uint"
2073
- | "rg32sint"
2074
- | "rg32float"
2075
- | "rgba16unorm"
2076
- | "rgba16snorm"
2077
- | "rgba16uint"
2078
- | "rgba16sint"
2079
- | "rgba16float"
2080
-
2081
- // 128-bit formats
2082
- | "rgba32uint"
2083
- | "rgba32sint"
2084
- | "rgba32float"
2085
-
2086
- // Depth and stencil formats
2087
- | "stencil8"
2088
- | "depth16unorm"
2089
- | "depth24plus"
2090
- | "depth24plus-stencil8"
2091
- | "depth32float"
2092
-
2093
- // "depth32float-stencil8" feature
2094
- | "depth32float-stencil8"
2095
-
2096
- // BC compressed formats usable if "texture-compression-bc" is both
2097
- // supported by the device/user agent and enabled in requestDevice.
2098
- | "bc1-rgba-unorm"
2099
- | "bc1-rgba-unorm-srgb"
2100
- | "bc2-rgba-unorm"
2101
- | "bc2-rgba-unorm-srgb"
2102
- | "bc3-rgba-unorm"
2103
- | "bc3-rgba-unorm-srgb"
2104
- | "bc4-r-unorm"
2105
- | "bc4-r-snorm"
2106
- | "bc5-rg-unorm"
2107
- | "bc5-rg-snorm"
2108
- | "bc6h-rgb-ufloat"
2109
- | "bc6h-rgb-float"
2110
- | "bc7-rgba-unorm"
2111
- | "bc7-rgba-unorm-srgb"
2112
-
2113
- // ETC2 compressed formats usable if "texture-compression-etc2" is both
2114
- // supported by the device/user agent and enabled in requestDevice.
2115
- | "etc2-rgb8unorm"
2116
- | "etc2-rgb8unorm-srgb"
2117
- | "etc2-rgb8a1unorm"
2118
- | "etc2-rgb8a1unorm-srgb"
2119
- | "etc2-rgba8unorm"
2120
- | "etc2-rgba8unorm-srgb"
2121
- | "eac-r11unorm"
2122
- | "eac-r11snorm"
2123
- | "eac-rg11unorm"
2124
- | "eac-rg11snorm"
2125
-
2126
- // ASTC compressed formats usable if "texture-compression-astc" is both
2127
- // supported by the device/user agent and enabled in requestDevice.
2128
- | "astc-4x4-unorm"
2129
- | "astc-4x4-unorm-srgb"
2130
- | "astc-5x4-unorm"
2131
- | "astc-5x4-unorm-srgb"
2132
- | "astc-5x5-unorm"
2133
- | "astc-5x5-unorm-srgb"
2134
- | "astc-6x5-unorm"
2135
- | "astc-6x5-unorm-srgb"
2136
- | "astc-6x6-unorm"
2137
- | "astc-6x6-unorm-srgb"
2138
- | "astc-8x5-unorm"
2139
- | "astc-8x5-unorm-srgb"
2140
- | "astc-8x6-unorm"
2141
- | "astc-8x6-unorm-srgb"
2142
- | "astc-8x8-unorm"
2143
- | "astc-8x8-unorm-srgb"
2144
- | "astc-10x5-unorm"
2145
- | "astc-10x5-unorm-srgb"
2146
- | "astc-10x6-unorm"
2147
- | "astc-10x6-unorm-srgb"
2148
- | "astc-10x8-unorm"
2149
- | "astc-10x8-unorm-srgb"
2150
- | "astc-10x10-unorm"
2151
- | "astc-10x10-unorm-srgb"
2152
- | "astc-12x10-unorm"
2153
- | "astc-12x10-unorm-srgb"
2154
- | "astc-12x12-unorm"
2155
- | "astc-12x12-unorm-srgb";
2156
-
2157
- class GPUExternalTexture implements GPUObjectBase {
2158
- label: string | undefined;
2159
- }
2160
-
2161
- interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
2162
- source: HTMLVideoElement | VideoFrame;
2163
- colorSpace?: PredefinedColorSpace /* default="srgb" */;
2164
- }
2165
-
2166
- class GPUSampler implements GPUObjectBase {
2167
- label: string | undefined;
2168
- }
2169
-
2170
- interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
2171
- addressModeU?: GPUAddressMode /* default="clamp-to-edge" */;
2172
- addressModeV?: GPUAddressMode /* default="clamp-to-edge" */;
2173
- addressModeW?: GPUAddressMode /* default="clamp-to-edge" */;
2174
- magFilter?: GPUFilterMode /* default="nearest" */;
2175
- minFilter?: GPUFilterMode /* default="nearest" */;
2176
- mipmapFilter?: GPUMipmapFilterMode /* default="nearest" */;
2177
- lodMinClamp?: number /* default=0 */;
2178
- lodMaxClamp?: number /* default=32 */;
2179
- compare?: GPUCompareFunction;
2180
- maxAnisotropy?: number /* default=1 */;
2181
- }
2182
-
2183
- type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat";
2184
-
2185
- type GPUFilterMode = "nearest" | "linear";
2186
-
2187
- type GPUMipmapFilterMode = "nearest" | "linear";
2188
-
2189
- type GPUCompareFunction = "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always";
2190
-
2191
- class GPUBindGroupLayout implements GPUObjectBase {
2192
- label: string | undefined;
2193
- }
2194
-
2195
- interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
2196
- entries: GPUBindGroupLayoutEntry[];
2197
- }
2198
-
2199
- interface GPUBindGroupLayoutEntry {
2200
- binding: GPUIndex32;
2201
- visibility: GPUShaderStageFlags;
2202
-
2203
- buffer?: GPUBufferBindingLayout;
2204
- sampler?: GPUSamplerBindingLayout;
2205
- texture?: GPUTextureBindingLayout;
2206
- storageTexture?: GPUStorageTextureBindingLayout;
2207
- externalTexture?: GPUExternalTextureBindingLayout;
2208
- }
2209
-
2210
- type GPUShaderStageFlags = number;
2211
-
2212
- type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
2213
-
2214
- interface GPUBufferBindingLayout {
2215
- type?: GPUBufferBindingType /* default="uniform" */;
2216
- hasDynamicOffset?: boolean /* default=false */;
2217
- minBindingSize?: GPUSize64 /* default=0 */;
2218
- }
2219
-
2220
- type GPUSamplerBindingType = "filtering" | "non-filtering" | "comparison";
2221
-
2222
- interface GPUSamplerBindingLayout {
2223
- type?: GPUSamplerBindingType /* default="filtering" */;
2224
- }
2225
-
2226
- type GPUTextureSampleType = "float" | "unfilterable-float" | "depth" | "sint" | "uint";
2227
-
2228
- interface GPUTextureBindingLayout {
2229
- sampleType?: GPUTextureSampleType /* default="float" */;
2230
- viewDimension?: GPUTextureViewDimension /* default="2d" */;
2231
- multisampled?: boolean /* default=false */;
2232
- }
2233
-
2234
- type GPUStorageTextureAccess = "write-only" | "read-only" | "read-write";
2235
-
2236
- interface GPUStorageTextureBindingLayout {
2237
- access?: GPUStorageTextureAccess /* default=write-only */;
2238
- format: GPUTextureFormat;
2239
- viewDimension?: GPUTextureViewDimension /* default="2d" */;
2240
- }
2241
-
2242
- interface GPUExternalTextureBindingLayout {}
2243
-
2244
- class GPUBindGroup implements GPUObjectBase {
2245
- label: string | undefined;
2246
- }
2247
-
2248
- interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase {
2249
- layout: GPUBindGroupLayout;
2250
- entries: GPUBindGroupEntry[];
2251
- }
2252
-
2253
- type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer | GPUBufferBinding | GPUExternalTexture;
2254
-
2255
- interface GPUBindGroupEntry {
2256
- binding: GPUIndex32;
2257
- resource: GPUBindingResource;
2258
- }
2259
-
2260
- interface GPUBufferBinding {
2261
- buffer: GPUBuffer;
2262
- offset?: GPUSize64 /* default=0 */;
2263
- size?: GPUSize64 /* default=size_of_buffer - offset */;
2264
- }
2265
-
2266
- class GPUPipelineLayout implements GPUObjectBase {
2267
- label: string | undefined;
2268
- }
2269
-
2270
- interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
2271
- bindGroupLayouts: GPUBindGroupLayout[];
2272
- }
2273
-
2274
- class GPUShaderModule implements GPUObjectBase {
2275
- label: string | undefined;
2276
-
2277
- getCompilationInfo(): Promise<GPUCompilationInfo>;
2278
- }
2279
-
2280
- interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
2281
- code: string;
2282
- compilationHints?: GPUShaderModuleCompilationHint[] /* default=[] */;
2283
- }
2284
-
2285
- interface GPUShaderModuleCompilationHint {
2286
- entryPoint: string;
2287
- layout?: GPUPipelineLayout | GPUAutoLayoutMode;
2288
- }
2289
-
2290
- type GPUCompilationMessageType = "error" | "warning" | "info";
2291
-
2292
- interface GPUCompilationMessage {
2293
- readonly message: string;
2294
- readonly type: GPUCompilationMessageType;
2295
- readonly lineNum: number;
2296
- readonly linePos: number;
2297
- readonly offset: number;
2298
- readonly length: number;
2299
- }
2300
-
2301
- interface GPUCompilationInfo {
2302
- readonly messages: readonly GPUCompilationMessage[];
2303
- }
2304
-
2305
- class GPUPipelineError extends DOMException {
2306
- constructor(message: string | undefined, options: GPUPipelineErrorInit);
2307
- readonly reason: GPUPipelineErrorReason;
2308
- }
2309
-
2310
- interface GPUPipelineErrorInit {
2311
- reason: GPUPipelineErrorReason;
2312
- }
2313
-
2314
- type GPUPipelineErrorReason = "validation" | "internal";
2315
-
2316
- type GPUAutoLayoutMode = "auto";
2317
-
2318
- interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
2319
- layout: GPUPipelineLayout | GPUAutoLayoutMode;
2320
- }
2321
-
2322
- interface GPUPipelineBase {
2323
- getBindGroupLayout(index: number): GPUBindGroupLayout;
2324
- }
2325
-
2326
- interface GPUProgrammableStage {
2327
- module: GPUShaderModule;
2328
- entryPoint?: string;
2329
- constants?: { [name: string]: GPUPipelineConstantValue } /* default={} */;
2330
- }
2331
-
2332
- type GPUPipelineConstantValue = number; // May represent WGSL’s bool, f32, i32, u32, and f16 if enabled.
2333
-
2334
- class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
2335
- label: string | undefined;
2336
-
2337
- getBindGroupLayout(index: number): GPUBindGroupLayout;
2338
- }
2339
-
2340
- interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase {
2341
- compute: GPUProgrammableStage;
2342
- }
2343
-
2344
- class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase {
2345
- label: string | undefined;
2346
-
2347
- getBindGroupLayout(index: number): GPUBindGroupLayout;
2348
- }
2349
-
2350
- interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
2351
- vertex: GPUVertexState;
2352
- primitive?: GPUPrimitiveState /* default={} */;
2353
- depthStencil?: GPUDepthStencilState;
2354
- multisample?: GPUMultisampleState /* default={} */;
2355
- fragment?: GPUFragmentState;
2356
- }
2357
-
2358
- interface GPUPrimitiveState {
2359
- topology?: GPUPrimitiveTopology /* default="triangle-list" */;
2360
- stripIndexFormat?: GPUIndexFormat;
2361
- frontFace?: GPUFrontFace /* default="ccw" */;
2362
- cullMode?: GPUCullMode /* default="none" */;
2363
-
2364
- // Requires "depth-clip-control" feature.
2365
- unclippedDepth?: boolean /* default=false */;
2366
- }
2367
-
2368
- type GPUPrimitiveTopology = "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip";
2369
-
2370
- type GPUFrontFace = "ccw" | "cw";
2371
-
2372
- type GPUCullMode = "none" | "front" | "back";
2373
-
2374
- interface GPUMultisampleState {
2375
- count?: GPUSize32 /* default=1 */;
2376
- mask?: GPUSampleMask /* default=0xFFFFFFFF */;
2377
- alphaToCoverageEnabled?: boolean /* default=false */;
2378
- }
2379
-
2380
- interface GPUFragmentState extends GPUProgrammableStage {
2381
- targets: (GPUColorTargetState | null)[];
2382
- }
2383
-
2384
- interface GPUColorTargetState {
2385
- format: GPUTextureFormat;
2386
-
2387
- blend?: GPUBlendState;
2388
- writeMask?: GPUColorWriteFlags /* default=0xF - GPUColorWrite.ALL */;
2389
- }
2390
-
2391
- interface GPUBlendState {
2392
- color: GPUBlendComponent;
2393
- alpha: GPUBlendComponent;
2394
- }
2395
-
2396
- type GPUColorWriteFlags = number;
2397
-
2398
- interface GPUBlendComponent {
2399
- operation?: GPUBlendOperation /* default="add" */;
2400
- srcFactor?: GPUBlendFactor /* default="one" */;
2401
- dstFactor?: GPUBlendFactor /* default="zero" */;
2402
- }
2403
-
2404
- type GPUBlendFactor =
2405
- | "zero"
2406
- | "one"
2407
- | "src"
2408
- | "one-minus-src"
2409
- | "src-alpha"
2410
- | "one-minus-src-alpha"
2411
- | "dst"
2412
- | "one-minus-dst"
2413
- | "dst-alpha"
2414
- | "one-minus-dst-alpha"
2415
- | "src-alpha-saturated"
2416
- | "constant"
2417
- | "one-minus-constant"
2418
- | "src1"
2419
- | "one-minus-src1"
2420
- | "src1-alpha"
2421
- | "one-minus-src1-alpha";
2422
-
2423
- type GPUBlendOperation = "add" | "subtract" | "reverse-subtract" | "min" | "max";
2424
-
2425
- interface GPUDepthStencilState {
2426
- format: GPUTextureFormat;
2427
-
2428
- depthWriteEnabled?: boolean /* default=false */;
2429
- depthCompare?: GPUCompareFunction /* default="always" */;
2430
-
2431
- stencilFront?: GPUStencilFaceState /* default={} */;
2432
- stencilBack?: GPUStencilFaceState /* default={} */;
2433
-
2434
- stencilReadMask?: GPUStencilValue /* default=0xFFFFFFFF */;
2435
- stencilWriteMask?: GPUStencilValue /* default=0xFFFFFFFF */;
2436
-
2437
- depthBias?: GPUDepthBias /* default=0 */;
2438
- depthBiasSlopeScale?: number /* default= 0 */;
2439
- depthBiasClamp?: number /* default=0 */;
2440
- }
2441
-
2442
- interface GPUStencilFaceState {
2443
- compare?: GPUCompareFunction /* default="always" */;
2444
- failOp?: GPUStencilOperation /* default="keep" */;
2445
- depthFailOp?: GPUStencilOperation /* default="keep" */;
2446
- passOp?: GPUStencilOperation /* default="keep" */;
2447
- }
2448
-
2449
- type GPUStencilOperation = "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap";
2450
-
2451
- type GPUIndexFormat = "uint16" | "uint32";
2452
-
2453
- type GPUVertexFormat =
2454
- | "uint8"
2455
- | "uint8x2"
2456
- | "uint8x4"
2457
- | "sint8"
2458
- | "sint8x2"
2459
- | "sint8x4"
2460
- | "unorm8"
2461
- | "unorm8x2"
2462
- | "unorm8x4"
2463
- | "snorm8"
2464
- | "snorm8x2"
2465
- | "snorm8x4"
2466
- | "uint16"
2467
- | "uint16x2"
2468
- | "uint16x4"
2469
- | "sint16"
2470
- | "sint16x2"
2471
- | "sint16x4"
2472
- | "unorm16"
2473
- | "unorm16x2"
2474
- | "unorm16x4"
2475
- | "snorm16"
2476
- | "snorm16x2"
2477
- | "snorm16x4"
2478
- | "float16"
2479
- | "float16x2"
2480
- | "float16x4"
2481
- | "float32"
2482
- | "float32x2"
2483
- | "float32x3"
2484
- | "float32x4"
2485
- | "uint32"
2486
- | "uint32x2"
2487
- | "uint32x3"
2488
- | "uint32x4"
2489
- | "sint32"
2490
- | "sint32x2"
2491
- | "sint32x3"
2492
- | "sint32x4"
2493
- | "unorm10-10-10-2"
2494
- | "unorm8x4-bgra";
2495
-
2496
- type GPUVertexStepMode = "vertex" | "instance";
2497
-
2498
- interface GPUVertexState extends GPUProgrammableStage {
2499
- buffers?: GPUVertexBufferLayout[] /* default=[] */;
2500
- }
2501
-
2502
- interface GPUVertexBufferLayout {
2503
- arrayStride: GPUSize64;
2504
- stepMode?: GPUVertexStepMode /* default="vertex" */;
2505
- attributes: GPUVertexAttribute[];
2506
- }
2507
-
2508
- interface GPUVertexAttribute {
2509
- format: GPUVertexFormat;
2510
- offset: GPUSize64;
2511
- shaderLocation: GPUIndex32;
2512
- }
2513
-
2514
- interface GPUTexelCopyBufferLayout {
2515
- offset?: GPUSize64 /* default=0 */;
2516
- bytesPerRow?: GPUSize32;
2517
- rowsPerImage?: GPUSize32;
2518
- }
2519
-
2520
- interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
2521
- buffer: GPUBuffer;
2522
- }
2523
-
2524
- interface GPUTexelCopyTextureInfo {
2525
- texture: GPUTexture;
2526
- mipLevel?: GPUIntegerCoordinate /* default=0 */;
2527
- origin?: GPUOrigin3D /* default={} */;
2528
- aspect?: GPUTextureAspect /* default="all" */;
2529
- }
2530
-
2531
- interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo {
2532
- colorSpace?: PredefinedColorSpace /* default="srgb" */;
2533
- premultipliedAlpha?: boolean /* default=false */;
2534
- }
2535
-
2536
- type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
2537
-
2538
- interface GPUCopyExternalImageSourceInfo {
2539
- source: GPUCopyExternalImageSource;
2540
- origin?: GPUOrigin2D /* default={} */;
2541
- flipY?: boolean /* default=false */;
2542
- }
2543
-
2544
- class GPUCommandBuffer implements GPUObjectBase {
2545
- label: string | undefined;
2546
- }
2547
-
2548
- interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {}
2549
-
2550
- interface GPUCommandsMixin {}
2551
-
2552
- class GPUCommandEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin {
2553
- label: string | undefined;
2554
-
2555
- beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
2556
- beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
2557
-
2558
- copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): void;
2559
- copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): void;
2560
- copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
2561
- copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): void;
2562
- copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
2563
- clearBuffer(buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
2564
-
2565
- resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void;
2566
-
2567
- finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
2568
-
2569
- pushDebugGroup(grouplabel: string | undefined): void;
2570
- popDebugGroup(): void;
2571
- insertDebugMarker(markerlabel: string | undefined): void;
2572
- }
2573
-
2574
- interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {}
2575
-
2576
- interface GPUBindingCommandsMixin {
2577
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
2578
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
2579
- }
2580
-
2581
- interface GPUDebugCommandsMixin {
2582
- pushDebugGroup(grouplabel: string | undefined): void;
2583
- popDebugGroup(): void;
2584
- insertDebugMarker(markerlabel: string | undefined): void;
2585
- }
2586
-
2587
- class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin {
2588
- label: string | undefined;
2589
-
2590
- setBindGroup(index: number, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
2591
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
2592
-
2593
- pushDebugGroup(grouplabel: string | undefined): void;
2594
- popDebugGroup(): void;
2595
- insertDebugMarker(markerlabel: string | undefined): void;
2596
-
2597
- setPipeline(pipeline: GPUComputePipeline): void;
2598
- dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY?: GPUSize32 /* default=1 */, workgroupCountZ?: GPUSize32 /* default=1 */): void;
2599
- dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2600
-
2601
- end(): void;
2602
- }
2603
-
2604
- interface GPUComputePassTimestampWrites {
2605
- querySet: GPUQuerySet;
2606
- beginningOfPassWriteIndex?: GPUSize32;
2607
- endOfPassWriteIndex?: GPUSize32;
2608
- }
2609
-
2610
- interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
2611
- timestampWrites?: GPUComputePassTimestampWrites;
2612
- }
2613
-
2614
- class GPURenderPassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
2615
- label: string | undefined;
2616
-
2617
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
2618
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
2619
-
2620
- pushDebugGroup(grouplabel: string | undefined): void;
2621
- popDebugGroup(): void;
2622
- insertDebugMarker(markerlabel: string | undefined): void;
2623
-
2624
- setPipeline(pipeline: GPURenderPipeline): void;
2625
-
2626
- setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
2627
- setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
2628
-
2629
- draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
2630
- drawIndexed(
2631
- indexCount: GPUSize32,
2632
- instanceCount?: GPUSize32 /* default=1 */,
2633
- firstIndex?: GPUSize32 /* default=0 */,
2634
- baseVertex?: GPUSignedOffset32 /* default=0 */,
2635
- firstInstance?: GPUSize32 /* default=0 */
2636
- ): void;
2637
-
2638
- drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2639
- drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2640
-
2641
- setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
2642
-
2643
- setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): void;
2644
-
2645
- setBlendConstant(color: GPUColor): void;
2646
- setStencilReference(reference: GPUStencilValue): void;
2647
-
2648
- beginOcclusionQuery(queryIndex: GPUSize32): void;
2649
- endOcclusionQuery(): void;
2650
-
2651
- executeBundles(bundles: GPURenderBundle[]): void;
2652
- end(): void;
2653
- }
2654
-
2655
- interface GPURenderPassTimestampWrites {
2656
- querySet: GPUQuerySet;
2657
- beginningOfPassWriteIndex?: GPUSize32;
2658
- endOfPassWriteIndex?: GPUSize32;
2659
- }
2660
-
2661
- interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
2662
- colorAttachments: (GPURenderPassColorAttachment | null)[];
2663
- depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
2664
- occlusionQuerySet?: GPUQuerySet;
2665
- timestampWrites?: GPURenderPassTimestampWrites;
2666
- maxDrawCount?: GPUSize64 /* default=50000000 */;
2667
- }
2668
-
2669
- interface GPURenderPassColorAttachment {
2670
- view: GPUTexture | GPUTextureView;
2671
- depthSlice?: GPUIntegerCoordinate;
2672
- resolveTarget?: GPUTexture | GPUTextureView;
2673
-
2674
- clearValue?: GPUColor;
2675
- loadOp: GPULoadOp;
2676
- storeOp: GPUStoreOp;
2677
- }
2678
-
2679
- interface GPURenderPassDepthStencilAttachment {
2680
- view: GPUTexture | GPUTextureView;
2681
-
2682
- depthClearValue?: number /* default=0 */;
2683
- depthLoadOp?: GPULoadOp;
2684
- depthStoreOp?: GPUStoreOp;
2685
- depthReadOnly?: boolean /* default=false */;
2686
-
2687
- stencilClearValue?: GPUStencilValue /* default=0 */;
2688
- stencilLoadOp?: GPULoadOp;
2689
- stencilStoreOp?: GPUStoreOp;
2690
- stencilReadOnly?: boolean /* default=false */;
2691
- }
2692
-
2693
- type GPULoadOp = "load" | "clear";
2694
-
2695
- type GPUStoreOp = "store" | "discard";
2696
-
2697
- interface GPURenderPassLayout extends GPUObjectDescriptorBase {
2698
- colorFormats: (GPUTextureFormat | null)[];
2699
- depthStencilFormat?: GPUTextureFormat;
2700
- sampleCount?: GPUSize32 /* default=1 */;
2701
- }
2702
-
2703
- interface GPURenderCommandsMixin {
2704
- setPipeline(pipeline: GPURenderPipeline): void;
2705
-
2706
- setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
2707
- setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
2708
-
2709
- draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
2710
- drawIndexed(
2711
- indexCount: GPUSize32,
2712
- instanceCount?: GPUSize32 /* default=1 */,
2713
- firstIndex?: GPUSize32 /* default=0 */,
2714
- baseVertex?: GPUSignedOffset32 /* default=0 */,
2715
- firstInstance?: GPUSize32 /* default=0 */
2716
- ): void;
2717
-
2718
- drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2719
- drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2720
- }
2721
-
2722
- class GPURenderBundle implements GPUObjectBase {
2723
- label: string | undefined;
2724
- }
2725
-
2726
- interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
2727
-
2728
- class GPURenderBundleEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
2729
- label: string | undefined;
2730
-
2731
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
2732
- setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
2733
-
2734
- pushDebugGroup(grouplabel: string | undefined): void;
2735
- popDebugGroup(): void;
2736
- insertDebugMarker(markerlabel: string | undefined): void;
2737
-
2738
- setPipeline(pipeline: GPURenderPipeline): void;
2739
-
2740
- setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
2741
- setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer | null, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
2742
-
2743
- draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
2744
- drawIndexed(
2745
- indexCount: GPUSize32,
2746
- instanceCount?: GPUSize32 /* default=1 */,
2747
- firstIndex?: GPUSize32 /* default=0 */,
2748
- baseVertex?: GPUSignedOffset32 /* default=0 */,
2749
- firstInstance?: GPUSize32 /* default=0 */
2750
- ): void;
2751
-
2752
- drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2753
- drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
2754
-
2755
- finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle;
2756
- }
2757
-
2758
- interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
2759
- depthReadOnly?: boolean /* default=false */;
2760
- stencilReadOnly?: boolean /* default=false */;
2761
- }
2762
-
2763
- interface GPUQueueDescriptor extends GPUObjectDescriptorBase {}
2764
-
2765
- class GPUQueue implements GPUObjectBase {
2766
- label: string | undefined;
2767
-
2768
- submit(commandBuffers: GPUCommandBuffer[]): void;
2769
-
2770
- onSubmittedWorkDone(): Promise<void>;
2771
-
2772
- writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: AllowSharedBufferSource, dataOffset?: GPUSize64 /* default=0 */, size?: GPUSize64): void;
2773
-
2774
- writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D): void;
2775
-
2776
- copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D): void;
2777
- }
2778
-
2779
- class GPUQuerySet implements GPUObjectBase {
2780
- label: string | undefined;
2781
-
2782
- destroy(): void;
2783
-
2784
- readonly type: GPUQueryType;
2785
- readonly count: GPUSize32Out;
2786
- }
2787
-
2788
- interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
2789
- type: GPUQueryType;
2790
- count: GPUSize32;
2791
- }
2792
-
2793
- type GPUQueryType = "occlusion" | "timestamp";
2794
-
2795
- class GPUCanvasContext {
2796
- readonly canvas: HTMLCanvasElement | OffscreenCanvas;
2797
-
2798
- configure(configuration: GPUCanvasConfiguration): void;
2799
- unconfigure(): void;
2800
-
2801
- getConfiguration(): GPUCanvasConfiguration | null;
2802
- getCurrentTexture(): GPUTexture;
2803
- }
2804
-
2805
- type GPUCanvasAlphaMode = "opaque" | "premultiplied";
2806
-
2807
- type GPUCanvasToneMappingMode = "standard" | "extended";
2808
-
2809
- interface GPUCanvasToneMapping {
2810
- mode?: GPUCanvasToneMappingMode /* default="standard" */;
2811
- }
2812
-
2813
- interface GPUCanvasConfiguration extends GPUObjectDescriptorBase {
2814
- device: GPUDevice;
2815
- format: GPUTextureFormat;
2816
- usage?: GPUTextureUsageFlags /* default=0x10 - GPUTextureUsage.RENDER_ATTACHMENT */;
2817
- viewFormats?: GPUTextureFormat[] /* default=[] */;
2818
- colorSpace?: PredefinedColorSpace /* default="srgb" */;
2819
- toneMapping?: GPUCanvasToneMapping /* default={} */;
2820
- alphaMode?: GPUCanvasAlphaMode /* default="opaque" */;
2821
- }
2822
-
2823
- type GPUDeviceLostReason = "unknown" | "destroyed";
2824
-
2825
- class GPUDeviceLostInfo {
2826
- readonly reason: GPUDeviceLostReason;
2827
- readonly message: string;
2828
- }
2829
-
2830
- class GPUError {
2831
- readonly message: string;
2832
- }
2833
-
2834
- class GPUValidationError extends GPUError {
2835
- constructor(message: string);
2836
- readonly message: string;
2837
- }
2838
-
2839
- class GPUOutOfMemoryError extends GPUError {
2840
- constructor(message: string);
2841
- readonly message: string;
2842
- }
2843
-
2844
- class GPUInternalError extends GPUError {
2845
- constructor(message: string);
2846
- readonly message: string;
2847
- }
2848
-
2849
- type GPUErrorFilter = "validation" | "out-of-memory" | "internal";
2850
-
2851
- class GPUUncapturedErrorEvent extends Event {
2852
- constructor(type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit);
2853
- readonly error: GPUError;
2854
- }
2855
-
2856
- interface GPUUncapturedErrorEventInit extends EventInit {
2857
- error: GPUError;
2858
- }
2859
-
2860
- type GPUBufferDynamicOffset = number; /* unsigned long */
2861
- type GPUStencilValue = number; /* unsigned long */
2862
- type GPUSampleMask = number; /* unsigned long */
2863
- type GPUDepthBias = number; /* long */
2864
-
2865
- type GPUSize64 = number; /* unsigned long long */
2866
- type GPUIntegerCoordinate = number; /* unsigned long */
2867
- type GPUIndex32 = number; /* unsigned long */
2868
- type GPUSize32 = number; /* unsigned long */
2869
- type GPUSignedOffset32 = number; /* long */
2870
-
2871
- type GPUSize64Out = number; /* unsigned long long */
2872
- type GPUIntegerCoordinateOut = number; /* unsigned long */
2873
- type GPUSize32Out = number; /* unsigned long */
2874
-
2875
- type GPUFlagsConstant = number; /* unsigned long */
2876
-
2877
- interface GPUColorDict {
2878
- r: number;
2879
- g: number;
2880
- b: number;
2881
- a: number;
2882
- }
2883
- type GPUColor = [number, number, number, number] | GPUColorDict;
2884
-
2885
- interface GPUOrigin2DDict {
2886
- x?: GPUIntegerCoordinate /* default=0 */;
2887
- y?: GPUIntegerCoordinate /* default=0 */;
2888
- }
2889
- type GPUOrigin2D = [GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUOrigin2DDict;
2890
-
2891
- interface GPUOrigin3DDict {
2892
- x?: GPUIntegerCoordinate /* default=0 */;
2893
- y?: GPUIntegerCoordinate /* default=0 */;
2894
- z?: GPUIntegerCoordinate /* default=0 */;
2895
- }
2896
- type GPUOrigin3D = [GPUIntegerCoordinate, GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUOrigin3DDict;
2897
-
2898
- interface GPUExtent3DDict {
2899
- width: GPUIntegerCoordinate;
2900
- height?: GPUIntegerCoordinate /* default=1 */;
2901
- depthOrArrayLayers?: GPUIntegerCoordinate /* default=1 */;
2902
- }
2903
- type GPUExtent3D = [GPUIntegerCoordinate, GPUIntegerCoordinate, GPUIntegerCoordinate] | GPUExtent3DDict;
1786
+ /* eslint-disable babylonjs/available */
1787
+ /* eslint-disable @typescript-eslint/naming-convention */
1788
+
1789
+ // WebGPU type augmentations for APIs not yet in TypeScript's lib.dom.d.ts.
1790
+ // Do NOT re-types, interfaces, or classes already in lib.dom.d.ts,
1791
+ // as duplicate declarations cause errors with TypeScript 6.0+ which natively
1792
+ // includes WebGPU types.
1793
+
1794
+ // String indexer and extra supported limits not yet in lib.dom.d.ts
1795
+ interface GPUSupportedLimits {
1796
+ [name: string]: number;
1797
+ readonly maxStorageBuffersInVertexStage: number;
1798
+ readonly maxStorageBuffersInFragmentStage: number;
1799
+ readonly maxStorageTexturesInVertexStage: number;
1800
+ readonly maxStorageTexturesInFragmentStage: number;
1801
+ }
1802
+
1803
+ // Extra adapter request options not yet in lib.dom.d.ts
1804
+ interface GPURequestAdapterOptions {
1805
+ featureLevel?: string;
1806
+ xrCompatible?: boolean;
1807
+ }
1808
+
1809
+ // Extra texture properties not yet in lib.dom.d.ts
1810
+ interface GPUTexture {
1811
+ readonly textureBindingViewDimension: GPUTextureViewDimension | undefined;
1812
+ }
1813
+
1814
+ interface GPUTextureDescriptor {
1815
+ textureBindingViewDimension?: GPUTextureViewDimension;
1816
+ }
1817
+
1818
+ // Extra view descriptor property not yet in lib.dom.d.ts
1819
+ interface GPUTextureViewDescriptor {
1820
+ swizzle?: string;
1821
+ }
1822
+
1823
+ // Shader compilation hints not yet in lib.dom.d.ts
1824
+ interface GPUShaderModuleDescriptor {
1825
+ compilationHints?: GPUShaderModuleCompilationHint[];
1826
+ }
1827
+
1828
+ interface GPUShaderModuleCompilationHint {
1829
+ entryPoint: string;
1830
+ layout?: GPUPipelineLayout | GPUAutoLayoutMode;
1831
+ }
1832
+
1833
+ // Empty mixin not in lib.dom.d.ts, used for type compatibility
1834
+ interface GPUCommandsMixin {}
2904
1835
 
2905
1836
  /* eslint-disable no-var */
2906
1837
  /* eslint-disable @typescript-eslint/naming-convention */