webgpuConstants.d.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. /** @internal */
  2. export declare enum PowerPreference {
  3. LowPower = "low-power",
  4. HighPerformance = "high-performance"
  5. }
  6. /** @internal */
  7. export declare enum FeatureName {
  8. DepthClipControl = "depth-clip-control",
  9. Depth32FloatStencil8 = "depth32float-stencil8",
  10. TextureCompressionBC = "texture-compression-bc",
  11. TextureCompressionETC2 = "texture-compression-etc2",
  12. TextureCompressionASTC = "texture-compression-astc",
  13. TimestampQuery = "timestamp-query",
  14. IndirectFirstInstance = "indirect-first-instance",
  15. ShaderF16 = "shader-f16",
  16. RG11B10UFloatRenderable = "rg11b10ufloat-renderable",
  17. BGRA8UnormStorage = "bgra8unorm-storage",
  18. Float32Filterable = "float32-filterable"
  19. }
  20. /** @internal */
  21. export declare enum BufferMapState {
  22. Unmapped = "unmapped",
  23. Pending = "pending",
  24. Mapped = "mapped"
  25. }
  26. /** @internal */
  27. export declare enum BufferUsage {
  28. MapRead = 1,
  29. MapWrite = 2,
  30. CopySrc = 4,
  31. CopyDst = 8,
  32. Index = 16,
  33. Vertex = 32,
  34. Uniform = 64,
  35. Storage = 128,
  36. Indirect = 256,
  37. QueryResolve = 512
  38. }
  39. /** @internal */
  40. export declare enum MapMode {
  41. Read = 1,
  42. Write = 2
  43. }
  44. /** @internal */
  45. export declare enum TextureDimension {
  46. E1d = "1d",
  47. E2d = "2d",
  48. E3d = "3d"
  49. }
  50. /** @internal */
  51. export declare enum TextureUsage {
  52. CopySrc = 1,
  53. CopyDst = 2,
  54. TextureBinding = 4,
  55. StorageBinding = 8,
  56. RenderAttachment = 16
  57. }
  58. /** @internal */
  59. export declare enum TextureViewDimension {
  60. E1d = "1d",
  61. E2d = "2d",
  62. E2dArray = "2d-array",
  63. Cube = "cube",
  64. CubeArray = "cube-array",
  65. E3d = "3d"
  66. }
  67. /** @internal */
  68. export declare enum TextureAspect {
  69. All = "all",
  70. StencilOnly = "stencil-only",
  71. DepthOnly = "depth-only"
  72. }
  73. /**
  74. * Comments taken from https://github.com/gfx-rs/wgpu/blob/master/wgpu-types/src/lib.rs
  75. * @internal
  76. */
  77. export declare enum TextureFormat {
  78. R8Unorm = "r8unorm",
  79. R8Snorm = "r8snorm",
  80. R8Uint = "r8uint",
  81. R8Sint = "r8sint",
  82. R16Uint = "r16uint",
  83. R16Sint = "r16sint",
  84. R16Float = "r16float",
  85. RG8Unorm = "rg8unorm",
  86. RG8Snorm = "rg8snorm",
  87. RG8Uint = "rg8uint",
  88. RG8Sint = "rg8sint",
  89. R32Uint = "r32uint",
  90. R32Sint = "r32sint",
  91. R32Float = "r32float",
  92. RG16Uint = "rg16uint",
  93. RG16Sint = "rg16sint",
  94. RG16Float = "rg16float",
  95. RGBA8Unorm = "rgba8unorm",
  96. RGBA8UnormSRGB = "rgba8unorm-srgb",
  97. RGBA8Snorm = "rgba8snorm",
  98. RGBA8Uint = "rgba8uint",
  99. RGBA8Sint = "rgba8sint",
  100. BGRA8Unorm = "bgra8unorm",
  101. BGRA8UnormSRGB = "bgra8unorm-srgb",
  102. RGB9E5UFloat = "rgb9e5ufloat",
  103. RGB10A2UINT = "rgb10a2uint",
  104. RGB10A2Unorm = "rgb10a2unorm",
  105. RG11B10UFloat = "rg11b10ufloat",
  106. RG32Uint = "rg32uint",
  107. RG32Sint = "rg32sint",
  108. RG32Float = "rg32float",
  109. RGBA16Uint = "rgba16uint",
  110. RGBA16Sint = "rgba16sint",
  111. RGBA16Float = "rgba16float",
  112. RGBA32Uint = "rgba32uint",
  113. RGBA32Sint = "rgba32sint",
  114. RGBA32Float = "rgba32float",
  115. Stencil8 = "stencil8",
  116. Depth16Unorm = "depth16unorm",
  117. Depth24Plus = "depth24plus",
  118. Depth24PlusStencil8 = "depth24plus-stencil8",
  119. Depth32Float = "depth32float",
  120. BC1RGBAUnorm = "bc1-rgba-unorm",
  121. BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb",
  122. BC2RGBAUnorm = "bc2-rgba-unorm",
  123. BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb",
  124. BC3RGBAUnorm = "bc3-rgba-unorm",
  125. BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb",
  126. BC4RUnorm = "bc4-r-unorm",
  127. BC4RSnorm = "bc4-r-snorm",
  128. BC5RGUnorm = "bc5-rg-unorm",
  129. BC5RGSnorm = "bc5-rg-snorm",
  130. BC6HRGBUFloat = "bc6h-rgb-ufloat",
  131. BC6HRGBFloat = "bc6h-rgb-float",
  132. BC7RGBAUnorm = "bc7-rgba-unorm",
  133. BC7RGBAUnormSRGB = "bc7-rgba-unorm-srgb",
  134. ETC2RGB8Unorm = "etc2-rgb8unorm",
  135. ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb",
  136. ETC2RGB8A1Unorm = "etc2-rgb8a1unorm",
  137. ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb",
  138. ETC2RGBA8Unorm = "etc2-rgba8unorm",
  139. ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb",
  140. EACR11Unorm = "eac-r11unorm",
  141. EACR11Snorm = "eac-r11snorm",
  142. EACRG11Unorm = "eac-rg11unorm",
  143. EACRG11Snorm = "eac-rg11snorm",
  144. ASTC4x4Unorm = "astc-4x4-unorm",
  145. ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb",
  146. ASTC5x4Unorm = "astc-5x4-unorm",
  147. ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb",
  148. ASTC5x5Unorm = "astc-5x5-unorm",
  149. ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb",
  150. ASTC6x5Unorm = "astc-6x5-unorm",
  151. ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb",
  152. ASTC6x6Unorm = "astc-6x6-unorm",
  153. ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb",
  154. ASTC8x5Unorm = "astc-8x5-unorm",
  155. ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb",
  156. ASTC8x6Unorm = "astc-8x6-unorm",
  157. ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb",
  158. ASTC8x8Unorm = "astc-8x8-unorm",
  159. ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb",
  160. ASTC10x5Unorm = "astc-10x5-unorm",
  161. ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb",
  162. ASTC10x6Unorm = "astc-10x6-unorm",
  163. ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb",
  164. ASTC10x8Unorm = "astc-10x8-unorm",
  165. ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb",
  166. ASTC10x10Unorm = "astc-10x10-unorm",
  167. ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb",
  168. ASTC12x10Unorm = "astc-12x10-unorm",
  169. ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb",
  170. ASTC12x12Unorm = "astc-12x12-unorm",
  171. ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb",
  172. Depth32FloatStencil8 = "depth32float-stencil8"
  173. }
  174. /** @internal */
  175. export declare enum AddressMode {
  176. ClampToEdge = "clamp-to-edge",
  177. Repeat = "repeat",
  178. MirrorRepeat = "mirror-repeat"
  179. }
  180. /** @internal */
  181. export declare enum FilterMode {
  182. Nearest = "nearest",
  183. Linear = "linear"
  184. }
  185. /** @internal */
  186. export declare enum MipmapFilterMode {
  187. Nearest = "nearest",
  188. Linear = "linear"
  189. }
  190. /** @internal */
  191. export declare enum CompareFunction {
  192. Never = "never",
  193. Less = "less",
  194. Equal = "equal",
  195. LessEqual = "less-equal",
  196. Greater = "greater",
  197. NotEqual = "not-equal",
  198. GreaterEqual = "greater-equal",
  199. Always = "always"
  200. }
  201. /** @internal */
  202. export declare enum ShaderStage {
  203. Vertex = 1,
  204. Fragment = 2,
  205. Compute = 4
  206. }
  207. /** @internal */
  208. export declare enum BufferBindingType {
  209. Uniform = "uniform",
  210. Storage = "storage",
  211. ReadOnlyStorage = "read-only-storage"
  212. }
  213. /** @internal */
  214. export declare enum SamplerBindingType {
  215. Filtering = "filtering",
  216. NonFiltering = "non-filtering",
  217. Comparison = "comparison"
  218. }
  219. /** @internal */
  220. export declare enum TextureSampleType {
  221. Float = "float",
  222. UnfilterableFloat = "unfilterable-float",
  223. Depth = "depth",
  224. Sint = "sint",
  225. Uint = "uint"
  226. }
  227. /** @internal */
  228. export declare enum StorageTextureAccess {
  229. WriteOnly = "write-only",
  230. ReadOnly = "read-only",
  231. ReadWrite = "read-write"
  232. }
  233. /** @internal */
  234. export declare enum CompilationMessageType {
  235. Error = "error",
  236. Warning = "warning",
  237. Info = "info"
  238. }
  239. /** @internal */
  240. export declare enum PipelineErrorReason {
  241. Validation = "validation",
  242. Internal = "internal"
  243. }
  244. /** @internal */
  245. export declare enum AutoLayoutMode {
  246. Auto = "auto"
  247. }
  248. /** @internal */
  249. export declare enum PrimitiveTopology {
  250. PointList = "point-list",
  251. LineList = "line-list",
  252. LineStrip = "line-strip",
  253. TriangleList = "triangle-list",
  254. TriangleStrip = "triangle-strip"
  255. }
  256. /** @internal */
  257. export declare enum FrontFace {
  258. CCW = "ccw",
  259. CW = "cw"
  260. }
  261. /** @internal */
  262. export declare enum CullMode {
  263. None = "none",
  264. Front = "front",
  265. Back = "back"
  266. }
  267. /** @internal */
  268. export declare enum ColorWrite {
  269. Red = 1,
  270. Green = 2,
  271. Blue = 4,
  272. Alpha = 8,
  273. All = 15
  274. }
  275. /** @internal */
  276. export declare enum BlendFactor {
  277. Zero = "zero",
  278. One = "one",
  279. Src = "src",
  280. OneMinusSrc = "one-minus-src",
  281. SrcAlpha = "src-alpha",
  282. OneMinusSrcAlpha = "one-minus-src-alpha",
  283. Dst = "dst",
  284. OneMinusDst = "one-minus-dst",
  285. DstAlpha = "dst-alpha",
  286. OneMinusDstAlpha = "one-minus-dst-alpha",
  287. SrcAlphaSaturated = "src-alpha-saturated",
  288. Constant = "constant",
  289. OneMinusConstant = "one-minus-constant"
  290. }
  291. /** @internal */
  292. export declare enum BlendOperation {
  293. Add = "add",
  294. Subtract = "subtract",
  295. ReverseSubtract = "reverse-subtract",
  296. Min = "min",
  297. Max = "max"
  298. }
  299. /** @internal */
  300. export declare enum StencilOperation {
  301. Keep = "keep",
  302. Zero = "zero",
  303. Replace = "replace",
  304. Invert = "invert",
  305. IncrementClamp = "increment-clamp",
  306. DecrementClamp = "decrement-clamp",
  307. IncrementWrap = "increment-wrap",
  308. DecrementWrap = "decrement-wrap"
  309. }
  310. /** @internal */
  311. export declare enum IndexFormat {
  312. Uint16 = "uint16",
  313. Uint32 = "uint32"
  314. }
  315. /** @internal */
  316. export declare enum VertexFormat {
  317. Uint8x2 = "uint8x2",
  318. Uint8x4 = "uint8x4",
  319. Sint8x2 = "sint8x2",
  320. Sint8x4 = "sint8x4",
  321. Unorm8x2 = "unorm8x2",
  322. Unorm8x4 = "unorm8x4",
  323. Snorm8x2 = "snorm8x2",
  324. Snorm8x4 = "snorm8x4",
  325. Uint16x2 = "uint16x2",
  326. Uint16x4 = "uint16x4",
  327. Sint16x2 = "sint16x2",
  328. Sint16x4 = "sint16x4",
  329. Unorm16x2 = "unorm16x2",
  330. Unorm16x4 = "unorm16x4",
  331. Snorm16x2 = "snorm16x2",
  332. Snorm16x4 = "snorm16x4",
  333. Float16x2 = "float16x2",
  334. Float16x4 = "float16x4",
  335. Float32 = "float32",
  336. Float32x2 = "float32x2",
  337. Float32x3 = "float32x3",
  338. Float32x4 = "float32x4",
  339. Uint32 = "uint32",
  340. Uint32x2 = "uint32x2",
  341. Uint32x3 = "uint32x3",
  342. Uint32x4 = "uint32x4",
  343. Sint32 = "sint32",
  344. Sint32x2 = "sint32x2",
  345. Sint32x3 = "sint32x3",
  346. Sint32x4 = "sint32x4",
  347. UNORM10x10x10x2 = "unorm10-10-10-2"
  348. }
  349. /** @internal */
  350. export declare enum VertexStepMode {
  351. Vertex = "vertex",
  352. Instance = "instance"
  353. }
  354. /** @internal */
  355. export declare enum ComputePassTimestampLocation {
  356. Beginning = "beginning",
  357. End = "end"
  358. }
  359. /** @internal */
  360. export declare enum RenderPassTimestampLocation {
  361. Beginning = "beginning",
  362. End = "end"
  363. }
  364. /** @internal */
  365. export declare enum LoadOp {
  366. Load = "load",
  367. Clear = "clear"
  368. }
  369. /** @internal */
  370. export declare enum StoreOp {
  371. Store = "store",
  372. Discard = "discard"
  373. }
  374. /** @internal */
  375. export declare enum QueryType {
  376. Occlusion = "occlusion",
  377. Timestamp = "timestamp"
  378. }
  379. /** @internal */
  380. export declare enum CanvasAlphaMode {
  381. Opaque = "opaque",
  382. Premultiplied = "premultiplied"
  383. }
  384. /** @internal */
  385. export declare enum DeviceLostReason {
  386. Unknown = "unknown",
  387. Destroyed = "destroyed"
  388. }
  389. /** @internal */
  390. export declare enum ErrorFilter {
  391. Validation = "validation",
  392. OutOfMemory = "out-of-memory",
  393. Internal = "internal"
  394. }