webgpuConstants.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /** @hidden */
  2. export class WebGPUConstants {
  3. public static readonly GPUCullMode_none: GPUCullMode = "none";
  4. public static readonly GPUCullMode_front: GPUCullMode = "front";
  5. public static readonly GPUCullMode_back: GPUCullMode = "back";
  6. public static readonly GPUFrontFace_ccw: GPUFrontFace = "ccw";
  7. public static readonly GPUFrontFace_cw: GPUFrontFace = "cw";
  8. public static readonly GPUIndexFormat_uint16: GPUIndexFormat = "uint16";
  9. public static readonly GPUIndexFormat_uint32: GPUIndexFormat = "uint32";
  10. public static readonly GPULoadOp_load: GPULoadOp = "load";
  11. public static readonly GPUStoreOp_store: GPUStoreOp = "store";
  12. public static readonly GPUStoreOp_clear: GPUStoreOp = "clear";
  13. public static readonly GPUPrimitiveTopology_pointList: GPUPrimitiveTopology = "point-list";
  14. public static readonly GPUPrimitiveTopology_lineList: GPUPrimitiveTopology = "line-list";
  15. public static readonly GPUPrimitiveTopology_lineStrip: GPUPrimitiveTopology = "line-strip";
  16. public static readonly GPUPrimitiveTopology_triangleList: GPUPrimitiveTopology = "triangle-list";
  17. public static readonly GPUPrimitiveTopology_triangleStrip: GPUPrimitiveTopology = "triangle-strip";
  18. public static readonly GPUTextureDimension_1d: GPUTextureDimension = "1d";
  19. public static readonly GPUTextureDimension_2d: GPUTextureDimension = "2d";
  20. public static readonly GPUTextureDimension_3d: GPUTextureDimension = "3d";
  21. /* Normal 8 bit formats */
  22. public static readonly GPUTextureFormat_r8unorm: GPUTextureFormat = "r8unorm";
  23. public static readonly GPUTextureFormat_r8snorm: GPUTextureFormat = "r8snorm";
  24. public static readonly GPUTextureFormat_r8uint: GPUTextureFormat = "r8uint";
  25. public static readonly GPUTextureFormat_r8sint: GPUTextureFormat = "r8sint";
  26. /* Normal 16 bit formats */
  27. public static readonly GPUTextureFormat_r16unorm: GPUTextureFormat = "r16unorm";
  28. public static readonly GPUTextureFormat_r16snorm: GPUTextureFormat = "r16snorm";
  29. public static readonly GPUTextureFormat_r16uint: GPUTextureFormat = "r16uint";
  30. public static readonly GPUTextureFormat_r16sint: GPUTextureFormat = "r16sint";
  31. public static readonly GPUTextureFormat_r16float: GPUTextureFormat = "r16float";
  32. public static readonly GPUTextureFormat_rg8unorm: GPUTextureFormat = "rg8unorm";
  33. public static readonly GPUTextureFormat_rg8snorm: GPUTextureFormat = "rg8snorm";
  34. public static readonly GPUTextureFormat_rg8uint: GPUTextureFormat = "rg8uint";
  35. public static readonly GPUTextureFormat_rg8sint: GPUTextureFormat = "rg8sint";
  36. /* Normal 32 bit formats */
  37. public static readonly GPUTextureFormat_r32uint: GPUTextureFormat = "r32uint";
  38. public static readonly GPUTextureFormat_r32sint: GPUTextureFormat = "r32sint";
  39. public static readonly GPUTextureFormat_r32float: GPUTextureFormat = "r32float";
  40. public static readonly GPUTextureFormat_rg16unorm: GPUTextureFormat = "rg16unorm";
  41. public static readonly GPUTextureFormat_rg16snorm: GPUTextureFormat = "rg16snorm";
  42. public static readonly GPUTextureFormat_rg16uint: GPUTextureFormat = "rg16uint";
  43. public static readonly GPUTextureFormat_rg16sint: GPUTextureFormat = "rg16sint";
  44. public static readonly GPUTextureFormat_rg16float: GPUTextureFormat = "rg16float";
  45. public static readonly GPUTextureFormat_rgba8unorm: GPUTextureFormat = "rgba8unorm";
  46. public static readonly GPUTextureFormat_rgba8unormSrgb: GPUTextureFormat = "rgba8unorm-srgb";
  47. public static readonly GPUTextureFormat_rgba8snorm: GPUTextureFormat = "rgba8snorm";
  48. public static readonly GPUTextureFormat_rgba8uint: GPUTextureFormat = "rgba8uint";
  49. public static readonly GPUTextureFormat_rgba8sint: GPUTextureFormat = "rgba8sint";
  50. public static readonly GPUTextureFormat_bgra8unorm: GPUTextureFormat = "bgra8unorm";
  51. public static readonly GPUTextureFormat_bgra8unormSrgb: GPUTextureFormat = "bgra8unorm-srgb";
  52. /* Packed 32 bit formats */
  53. public static readonly GPUTextureFormat_rgb10a2unorm: GPUTextureFormat = "rgb10a2unorm";
  54. public static readonly GPUTextureFormat_rg11b10float: GPUTextureFormat = "rg11b10float";
  55. /* Normal 64 bit formats */
  56. public static readonly GPUTextureFormat_rg32uint: GPUTextureFormat = "rg32uint";
  57. public static readonly GPUTextureFormat_rg32sint: GPUTextureFormat = "rg32sint";
  58. public static readonly GPUTextureFormat_rg32float: GPUTextureFormat = "rg32float";
  59. public static readonly GPUTextureFormat_rgba16unorm: GPUTextureFormat = "rgba16unorm";
  60. public static readonly GPUTextureFormat_rgba16snorm: GPUTextureFormat = "rgba16snorm";
  61. public static readonly GPUTextureFormat_rgba16uint: GPUTextureFormat = "rgba16uint";
  62. public static readonly GPUTextureFormat_rgba16sint: GPUTextureFormat = "rgba16sint";
  63. public static readonly GPUTextureFormat_rgba16float: GPUTextureFormat = "rgba16float";
  64. /* Normal 128 bit formats */
  65. public static readonly GPUTextureFormat_rgba32uint: GPUTextureFormat = "rgba32uint";
  66. public static readonly GPUTextureFormat_rgba32sint: GPUTextureFormat = "rgba32sint";
  67. public static readonly GPUTextureFormat_rgba32float: GPUTextureFormat = "rgba32float";
  68. /* Depth and Stencil formats */
  69. public static readonly GPUTextureFormat_depth32float: GPUTextureFormat = "depth32float";
  70. public static readonly GPUTextureFormat_depth24plus: GPUTextureFormat = "depth24plus";
  71. public static readonly GPUTextureFormat_depth24plusStencil8: GPUTextureFormat = "depth24plus-stencil8";
  72. public static readonly GPUTextureViewDimension_1d: GPUTextureViewDimension = "1d";
  73. public static readonly GPUTextureViewDimension_2d: GPUTextureViewDimension = "2d";
  74. public static readonly GPUTextureViewDimension_2dArray: GPUTextureViewDimension = "2d-array";
  75. public static readonly GPUTextureViewDimension_cube: GPUTextureViewDimension = "cube";
  76. public static readonly GPUTextureViewDimension_cubeArray: GPUTextureViewDimension = "cube-array";
  77. public static readonly GPUTextureViewDimension_3d: GPUTextureViewDimension = "3d";
  78. public static readonly GPUPowerPreference_lowPower: GPUPowerPreference = "low-power";
  79. public static readonly GPUPowerPreference_highPerformance: GPUPowerPreference = "high-performance";
  80. public static readonly GPUVertexFormat_uchar2: GPUVertexFormat = "uchar2";
  81. public static readonly GPUVertexFormat_uchar4: GPUVertexFormat = "uchar4";
  82. public static readonly GPUVertexFormat_char2: GPUVertexFormat = "char2";
  83. public static readonly GPUVertexFormat_char4: GPUVertexFormat = "char4";
  84. public static readonly GPUVertexFormat_uchar2norm: GPUVertexFormat = "uchar2norm";
  85. public static readonly GPUVertexFormat_uchar4norm: GPUVertexFormat = "uchar4norm";
  86. public static readonly GPUVertexFormat_char2norm: GPUVertexFormat = "char2norm";
  87. public static readonly GPUVertexFormat_char4norm: GPUVertexFormat = "char4norm";
  88. public static readonly GPUVertexFormat_ushort2: GPUVertexFormat = "ushort2";
  89. public static readonly GPUVertexFormat_ushort4: GPUVertexFormat = "ushort4";
  90. public static readonly GPUVertexFormat_short2: GPUVertexFormat = "short2";
  91. public static readonly GPUVertexFormat_short4: GPUVertexFormat = "short4";
  92. public static readonly GPUVertexFormat_ushort2norm: GPUVertexFormat = "ushort2norm";
  93. public static readonly GPUVertexFormat_ushort4norm: GPUVertexFormat = "ushort4norm";
  94. public static readonly GPUVertexFormat_short2norm: GPUVertexFormat = "short2norm";
  95. public static readonly GPUVertexFormat_short4norm: GPUVertexFormat = "short4norm";
  96. public static readonly GPUVertexFormat_half2: GPUVertexFormat = "half2";
  97. public static readonly GPUVertexFormat_half4: GPUVertexFormat = "half4";
  98. public static readonly GPUVertexFormat_float: GPUVertexFormat = "float";
  99. public static readonly GPUVertexFormat_float2: GPUVertexFormat = "float2";
  100. public static readonly GPUVertexFormat_float3: GPUVertexFormat = "float3";
  101. public static readonly GPUVertexFormat_float4: GPUVertexFormat = "float4";
  102. public static readonly GPUVertexFormat_uint: GPUVertexFormat = "uint";
  103. public static readonly GPUVertexFormat_uint2: GPUVertexFormat = "uint2";
  104. public static readonly GPUVertexFormat_uint3: GPUVertexFormat = "uint3";
  105. public static readonly GPUVertexFormat_uint4: GPUVertexFormat = "uint4";
  106. public static readonly GPUVertexFormat_int: GPUVertexFormat = "int";
  107. public static readonly GPUVertexFormat_int2: GPUVertexFormat = "int2";
  108. public static readonly GPUVertexFormat_int3: GPUVertexFormat = "int3";
  109. public static readonly GPUVertexFormat_int4: GPUVertexFormat = "int4";
  110. public static readonly GPUBufferUsage_NONE = 0;
  111. public static readonly GPUBufferUsage_MAP_READ = 1;
  112. public static readonly GPUBufferUsage_MAP_WRITE = 2;
  113. public static readonly GPUBufferUsage_TRANSFER_SRC = 4;
  114. public static readonly GPUBufferUsage_TRANSFER_DST = 8;
  115. public static readonly GPUBufferUsage_INDEX = 16;
  116. public static readonly GPUBufferUsage_VERTEX = 32;
  117. public static readonly GPUBufferUsage_UNIFORM = 64;
  118. public static readonly GPUBufferUsage_STORAGE = 128;
  119. public static readonly GPUColorWriteBits_NONE = 0;
  120. public static readonly GPUColorWriteBits_RED = 1;
  121. public static readonly GPUColorWriteBits_GREEN = 2;
  122. public static readonly GPUColorWriteBits_BLUE = 4;
  123. public static readonly GPUColorWriteBits_ALPHA = 8;
  124. public static readonly GPUColorWriteBits_ALL = 15;
  125. public static readonly GPUShaderStageBit_NONE = 0;
  126. public static readonly GPUShaderStageBit_VERTEX = 1;
  127. public static readonly GPUShaderStageBit_FRAGMENT = 2;
  128. public static readonly GPUShaderStageBit_COMPUTE = 4;
  129. public static readonly GPUTextureAspect_all: GPUTextureAspect = "all";
  130. public static readonly GPUTextureAspect_depthOnly: GPUTextureAspect = "depth-only";
  131. public static readonly GPUTextureAspect_stencilOnly: GPUTextureAspect = "stencil-only";
  132. public static readonly GPUTextureUsage_NONE = 0;
  133. public static readonly GPUTextureUsage_COPY_SRC = 1;
  134. public static readonly GPUTextureUsage_COPY_DST = 2;
  135. public static readonly GPUTextureUsage_SAMPLED = 4;
  136. public static readonly GPUTextureUsage_STORAGE = 8;
  137. public static readonly GPUTextureUsage_OUTPUT_ATTACHMENT = 16;
  138. public static readonly GPUCompareFunction_never: GPUCompareFunction = "never";
  139. public static readonly GPUCompareFunction_less: GPUCompareFunction = "less";
  140. public static readonly GPUCompareFunction_equal: GPUCompareFunction = "equal";
  141. public static readonly GPUCompareFunction_lessEqual: GPUCompareFunction = "lessEqual";
  142. public static readonly GPUCompareFunction_greater: GPUCompareFunction = "greater";
  143. public static readonly GPUCompareFunction_notEqual: GPUCompareFunction = "notEqual";
  144. public static readonly GPUCompareFunction_greaterEqual: GPUCompareFunction = "greaterEqual";
  145. public static readonly GPUCompareFunction_always: GPUCompareFunction = "always";
  146. public static readonly GPUBindingType_uniformBuffer: GPUBindingType = "uniform-buffer";
  147. public static readonly GPUBindingType_sampler: GPUBindingType = "sampler";
  148. public static readonly GPUBindingType_sampledTexture: GPUBindingType = "sampled-texture";
  149. public static readonly GPUBindingType_storageBuffer: GPUBindingType = "storage-buffer";
  150. public static readonly GPUInputStepMode_vertex: GPUInputStepMode = "vertex";
  151. public static readonly GPUInputStepMode_instance: GPUInputStepMode = "instance";
  152. public static readonly GPUStencilOperation_keep: GPUStencilOperation = "keep";
  153. public static readonly GPUStencilOperation_zero: GPUStencilOperation = "zero";
  154. public static readonly GPUStencilOperation_replace: GPUStencilOperation = "replace";
  155. public static readonly GPUStencilOperation_invert: GPUStencilOperation = "invert";
  156. public static readonly GPUStencilOperation_incrementClamp: GPUStencilOperation = "increment-clamp";
  157. public static readonly GPUStencilOperation_decrementClamp: GPUStencilOperation = "decrement-clamp";
  158. public static readonly GPUStencilOperation_incrementWrap: GPUStencilOperation = "increment-wrap";
  159. public static readonly GPUStencilOperation_decrementWrap: GPUStencilOperation = "decrement-wrap";
  160. public static readonly GPUFilterMode_nearest: GPUFilterMode = "nearest";
  161. public static readonly GPUFilterMode_linear: GPUFilterMode = "linear";
  162. public static readonly GPUAddressMode_clampToEdge: GPUAddressMode = "clamp-to-edge";
  163. public static readonly GPUAddressMode_repeat: GPUAddressMode = "repeat";
  164. public static readonly GPUAddressMode_mirrorRepeat: GPUAddressMode = "mirror-repeat";
  165. public static readonly GPUBlendFactor_zero: GPUBlendFactor = "zero";
  166. public static readonly GPUBlendFactor_one: GPUBlendFactor = "one";
  167. public static readonly GPUBlendFactor_srcColor: GPUBlendFactor = "src-color";
  168. public static readonly GPUBlendFactor_oneMinusSrcColor: GPUBlendFactor = "one-minus-src-color";
  169. public static readonly GPUBlendFactor_srcAlpha: GPUBlendFactor = "src-alpha";
  170. public static readonly GPUBlendFactor_oneMinusSrcAlpha: GPUBlendFactor = "one-minus-src-alpha";
  171. public static readonly GPUBlendFactor_dstColor: GPUBlendFactor = "dst-color";
  172. public static readonly GPUBlendFactor_oneMinusDstColor: GPUBlendFactor = "one-minus-dst-color";
  173. public static readonly GPUBlendFactor_dstAlpha: GPUBlendFactor = "dst-alpha";
  174. public static readonly GPUBlendFactor_oneMinusDstAlpha: GPUBlendFactor = "one-minus-dst-alpha";
  175. public static readonly GPUBlendFactor_srcAlphaSaturated: GPUBlendFactor = "src-alpha-saturated";
  176. public static readonly GPUBlendFactor_blendColor: GPUBlendFactor = "blend-color";
  177. public static readonly GPUBlendFactor_oneMinusBlendColor: GPUBlendFactor = "one-minus-blend-color";
  178. public static readonly GPUBlendOperation_add: GPUBlendOperation = "add";
  179. public static readonly GPUBlendOperation_substract: GPUBlendOperation = "subtract";
  180. public static readonly GPUBlendOperation_reverseSubtract: GPUBlendOperation = "reverse-subtract";
  181. public static readonly GPUBlendOperation_min: GPUBlendOperation = "min";
  182. public static readonly GPUBlendOperation_max: GPUBlendOperation = "max";
  183. }