webgpuConstants.ts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /** @hidden */
  2. export enum ExtensionName {
  3. DepthClamping = "depth-clamping",
  4. Depth24UnormStencil8 = "depth24unorm-stencil8",
  5. Depth32FloatStencil8 = "depth32float-stencil8",
  6. PipelineStatisticsQuery = "pipeline-statistics-query",
  7. TextureCompressionBC = "texture-compression-bc",
  8. TimestampQuery = "timestamp-query"
  9. }
  10. /** @hidden */
  11. export enum AddressMode {
  12. ClampToEdge = "clamp-to-edge",
  13. Repeat = "repeat",
  14. MirrorRepeat = "mirror-repeat"
  15. }
  16. /** @hidden */
  17. export enum BindingType {
  18. UniformBuffer = "uniform-buffer",
  19. StorageBuffer = "storage-buffer",
  20. ReadonlyStorageBuffer = "readonly-storage-buffer",
  21. Sampler = "sampler",
  22. ComparisonSampler = "comparison-sampler",
  23. SampledTexture = "sampled-texture",
  24. ReadonlyStorageTexture = "readonly-storage-texture",
  25. WriteonlyStorageTexture = "writeonly-storage-texture"
  26. }
  27. /** @hidden */
  28. export enum BlendFactor {
  29. Zero = "zero",
  30. One = "one",
  31. SrcColor = "src-color",
  32. OneMinusSrcColor = "one-minus-src-color",
  33. SrcAlpha = "src-alpha",
  34. OneMinusSrcAlpha = "one-minus-src-alpha",
  35. DstColor = "dst-color",
  36. OneMinusDstColor = "one-minus-dst-color",
  37. DstAlpha = "dst-alpha",
  38. OneMinusDstAlpha = "one-minus-dst-alpha",
  39. SrcAlphaSaturated = "src-alpha-saturated",
  40. BlendColor = "blend-color",
  41. OneMinusBlendColor = "one-minus-blend-color"
  42. }
  43. /** @hidden */
  44. export enum BlendOperation {
  45. Add = "add",
  46. Subtract = "subtract",
  47. ReverseSubtract = "reverse-subtract",
  48. Min = "min",
  49. Max = "max"
  50. }
  51. /** @hidden */
  52. export enum CompareFunction {
  53. Never = "never",
  54. Less = "less",
  55. Equal = "equal",
  56. LessEqual = "less-equal",
  57. Greater = "greater",
  58. NotEqual = "not-equal",
  59. GreaterEqual = "greater-equal",
  60. Always = "always"
  61. }
  62. /** @hidden */
  63. export enum CullMode {
  64. None = "none",
  65. Front = "front",
  66. Back = "back"
  67. }
  68. /** @hidden */
  69. export enum FilterMode {
  70. Nearest = "nearest",
  71. Linear = "linear"
  72. }
  73. /** @hidden */
  74. export enum FrontFace {
  75. CCW = "ccw",
  76. CW = "cw"
  77. }
  78. /** @hidden */
  79. export enum IndexFormat {
  80. Uint16 = "uint16",
  81. Uint32 = "uint32"
  82. }
  83. /** @hidden */
  84. export enum InputStepMode {
  85. Vertex = "vertex",
  86. Instance = "instance"
  87. }
  88. /** @hidden */
  89. export enum LoadOp {
  90. Load = "load"
  91. }
  92. /** @hidden */
  93. export enum PrimitiveTopology {
  94. PointList = "point-list",
  95. LineList = "line-list",
  96. LineStrip = "line-strip",
  97. TriangleList = "triangle-list",
  98. TriangleStrip = "triangle-strip"
  99. }
  100. /** @hidden */
  101. export enum StencilOperation {
  102. Keep = "keep",
  103. Zero = "zero",
  104. Replace = "replace",
  105. Invert = "invert",
  106. IncrementClamp = "increment-clamp",
  107. DecrementClamp = "decrement-clamp",
  108. IncrementWrap = "increment-wrap",
  109. DecrementWrap = "decrement-wrap"
  110. }
  111. /** @hidden */
  112. export enum StoreOp {
  113. Store = "store",
  114. Clear = "clear"
  115. }
  116. /** @hidden */
  117. export enum TextureDimension {
  118. E1d = "1d",
  119. E2d = "2d",
  120. E3d = "3d"
  121. }
  122. /** @hidden */
  123. export enum TextureFormat {
  124. // 8-bit formats
  125. R8Unorm = "r8unorm",
  126. R8Snorm = "r8snorm",
  127. R8Uint = "r8uint",
  128. R8Sint = "r8sint",
  129. // 16-bit formats
  130. R16Uint = "r16uint",
  131. R16Sint = "r16sint",
  132. R16Float = "r16float",
  133. RG8Unorm = "rg8unorm",
  134. RG8Snorm = "rg8snorm",
  135. RG8Uint = "rg8uint",
  136. RG8Sint = "rg8sint",
  137. // 32-bit formats
  138. R32Uint = "r32uint",
  139. R32Sint = "r32sint",
  140. R32Float = "r32float",
  141. RG16Uint = "rg16uint",
  142. RG16Sint = "rg16sint",
  143. RG16Float = "rg16float",
  144. RGBA8Unorm = "rgba8unorm",
  145. RGBA8UnormSRGB = "rgba8unorm-srgb",
  146. RGBA8Snorm = "rgba8snorm",
  147. RGBA8Uint = "rgba8uint",
  148. RGBA8Sint = "rgba8sint",
  149. BGRA8Unorm = "bgra8unorm",
  150. BGRA8UnormSRGB = "bgra8unorm-srgb",
  151. // Packed 32-bit formats
  152. RGB9E5UFloat = "rgb9e5ufloat",
  153. RGB10A2Unorm = "rgb10a2unorm",
  154. RG11B10UFloat = "rg11b10ufloat",
  155. // 64-bit formats
  156. RG32Uint = "rg32uint",
  157. RG32Sint = "rg32sint",
  158. RG32Float = "rg32float",
  159. RGBA16Uint = "rgba16uint",
  160. RGBA16Sint = "rgba16sint",
  161. RGBA16Float = "rgba16float",
  162. // 128-bit formats
  163. RGBA32Uint = "rgba32uint",
  164. RGBA32Sint = "rgba32sint",
  165. RGBA32Float = "rgba32float",
  166. // Depth and stencil formats
  167. Stencil8 = "stencil8",
  168. Depth16Unorm = "depth16unorm",
  169. Depth24Plus = "depth24plus",
  170. Depth24PlusStencil8 = "depth24plus-stencil8",
  171. Depth32Float = "depth32float",
  172. // BC compressed formats usable if "texture-compression-bc" is both
  173. // supported by the device/user agent and enabled in requestDevice.
  174. BC1RGBAUNorm = "bc1-rgba-unorm",
  175. BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb",
  176. BC2RGBAUnorm = "bc2-rgba-unorm",
  177. BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb",
  178. BC3RGBAUnorm = "bc3-rgba-unorm",
  179. BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb",
  180. BC4RUnorm = "bc4-r-unorm",
  181. BC4RSnorm = "bc4-r-snorm",
  182. BC5RGUnorm = "bc5-rg-unorm",
  183. BC5RGSnorm = "bc5-rg-snorm",
  184. BC6HRGBUFloat = "bc6h-rgb-ufloat",
  185. BC6HRGBFloat = "bc6h-rgb-float",
  186. BC7RGBAUnorm = "bc7-rgba-unorm",
  187. BC7RGBAUnormSRGB = "bc7-rgba-unorm-srgb",
  188. // "depth24unorm-stencil8" feature
  189. Depth24UnormStencil8 = "depth24unorm-stencil8",
  190. // "depth32float-stencil8" feature
  191. Depth32FloatStencil8 = "depth32float-stencil8"
  192. }
  193. /** @hidden */
  194. export enum TextureComponentType {
  195. Float = "float",
  196. Sint = "sint",
  197. Uint = "uint",
  198. // Texture is used with comparison sampling only.
  199. DepthComparison = "depth-comparison"
  200. }
  201. /** @hidden */
  202. export enum TextureViewDimension {
  203. E1d = "1d",
  204. E2d = "2d",
  205. E2dArray = "2d-array",
  206. Cube = "cube",
  207. CubeArray = "cube-array",
  208. E3d = "3d"
  209. }
  210. /** @hidden */
  211. export enum VertexFormat {
  212. Uchar2 = "uchar2",
  213. Uchar4 = "uchar4",
  214. Char2 = "char2",
  215. Char4 = "char4",
  216. Uchar2Norm = "uchar2norm",
  217. Uchar4Norm = "uchar4norm",
  218. Char2Norm = "char2norm",
  219. Char4Norm = "char4norm",
  220. Ushort2 = "ushort2",
  221. Ushort4 = "ushort4",
  222. Short2 = "short2",
  223. Short4 = "short4",
  224. Ushort2Norm = "ushort2norm",
  225. Ushort4Norm = "ushort4norm",
  226. Short2Norm = "short2norm",
  227. Short4Norm = "short4norm",
  228. Half2 = "half2",
  229. Half4 = "half4",
  230. Float = "float",
  231. Float2 = "float2",
  232. Float3 = "float3",
  233. Float4 = "float4",
  234. Uint = "uint",
  235. Uint2 = "uint2",
  236. Uint3 = "uint3",
  237. Uint4 = "uint4",
  238. Int = "int",
  239. Int2 = "int2",
  240. Int3 = "int3",
  241. Int4 = "int4"
  242. }
  243. /** @hidden */
  244. export enum TextureAspect {
  245. All = "all",
  246. StencilOnly = "stencil-only",
  247. DepthOnly = "depth-only"
  248. }
  249. /** @hidden */
  250. export enum CompilationMessageType {
  251. Error = "error",
  252. Warning = "warning",
  253. Info = "info"
  254. }
  255. /** @hidden */
  256. export enum QueryType {
  257. Occlusion = "occlusion"
  258. }
  259. /** @hidden */
  260. export enum BufferUsage {
  261. MapRead = 1,
  262. MapWrite = 2,
  263. CopySrc = 4,
  264. CopyDst = 8,
  265. Index = 16,
  266. Vertex = 32,
  267. Uniform = 64,
  268. Storage = 128,
  269. Indirect = 256,
  270. QueryResolve = 512
  271. }
  272. /** @hidden */
  273. export enum ColorWrite {
  274. Red = 1,
  275. Green = 2,
  276. Blue = 4,
  277. Alpha = 8,
  278. All = 15
  279. }
  280. /** @hidden */
  281. export enum ShaderStage {
  282. Vertex = 1,
  283. Fragment = 2,
  284. Compute = 4
  285. }
  286. /** @hidden */
  287. export enum TextureUsage {
  288. CopySrc = 1,
  289. CopyDst = 2,
  290. Sampled = 4,
  291. Storage = 8,
  292. OutputAttachment = 16
  293. }
  294. /** @hidden */
  295. export enum MapMode {
  296. Read = 1,
  297. Write = 2
  298. }