webgpu.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  1. // Based on
  2. // https://github.com/webgpu-native/webgpu-headers/blob/main/webgpu.h
  3. // Copyright 2019-2023 WebGPU-Native developers
  4. // SPDX-License-Identifier: BSD-3-Clause
  5. #pragma once
  6. #define WGPU_NULLABLE
  7. #include <stdint.h>
  8. #include <stddef.h>
  9. #include <math.h>
  10. typedef struct WGPUStringView {
  11. WGPU_NULLABLE char const * data;
  12. size_t length;
  13. } WGPUStringView;
  14. typedef uint64_t WGPUFlags;
  15. typedef uint32_t WGPUBool;
  16. typedef struct WGPUAdapterImpl* WGPUAdapter;
  17. typedef struct WGPUBindGroupImpl* WGPUBindGroup;
  18. typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout;
  19. typedef struct WGPUBufferImpl* WGPUBuffer;
  20. typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer;
  21. typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder;
  22. typedef struct WGPUDeviceImpl* WGPUDevice;
  23. typedef struct WGPUInstanceImpl* WGPUInstance;
  24. typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout;
  25. typedef struct WGPUQuerySetImpl* WGPUQuerySet;
  26. typedef struct WGPUQueueImpl* WGPUQueue;
  27. typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder;
  28. typedef struct WGPURenderPipelineImpl* WGPURenderPipeline;
  29. typedef struct WGPUSamplerImpl* WGPUSampler;
  30. typedef struct WGPUShaderModuleImpl* WGPUShaderModule;
  31. typedef struct WGPUSurfaceImpl* WGPUSurface;
  32. typedef struct WGPUTextureImpl* WGPUTexture;
  33. typedef struct WGPUTextureViewImpl* WGPUTextureView;
  34. struct WGPUAdapterInfo;
  35. struct WGPUBindGroupEntry;
  36. struct WGPUBlendComponent;
  37. struct WGPUBufferBindingLayout;
  38. struct WGPUBufferDescriptor;
  39. struct WGPUColor;
  40. struct WGPUCommandBufferDescriptor;
  41. struct WGPUCommandEncoderDescriptor;
  42. struct WGPUConstantEntry;
  43. struct WGPUExtent3D;
  44. struct WGPUFuture;
  45. struct WGPUInstanceLimits;
  46. struct WGPULimits;
  47. struct WGPUMultisampleState;
  48. struct WGPUOrigin3D;
  49. struct WGPUPassTimestampWrites;
  50. struct WGPUPipelineLayoutDescriptor;
  51. struct WGPUPrimitiveState;
  52. struct WGPUQueueDescriptor;
  53. struct WGPURenderPassDepthStencilAttachment;
  54. struct WGPUSamplerBindingLayout;
  55. struct WGPUSamplerDescriptor;
  56. struct WGPUShaderSourceWGSL;
  57. struct WGPUStencilFaceState;
  58. struct WGPUStorageTextureBindingLayout;
  59. struct WGPUSurfaceCapabilities;
  60. struct WGPUSurfaceTexture;
  61. struct WGPUTexelCopyBufferLayout;
  62. struct WGPUTextureBindingLayout;
  63. struct WGPUTextureViewDescriptor;
  64. struct WGPUVertexAttribute;
  65. struct WGPUBindGroupDescriptor;
  66. struct WGPUBindGroupLayoutEntry;
  67. struct WGPUBlendState;
  68. struct WGPUDepthStencilState;
  69. struct WGPUDeviceDescriptor;
  70. struct WGPUInstanceDescriptor;
  71. struct WGPURenderPassColorAttachment;
  72. struct WGPURequestAdapterOptions;
  73. struct WGPUShaderModuleDescriptor;
  74. struct WGPUTexelCopyBufferInfo;
  75. struct WGPUTexelCopyTextureInfo;
  76. struct WGPUTextureDescriptor;
  77. struct WGPUVertexBufferLayout;
  78. struct WGPUBindGroupLayoutDescriptor;
  79. struct WGPUColorTargetState;
  80. struct WGPURenderPassDescriptor;
  81. struct WGPUVertexState;
  82. struct WGPUFragmentState;
  83. struct WGPURenderPipelineDescriptor;
  84. struct WGPUDeviceLostCallbackInfo;
  85. struct WGPURequestAdapterCallbackInfo;
  86. struct WGPURequestDeviceCallbackInfo;
  87. struct WGPUUncapturedErrorCallbackInfo;
  88. typedef enum WGPUAdapterType {
  89. WGPUAdapterType_DiscreteGPU = 0x00000001,
  90. WGPUAdapterType_IntegratedGPU = 0x00000002,
  91. WGPUAdapterType_CPU = 0x00000003,
  92. WGPUAdapterType_Unknown = 0x00000004,
  93. WGPUAdapterType_Force32 = 0x7FFFFFFF
  94. } WGPUAdapterType;
  95. typedef enum WGPUAddressMode {
  96. WGPUAddressMode_Undefined = 0x00000000,
  97. WGPUAddressMode_ClampToEdge = 0x00000001,
  98. WGPUAddressMode_Repeat = 0x00000002,
  99. WGPUAddressMode_MirrorRepeat = 0x00000003,
  100. WGPUAddressMode_Force32 = 0x7FFFFFFF
  101. } WGPUAddressMode;
  102. typedef enum WGPUBackendType {
  103. WGPUBackendType_Undefined = 0x00000000,
  104. WGPUBackendType_Null = 0x00000001,
  105. WGPUBackendType_WebGPU = 0x00000002,
  106. WGPUBackendType_D3D11 = 0x00000003,
  107. WGPUBackendType_D3D12 = 0x00000004,
  108. WGPUBackendType_Metal = 0x00000005,
  109. WGPUBackendType_Vulkan = 0x00000006,
  110. WGPUBackendType_OpenGL = 0x00000007,
  111. WGPUBackendType_OpenGLES = 0x00000008,
  112. WGPUBackendType_Force32 = 0x7FFFFFFF
  113. } WGPUBackendType;
  114. typedef enum WGPUBlendFactor {
  115. WGPUBlendFactor_Undefined = 0x00000000,
  116. WGPUBlendFactor_Zero = 0x00000001,
  117. WGPUBlendFactor_One = 0x00000002,
  118. WGPUBlendFactor_Src = 0x00000003,
  119. WGPUBlendFactor_OneMinusSrc = 0x00000004,
  120. WGPUBlendFactor_SrcAlpha = 0x00000005,
  121. WGPUBlendFactor_OneMinusSrcAlpha = 0x00000006,
  122. WGPUBlendFactor_Dst = 0x00000007,
  123. WGPUBlendFactor_OneMinusDst = 0x00000008,
  124. WGPUBlendFactor_DstAlpha = 0x00000009,
  125. WGPUBlendFactor_OneMinusDstAlpha = 0x0000000A,
  126. WGPUBlendFactor_SrcAlphaSaturated = 0x0000000B,
  127. WGPUBlendFactor_Constant = 0x0000000C,
  128. WGPUBlendFactor_OneMinusConstant = 0x0000000D,
  129. WGPUBlendFactor_Src1 = 0x0000000E,
  130. WGPUBlendFactor_OneMinusSrc1 = 0x0000000F,
  131. WGPUBlendFactor_Src1Alpha = 0x00000010,
  132. WGPUBlendFactor_OneMinusSrc1Alpha = 0x00000011,
  133. WGPUBlendFactor_Force32 = 0x7FFFFFFF
  134. } WGPUBlendFactor;
  135. typedef enum WGPUBlendOperation {
  136. WGPUBlendOperation_Undefined = 0x00000000,
  137. WGPUBlendOperation_Add = 0x00000001,
  138. WGPUBlendOperation_Subtract = 0x00000002,
  139. WGPUBlendOperation_ReverseSubtract = 0x00000003,
  140. WGPUBlendOperation_Min = 0x00000004,
  141. WGPUBlendOperation_Max = 0x00000005,
  142. WGPUBlendOperation_Force32 = 0x7FFFFFFF
  143. } WGPUBlendOperation;
  144. typedef enum WGPUBufferBindingType {
  145. WGPUBufferBindingType_BindingNotUsed = 0x00000000,
  146. WGPUBufferBindingType_Undefined = 0x00000001,
  147. WGPUBufferBindingType_Uniform = 0x00000002,
  148. WGPUBufferBindingType_Storage = 0x00000003,
  149. WGPUBufferBindingType_ReadOnlyStorage = 0x00000004,
  150. WGPUBufferBindingType_Force32 = 0x7FFFFFFF
  151. } WGPUBufferBindingType;
  152. typedef enum WGPUCallbackMode {
  153. WGPUCallbackMode_WaitAnyOnly = 0x00000001,
  154. WGPUCallbackMode_AllowProcessEvents = 0x00000002,
  155. WGPUCallbackMode_AllowSpontaneous = 0x00000003,
  156. WGPUCallbackMode_Force32 = 0x7FFFFFFF
  157. } WGPUCallbackMode;
  158. typedef enum WGPUCompareFunction {
  159. WGPUCompareFunction_Undefined = 0x00000000,
  160. WGPUCompareFunction_Never = 0x00000001,
  161. WGPUCompareFunction_Less = 0x00000002,
  162. WGPUCompareFunction_Equal = 0x00000003,
  163. WGPUCompareFunction_LessEqual = 0x00000004,
  164. WGPUCompareFunction_Greater = 0x00000005,
  165. WGPUCompareFunction_NotEqual = 0x00000006,
  166. WGPUCompareFunction_GreaterEqual = 0x00000007,
  167. WGPUCompareFunction_Always = 0x00000008,
  168. WGPUCompareFunction_Force32 = 0x7FFFFFFF
  169. } WGPUCompareFunction;
  170. typedef enum WGPUCompositeAlphaMode {
  171. WGPUCompositeAlphaMode_Auto = 0x00000000,
  172. WGPUCompositeAlphaMode_Opaque = 0x00000001,
  173. WGPUCompositeAlphaMode_Premultiplied = 0x00000002,
  174. WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003,
  175. WGPUCompositeAlphaMode_Inherit = 0x00000004,
  176. WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF
  177. } WGPUCompositeAlphaMode;
  178. typedef enum WGPUCullMode {
  179. WGPUCullMode_Undefined = 0x00000000,
  180. WGPUCullMode_None = 0x00000001,
  181. WGPUCullMode_Front = 0x00000002,
  182. WGPUCullMode_Back = 0x00000003,
  183. WGPUCullMode_Force32 = 0x7FFFFFFF
  184. } WGPUCullMode;
  185. typedef enum WGPUDeviceLostReason {
  186. WGPUDeviceLostReason_Unknown = 0x00000001,
  187. WGPUDeviceLostReason_Destroyed = 0x00000002,
  188. WGPUDeviceLostReason_CallbackCancelled = 0x00000003,
  189. WGPUDeviceLostReason_FailedCreation = 0x00000004,
  190. WGPUDeviceLostReason_Force32 = 0x7FFFFFFF
  191. } WGPUDeviceLostReason;
  192. typedef enum WGPUErrorType {
  193. WGPUErrorType_NoError = 0x00000001,
  194. WGPUErrorType_Validation = 0x00000002,
  195. WGPUErrorType_OutOfMemory = 0x00000003,
  196. WGPUErrorType_Internal = 0x00000004,
  197. WGPUErrorType_Unknown = 0x00000005,
  198. WGPUErrorType_Force32 = 0x7FFFFFFF
  199. } WGPUErrorType;
  200. typedef enum WGPUFeatureLevel {
  201. WGPUFeatureLevel_Undefined = 0x00000000,
  202. WGPUFeatureLevel_Compatibility = 0x00000001,
  203. WGPUFeatureLevel_Core = 0x00000002,
  204. WGPUFeatureLevel_Force32 = 0x7FFFFFFF
  205. } WGPUFeatureLevel;
  206. typedef enum WGPUFeatureName {
  207. WGPUFeatureName_CoreFeaturesAndLimits = 0x00000001,
  208. WGPUFeatureName_DepthClipControl = 0x00000002,
  209. WGPUFeatureName_Depth32FloatStencil8 = 0x00000003,
  210. WGPUFeatureName_TextureCompressionBC = 0x00000004,
  211. WGPUFeatureName_TextureCompressionBCSliced3D = 0x00000005,
  212. WGPUFeatureName_TextureCompressionETC2 = 0x00000006,
  213. WGPUFeatureName_TextureCompressionASTC = 0x00000007,
  214. WGPUFeatureName_TextureCompressionASTCSliced3D = 0x00000008,
  215. WGPUFeatureName_TimestampQuery = 0x00000009,
  216. WGPUFeatureName_IndirectFirstInstance = 0x0000000A,
  217. WGPUFeatureName_ShaderF16 = 0x0000000B,
  218. WGPUFeatureName_RG11B10UfloatRenderable = 0x0000000C,
  219. WGPUFeatureName_BGRA8UnormStorage = 0x0000000D,
  220. WGPUFeatureName_Float32Filterable = 0x0000000E,
  221. WGPUFeatureName_Float32Blendable = 0x0000000F,
  222. WGPUFeatureName_ClipDistances = 0x00000010,
  223. WGPUFeatureName_DualSourceBlending = 0x00000011,
  224. WGPUFeatureName_Subgroups = 0x00000012,
  225. WGPUFeatureName_TextureFormatsTier1 = 0x00000013,
  226. WGPUFeatureName_TextureFormatsTier2 = 0x00000014,
  227. WGPUFeatureName_PrimitiveIndex = 0x00000015,
  228. WGPUFeatureName_TextureComponentSwizzle = 0x00000016,
  229. WGPUFeatureName_Force32 = 0x7FFFFFFF
  230. } WGPUFeatureName;
  231. typedef enum WGPUFilterMode {
  232. WGPUFilterMode_Undefined = 0x00000000,
  233. WGPUFilterMode_Nearest = 0x00000001,
  234. WGPUFilterMode_Linear = 0x00000002,
  235. WGPUFilterMode_Force32 = 0x7FFFFFFF
  236. } WGPUFilterMode;
  237. typedef enum WGPUFrontFace {
  238. WGPUFrontFace_Undefined = 0x00000000,
  239. WGPUFrontFace_CCW = 0x00000001,
  240. WGPUFrontFace_CW = 0x00000002,
  241. WGPUFrontFace_Force32 = 0x7FFFFFFF
  242. } WGPUFrontFace;
  243. typedef enum WGPUIndexFormat {
  244. WGPUIndexFormat_Undefined = 0x00000000,
  245. WGPUIndexFormat_Uint16 = 0x00000001,
  246. WGPUIndexFormat_Uint32 = 0x00000002,
  247. WGPUIndexFormat_Force32 = 0x7FFFFFFF
  248. } WGPUIndexFormat;
  249. typedef enum WGPUInstanceFeatureName {
  250. WGPUInstanceFeatureName_TimedWaitAny = 0x00000001,
  251. WGPUInstanceFeatureName_ShaderSourceSPIRV = 0x00000002,
  252. WGPUInstanceFeatureName_MultipleDevicesPerAdapter = 0x00000003,
  253. WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF
  254. } WGPUInstanceFeatureName;
  255. typedef enum WGPULoadOp {
  256. WGPULoadOp_Undefined = 0x00000000,
  257. WGPULoadOp_Load = 0x00000001,
  258. WGPULoadOp_Clear = 0x00000002,
  259. WGPULoadOp_Force32 = 0x7FFFFFFF
  260. } WGPULoadOp;
  261. typedef enum WGPUMipmapFilterMode {
  262. WGPUMipmapFilterMode_Undefined = 0x00000000,
  263. WGPUMipmapFilterMode_Nearest = 0x00000001,
  264. WGPUMipmapFilterMode_Linear = 0x00000002,
  265. WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF
  266. } WGPUMipmapFilterMode;
  267. typedef enum WGPUOptionalBool {
  268. WGPUOptionalBool_False = 0x00000000,
  269. WGPUOptionalBool_True = 0x00000001,
  270. WGPUOptionalBool_Undefined = 0x00000002,
  271. WGPUOptionalBool_Force32 = 0x7FFFFFFF
  272. } WGPUOptionalBool;
  273. typedef enum WGPUPowerPreference {
  274. WGPUPowerPreference_Undefined = 0x00000000,
  275. WGPUPowerPreference_LowPower = 0x00000001,
  276. WGPUPowerPreference_HighPerformance = 0x00000002,
  277. WGPUPowerPreference_Force32 = 0x7FFFFFFF
  278. } WGPUPowerPreference;
  279. typedef enum WGPUPresentMode {
  280. WGPUPresentMode_Undefined = 0x00000000,
  281. WGPUPresentMode_Fifo = 0x00000001,
  282. WGPUPresentMode_FifoRelaxed = 0x00000002,
  283. WGPUPresentMode_Immediate = 0x00000003,
  284. WGPUPresentMode_Mailbox = 0x00000004,
  285. WGPUPresentMode_Force32 = 0x7FFFFFFF
  286. } WGPUPresentMode;
  287. typedef enum WGPUPrimitiveTopology {
  288. WGPUPrimitiveTopology_Undefined = 0x00000000,
  289. WGPUPrimitiveTopology_PointList = 0x00000001,
  290. WGPUPrimitiveTopology_LineList = 0x00000002,
  291. WGPUPrimitiveTopology_LineStrip = 0x00000003,
  292. WGPUPrimitiveTopology_TriangleList = 0x00000004,
  293. WGPUPrimitiveTopology_TriangleStrip = 0x00000005,
  294. WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF
  295. } WGPUPrimitiveTopology;
  296. typedef enum WGPUQueueWorkDoneStatus {
  297. WGPUQueueWorkDoneStatus_Success = 0x00000001,
  298. WGPUQueueWorkDoneStatus_CallbackCancelled = 0x00000002,
  299. WGPUQueueWorkDoneStatus_Error = 0x00000003,
  300. WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF
  301. } WGPUQueueWorkDoneStatus;
  302. typedef enum WGPURequestAdapterStatus {
  303. WGPURequestAdapterStatus_Success = 0x00000001,
  304. WGPURequestAdapterStatus_CallbackCancelled = 0x00000002,
  305. WGPURequestAdapterStatus_Unavailable = 0x00000003,
  306. WGPURequestAdapterStatus_Error = 0x00000004,
  307. WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF
  308. } WGPURequestAdapterStatus;
  309. typedef enum WGPURequestDeviceStatus {
  310. WGPURequestDeviceStatus_Success = 0x00000001,
  311. WGPURequestDeviceStatus_CallbackCancelled = 0x00000002,
  312. WGPURequestDeviceStatus_Error = 0x00000003,
  313. WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF
  314. } WGPURequestDeviceStatus;
  315. typedef enum WGPUSamplerBindingType {
  316. WGPUSamplerBindingType_BindingNotUsed = 0x00000000,
  317. WGPUSamplerBindingType_Undefined = 0x00000001,
  318. WGPUSamplerBindingType_Filtering = 0x00000002,
  319. WGPUSamplerBindingType_NonFiltering = 0x00000003,
  320. WGPUSamplerBindingType_Comparison = 0x00000004,
  321. WGPUSamplerBindingType_Force32 = 0x7FFFFFFF
  322. } WGPUSamplerBindingType;
  323. typedef enum WGPUStatus {
  324. WGPUStatus_Success = 0x00000001,
  325. WGPUStatus_Error = 0x00000002,
  326. WGPUStatus_Force32 = 0x7FFFFFFF
  327. } WGPUStatus;
  328. typedef enum WGPUStencilOperation {
  329. WGPUStencilOperation_Undefined = 0x00000000,
  330. WGPUStencilOperation_Keep = 0x00000001,
  331. WGPUStencilOperation_Zero = 0x00000002,
  332. WGPUStencilOperation_Replace = 0x00000003,
  333. WGPUStencilOperation_Invert = 0x00000004,
  334. WGPUStencilOperation_IncrementClamp = 0x00000005,
  335. WGPUStencilOperation_DecrementClamp = 0x00000006,
  336. WGPUStencilOperation_IncrementWrap = 0x00000007,
  337. WGPUStencilOperation_DecrementWrap = 0x00000008,
  338. WGPUStencilOperation_Force32 = 0x7FFFFFFF
  339. } WGPUStencilOperation;
  340. typedef enum WGPUStorageTextureAccess {
  341. WGPUStorageTextureAccess_BindingNotUsed = 0x00000000,
  342. WGPUStorageTextureAccess_Undefined = 0x00000001,
  343. WGPUStorageTextureAccess_WriteOnly = 0x00000002,
  344. WGPUStorageTextureAccess_ReadOnly = 0x00000003,
  345. WGPUStorageTextureAccess_ReadWrite = 0x00000004,
  346. WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF
  347. } WGPUStorageTextureAccess;
  348. typedef enum WGPUStoreOp {
  349. WGPUStoreOp_Undefined = 0x00000000,
  350. WGPUStoreOp_Store = 0x00000001,
  351. WGPUStoreOp_Discard = 0x00000002,
  352. WGPUStoreOp_Force32 = 0x7FFFFFFF
  353. } WGPUStoreOp;
  354. typedef enum WGPUSType {
  355. WGPUSType_ShaderSourceSPIRV = 0x00000001,
  356. WGPUSType_ShaderSourceWGSL = 0x00000002,
  357. WGPUSType_RenderPassMaxDrawCount = 0x00000003,
  358. WGPUSType_SurfaceSourceMetalLayer = 0x00000004,
  359. WGPUSType_SurfaceSourceWindowsHWND = 0x00000005,
  360. WGPUSType_SurfaceSourceXlibWindow = 0x00000006,
  361. WGPUSType_SurfaceSourceWaylandSurface = 0x00000007,
  362. WGPUSType_SurfaceSourceAndroidNativeWindow = 0x00000008,
  363. WGPUSType_SurfaceSourceXCBWindow = 0x00000009,
  364. WGPUSType_SurfaceColorManagement = 0x0000000A,
  365. WGPUSType_RequestAdapterWebXROptions = 0x0000000B,
  366. WGPUSType_Force32 = 0x7FFFFFFF
  367. } WGPUSType;
  368. typedef enum WGPUSurfaceGetCurrentTextureStatus {
  369. WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal = 0x00000001,
  370. WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal = 0x00000002,
  371. WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000003,
  372. WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000004,
  373. WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000005,
  374. WGPUSurfaceGetCurrentTextureStatus_Error = 0x00000006,
  375. WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF
  376. } WGPUSurfaceGetCurrentTextureStatus;
  377. typedef enum WGPUTextureAspect {
  378. WGPUTextureAspect_Undefined = 0x00000000,
  379. WGPUTextureAspect_All = 0x00000001,
  380. WGPUTextureAspect_StencilOnly = 0x00000002,
  381. WGPUTextureAspect_DepthOnly = 0x00000003,
  382. WGPUTextureAspect_Force32 = 0x7FFFFFFF
  383. } WGPUTextureAspect;
  384. typedef enum WGPUTextureDimension {
  385. WGPUTextureDimension_Undefined = 0x00000000,
  386. WGPUTextureDimension_1D = 0x00000001,
  387. WGPUTextureDimension_2D = 0x00000002,
  388. WGPUTextureDimension_3D = 0x00000003,
  389. WGPUTextureDimension_Force32 = 0x7FFFFFFF
  390. } WGPUTextureDimension;
  391. typedef enum WGPUTextureFormat {
  392. WGPUTextureFormat_Undefined = 0x00000000,
  393. WGPUTextureFormat_R8Unorm = 0x00000001,
  394. WGPUTextureFormat_R8Snorm = 0x00000002,
  395. WGPUTextureFormat_R8Uint = 0x00000003,
  396. WGPUTextureFormat_R8Sint = 0x00000004,
  397. WGPUTextureFormat_R16Unorm = 0x00000005,
  398. WGPUTextureFormat_R16Snorm = 0x00000006,
  399. WGPUTextureFormat_R16Uint = 0x00000007,
  400. WGPUTextureFormat_R16Sint = 0x00000008,
  401. WGPUTextureFormat_R16Float = 0x00000009,
  402. WGPUTextureFormat_RG8Unorm = 0x0000000A,
  403. WGPUTextureFormat_RG8Snorm = 0x0000000B,
  404. WGPUTextureFormat_RG8Uint = 0x0000000C,
  405. WGPUTextureFormat_RG8Sint = 0x0000000D,
  406. WGPUTextureFormat_R32Float = 0x0000000E,
  407. WGPUTextureFormat_R32Uint = 0x0000000F,
  408. WGPUTextureFormat_R32Sint = 0x00000010,
  409. WGPUTextureFormat_RG16Unorm = 0x00000011,
  410. WGPUTextureFormat_RG16Snorm = 0x00000012,
  411. WGPUTextureFormat_RG16Uint = 0x00000013,
  412. WGPUTextureFormat_RG16Sint = 0x00000014,
  413. WGPUTextureFormat_RG16Float = 0x00000015,
  414. WGPUTextureFormat_RGBA8Unorm = 0x00000016,
  415. WGPUTextureFormat_RGBA8UnormSrgb = 0x00000017,
  416. WGPUTextureFormat_RGBA8Snorm = 0x00000018,
  417. WGPUTextureFormat_RGBA8Uint = 0x00000019,
  418. WGPUTextureFormat_RGBA8Sint = 0x0000001A,
  419. WGPUTextureFormat_BGRA8Unorm = 0x0000001B,
  420. WGPUTextureFormat_BGRA8UnormSrgb = 0x0000001C,
  421. WGPUTextureFormat_RGB10A2Uint = 0x0000001D,
  422. WGPUTextureFormat_RGB10A2Unorm = 0x0000001E,
  423. WGPUTextureFormat_RG11B10Ufloat = 0x0000001F,
  424. WGPUTextureFormat_RGB9E5Ufloat = 0x00000020,
  425. WGPUTextureFormat_RG32Float = 0x00000021,
  426. WGPUTextureFormat_RG32Uint = 0x00000022,
  427. WGPUTextureFormat_RG32Sint = 0x00000023,
  428. WGPUTextureFormat_RGBA16Unorm = 0x00000024,
  429. WGPUTextureFormat_RGBA16Snorm = 0x00000025,
  430. WGPUTextureFormat_RGBA16Uint = 0x00000026,
  431. WGPUTextureFormat_RGBA16Sint = 0x00000027,
  432. WGPUTextureFormat_RGBA16Float = 0x00000028,
  433. WGPUTextureFormat_RGBA32Float = 0x00000029,
  434. WGPUTextureFormat_RGBA32Uint = 0x0000002A,
  435. WGPUTextureFormat_RGBA32Sint = 0x0000002B,
  436. WGPUTextureFormat_Stencil8 = 0x0000002C,
  437. WGPUTextureFormat_Depth16Unorm = 0x0000002D,
  438. WGPUTextureFormat_Depth24Plus = 0x0000002E,
  439. WGPUTextureFormat_Depth24PlusStencil8 = 0x0000002F,
  440. WGPUTextureFormat_Depth32Float = 0x00000030,
  441. WGPUTextureFormat_Depth32FloatStencil8 = 0x00000031,
  442. WGPUTextureFormat_BC1RGBAUnorm = 0x00000032,
  443. WGPUTextureFormat_BC1RGBAUnormSrgb = 0x00000033,
  444. WGPUTextureFormat_BC2RGBAUnorm = 0x00000034,
  445. WGPUTextureFormat_BC2RGBAUnormSrgb = 0x00000035,
  446. WGPUTextureFormat_BC3RGBAUnorm = 0x00000036,
  447. WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000037,
  448. WGPUTextureFormat_BC4RUnorm = 0x00000038,
  449. WGPUTextureFormat_BC4RSnorm = 0x00000039,
  450. WGPUTextureFormat_BC5RGUnorm = 0x0000003A,
  451. WGPUTextureFormat_BC5RGSnorm = 0x0000003B,
  452. WGPUTextureFormat_BC6HRGBUfloat = 0x0000003C,
  453. WGPUTextureFormat_BC6HRGBFloat = 0x0000003D,
  454. WGPUTextureFormat_BC7RGBAUnorm = 0x0000003E,
  455. WGPUTextureFormat_BC7RGBAUnormSrgb = 0x0000003F,
  456. WGPUTextureFormat_ETC2RGB8Unorm = 0x00000040,
  457. WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x00000041,
  458. WGPUTextureFormat_ETC2RGB8A1Unorm = 0x00000042,
  459. WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x00000043,
  460. WGPUTextureFormat_ETC2RGBA8Unorm = 0x00000044,
  461. WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x00000045,
  462. WGPUTextureFormat_EACR11Unorm = 0x00000046,
  463. WGPUTextureFormat_EACR11Snorm = 0x00000047,
  464. WGPUTextureFormat_EACRG11Unorm = 0x00000048,
  465. WGPUTextureFormat_EACRG11Snorm = 0x00000049,
  466. WGPUTextureFormat_ASTC4x4Unorm = 0x0000004A,
  467. WGPUTextureFormat_ASTC4x4UnormSrgb = 0x0000004B,
  468. WGPUTextureFormat_ASTC5x4Unorm = 0x0000004C,
  469. WGPUTextureFormat_ASTC5x4UnormSrgb = 0x0000004D,
  470. WGPUTextureFormat_ASTC5x5Unorm = 0x0000004E,
  471. WGPUTextureFormat_ASTC5x5UnormSrgb = 0x0000004F,
  472. WGPUTextureFormat_ASTC6x5Unorm = 0x00000050,
  473. WGPUTextureFormat_ASTC6x5UnormSrgb = 0x00000051,
  474. WGPUTextureFormat_ASTC6x6Unorm = 0x00000052,
  475. WGPUTextureFormat_ASTC6x6UnormSrgb = 0x00000053,
  476. WGPUTextureFormat_ASTC8x5Unorm = 0x00000054,
  477. WGPUTextureFormat_ASTC8x5UnormSrgb = 0x00000055,
  478. WGPUTextureFormat_ASTC8x6Unorm = 0x00000056,
  479. WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000057,
  480. WGPUTextureFormat_ASTC8x8Unorm = 0x00000058,
  481. WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000059,
  482. WGPUTextureFormat_ASTC10x5Unorm = 0x0000005A,
  483. WGPUTextureFormat_ASTC10x5UnormSrgb = 0x0000005B,
  484. WGPUTextureFormat_ASTC10x6Unorm = 0x0000005C,
  485. WGPUTextureFormat_ASTC10x6UnormSrgb = 0x0000005D,
  486. WGPUTextureFormat_ASTC10x8Unorm = 0x0000005E,
  487. WGPUTextureFormat_ASTC10x8UnormSrgb = 0x0000005F,
  488. WGPUTextureFormat_ASTC10x10Unorm = 0x00000060,
  489. WGPUTextureFormat_ASTC10x10UnormSrgb = 0x00000061,
  490. WGPUTextureFormat_ASTC12x10Unorm = 0x00000062,
  491. WGPUTextureFormat_ASTC12x10UnormSrgb = 0x00000063,
  492. WGPUTextureFormat_ASTC12x12Unorm = 0x00000064,
  493. WGPUTextureFormat_ASTC12x12UnormSrgb = 0x00000065,
  494. WGPUTextureFormat_Force32 = 0x7FFFFFFF
  495. } WGPUTextureFormat;
  496. typedef enum WGPUTextureSampleType {
  497. WGPUTextureSampleType_BindingNotUsed = 0x00000000,
  498. WGPUTextureSampleType_Undefined = 0x00000001,
  499. WGPUTextureSampleType_Float = 0x00000002,
  500. WGPUTextureSampleType_UnfilterableFloat = 0x00000003,
  501. WGPUTextureSampleType_Depth = 0x00000004,
  502. WGPUTextureSampleType_Sint = 0x00000005,
  503. WGPUTextureSampleType_Uint = 0x00000006,
  504. WGPUTextureSampleType_Force32 = 0x7FFFFFFF
  505. } WGPUTextureSampleType;
  506. typedef enum WGPUTextureViewDimension {
  507. WGPUTextureViewDimension_Undefined = 0x00000000,
  508. WGPUTextureViewDimension_1D = 0x00000001,
  509. WGPUTextureViewDimension_2D = 0x00000002,
  510. WGPUTextureViewDimension_2DArray = 0x00000003,
  511. WGPUTextureViewDimension_Cube = 0x00000004,
  512. WGPUTextureViewDimension_CubeArray = 0x00000005,
  513. WGPUTextureViewDimension_3D = 0x00000006,
  514. WGPUTextureViewDimension_Force32 = 0x7FFFFFFF
  515. } WGPUTextureViewDimension;
  516. typedef enum WGPUVertexFormat {
  517. WGPUVertexFormat_Uint8 = 0x00000001,
  518. WGPUVertexFormat_Uint8x2 = 0x00000002,
  519. WGPUVertexFormat_Uint8x4 = 0x00000003,
  520. WGPUVertexFormat_Sint8 = 0x00000004,
  521. WGPUVertexFormat_Sint8x2 = 0x00000005,
  522. WGPUVertexFormat_Sint8x4 = 0x00000006,
  523. WGPUVertexFormat_Unorm8 = 0x00000007,
  524. WGPUVertexFormat_Unorm8x2 = 0x00000008,
  525. WGPUVertexFormat_Unorm8x4 = 0x00000009,
  526. WGPUVertexFormat_Snorm8 = 0x0000000A,
  527. WGPUVertexFormat_Snorm8x2 = 0x0000000B,
  528. WGPUVertexFormat_Snorm8x4 = 0x0000000C,
  529. WGPUVertexFormat_Uint16 = 0x0000000D,
  530. WGPUVertexFormat_Uint16x2 = 0x0000000E,
  531. WGPUVertexFormat_Uint16x4 = 0x0000000F,
  532. WGPUVertexFormat_Sint16 = 0x00000010,
  533. WGPUVertexFormat_Sint16x2 = 0x00000011,
  534. WGPUVertexFormat_Sint16x4 = 0x00000012,
  535. WGPUVertexFormat_Unorm16 = 0x00000013,
  536. WGPUVertexFormat_Unorm16x2 = 0x00000014,
  537. WGPUVertexFormat_Unorm16x4 = 0x00000015,
  538. WGPUVertexFormat_Snorm16 = 0x00000016,
  539. WGPUVertexFormat_Snorm16x2 = 0x00000017,
  540. WGPUVertexFormat_Snorm16x4 = 0x00000018,
  541. WGPUVertexFormat_Float16 = 0x00000019,
  542. WGPUVertexFormat_Float16x2 = 0x0000001A,
  543. WGPUVertexFormat_Float16x4 = 0x0000001B,
  544. WGPUVertexFormat_Float32 = 0x0000001C,
  545. WGPUVertexFormat_Float32x2 = 0x0000001D,
  546. WGPUVertexFormat_Float32x3 = 0x0000001E,
  547. WGPUVertexFormat_Float32x4 = 0x0000001F,
  548. WGPUVertexFormat_Uint32 = 0x00000020,
  549. WGPUVertexFormat_Uint32x2 = 0x00000021,
  550. WGPUVertexFormat_Uint32x3 = 0x00000022,
  551. WGPUVertexFormat_Uint32x4 = 0x00000023,
  552. WGPUVertexFormat_Sint32 = 0x00000024,
  553. WGPUVertexFormat_Sint32x2 = 0x00000025,
  554. WGPUVertexFormat_Sint32x3 = 0x00000026,
  555. WGPUVertexFormat_Sint32x4 = 0x00000027,
  556. WGPUVertexFormat_Unorm10_10_10_2 = 0x00000028,
  557. WGPUVertexFormat_Unorm8x4BGRA = 0x00000029,
  558. WGPUVertexFormat_Force32 = 0x7FFFFFFF
  559. } WGPUVertexFormat;
  560. typedef enum WGPUVertexStepMode {
  561. WGPUVertexStepMode_Undefined = 0x00000000,
  562. WGPUVertexStepMode_Vertex = 0x00000001,
  563. WGPUVertexStepMode_Instance = 0x00000002,
  564. WGPUVertexStepMode_Force32 = 0x7FFFFFFF
  565. } WGPUVertexStepMode;
  566. typedef WGPUFlags WGPUBufferUsage;
  567. static const WGPUBufferUsage WGPUBufferUsage_None = 0x0000000000000000;
  568. static const WGPUBufferUsage WGPUBufferUsage_MapRead = 0x0000000000000001;
  569. static const WGPUBufferUsage WGPUBufferUsage_MapWrite = 0x0000000000000002;
  570. static const WGPUBufferUsage WGPUBufferUsage_CopySrc = 0x0000000000000004;
  571. static const WGPUBufferUsage WGPUBufferUsage_CopyDst = 0x0000000000000008;
  572. static const WGPUBufferUsage WGPUBufferUsage_Index = 0x0000000000000010;
  573. static const WGPUBufferUsage WGPUBufferUsage_Vertex = 0x0000000000000020;
  574. static const WGPUBufferUsage WGPUBufferUsage_Uniform = 0x0000000000000040;
  575. static const WGPUBufferUsage WGPUBufferUsage_Storage = 0x0000000000000080;
  576. static const WGPUBufferUsage WGPUBufferUsage_Indirect = 0x0000000000000100;
  577. static const WGPUBufferUsage WGPUBufferUsage_QueryResolve = 0x0000000000000200;
  578. typedef WGPUFlags WGPUColorWriteMask;
  579. static const WGPUColorWriteMask WGPUColorWriteMask_None = 0x0000000000000000;
  580. static const WGPUColorWriteMask WGPUColorWriteMask_Red = 0x0000000000000001;
  581. static const WGPUColorWriteMask WGPUColorWriteMask_Green = 0x0000000000000002;
  582. static const WGPUColorWriteMask WGPUColorWriteMask_Blue = 0x0000000000000004;
  583. static const WGPUColorWriteMask WGPUColorWriteMask_Alpha = 0x0000000000000008;
  584. static const WGPUColorWriteMask WGPUColorWriteMask_All = 0x000000000000000F;
  585. typedef WGPUFlags WGPUMapMode;
  586. static const WGPUMapMode WGPUMapMode_None = 0x0000000000000000;
  587. static const WGPUMapMode WGPUMapMode_Read = 0x0000000000000001;
  588. static const WGPUMapMode WGPUMapMode_Write = 0x0000000000000002;
  589. typedef WGPUFlags WGPUShaderStage;
  590. static const WGPUShaderStage WGPUShaderStage_None = 0x0000000000000000;
  591. static const WGPUShaderStage WGPUShaderStage_Vertex = 0x0000000000000001;
  592. static const WGPUShaderStage WGPUShaderStage_Fragment = 0x0000000000000002;
  593. static const WGPUShaderStage WGPUShaderStage_Compute = 0x0000000000000004;
  594. typedef WGPUFlags WGPUTextureUsage;
  595. static const WGPUTextureUsage WGPUTextureUsage_None = 0x0000000000000000;
  596. static const WGPUTextureUsage WGPUTextureUsage_CopySrc = 0x0000000000000001;
  597. static const WGPUTextureUsage WGPUTextureUsage_CopyDst = 0x0000000000000002;
  598. static const WGPUTextureUsage WGPUTextureUsage_TextureBinding = 0x0000000000000004;
  599. static const WGPUTextureUsage WGPUTextureUsage_StorageBinding = 0x0000000000000008;
  600. static const WGPUTextureUsage WGPUTextureUsage_RenderAttachment = 0x0000000000000010;
  601. typedef void (*WGPUDeviceLostCallback)(WGPUDevice const * device, WGPUDeviceLostReason reason, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2);
  602. typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2);
  603. typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2);
  604. typedef void (*WGPUUncapturedErrorCallback)(WGPUDevice const * device, WGPUErrorType type, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2);
  605. typedef struct WGPUChainedStruct {
  606. struct WGPUChainedStruct * next;
  607. WGPUSType sType;
  608. } WGPUChainedStruct;
  609. typedef struct WGPUDeviceLostCallbackInfo {
  610. WGPUChainedStruct * nextInChain;
  611. WGPUCallbackMode mode;
  612. WGPUDeviceLostCallback callback;
  613. WGPU_NULLABLE void* userdata1;
  614. WGPU_NULLABLE void* userdata2;
  615. } WGPUDeviceLostCallbackInfo;
  616. typedef struct WGPURequestAdapterCallbackInfo {
  617. WGPUChainedStruct * nextInChain;
  618. WGPUCallbackMode mode;
  619. WGPURequestAdapterCallback callback;
  620. WGPU_NULLABLE void* userdata1;
  621. WGPU_NULLABLE void* userdata2;
  622. } WGPURequestAdapterCallbackInfo;
  623. typedef struct WGPURequestDeviceCallbackInfo {
  624. WGPUChainedStruct * nextInChain;
  625. WGPUCallbackMode mode;
  626. WGPURequestDeviceCallback callback;
  627. WGPU_NULLABLE void* userdata1;
  628. WGPU_NULLABLE void* userdata2;
  629. } WGPURequestDeviceCallbackInfo;
  630. typedef struct WGPUUncapturedErrorCallbackInfo {
  631. WGPUChainedStruct * nextInChain;
  632. WGPUUncapturedErrorCallback callback;
  633. WGPU_NULLABLE void* userdata1;
  634. WGPU_NULLABLE void* userdata2;
  635. } WGPUUncapturedErrorCallbackInfo;
  636. typedef struct WGPUAdapterInfo {
  637. WGPUChainedStruct * nextInChain;
  638. WGPUStringView vendor;
  639. WGPUStringView architecture;
  640. WGPUStringView device;
  641. WGPUStringView description;
  642. WGPUBackendType backendType;
  643. WGPUAdapterType adapterType;
  644. uint32_t vendorID;
  645. uint32_t deviceID;
  646. uint32_t subgroupMinSize;
  647. uint32_t subgroupMaxSize;
  648. } WGPUAdapterInfo;
  649. typedef struct WGPUBindGroupEntry {
  650. WGPUChainedStruct * nextInChain;
  651. uint32_t binding;
  652. WGPU_NULLABLE WGPUBuffer buffer;
  653. uint64_t offset;
  654. uint64_t size;
  655. WGPU_NULLABLE WGPUSampler sampler;
  656. WGPU_NULLABLE WGPUTextureView textureView;
  657. } WGPUBindGroupEntry;
  658. typedef struct WGPUBlendComponent {
  659. WGPUBlendOperation operation;
  660. WGPUBlendFactor srcFactor;
  661. WGPUBlendFactor dstFactor;
  662. } WGPUBlendComponent;
  663. typedef struct WGPUBufferBindingLayout {
  664. WGPUChainedStruct * nextInChain;
  665. WGPUBufferBindingType type;
  666. WGPUBool hasDynamicOffset;
  667. uint64_t minBindingSize;
  668. } WGPUBufferBindingLayout;
  669. typedef struct WGPUBufferDescriptor {
  670. WGPUChainedStruct * nextInChain;
  671. WGPUStringView label;
  672. WGPUBufferUsage usage;
  673. uint64_t size;
  674. WGPUBool mappedAtCreation;
  675. } WGPUBufferDescriptor;
  676. typedef struct WGPUColor {
  677. double r;
  678. double g;
  679. double b;
  680. double a;
  681. } WGPUColor;
  682. typedef struct WGPUCommandBufferDescriptor {
  683. WGPUChainedStruct * nextInChain;
  684. WGPUStringView label;
  685. } WGPUCommandBufferDescriptor;
  686. typedef struct WGPUCommandEncoderDescriptor {
  687. WGPUChainedStruct * nextInChain;
  688. WGPUStringView label;
  689. } WGPUCommandEncoderDescriptor;
  690. typedef struct WGPUConstantEntry {
  691. WGPUChainedStruct * nextInChain;
  692. WGPUStringView key;
  693. double value;
  694. } WGPUConstantEntry;
  695. typedef struct WGPUExtent3D {
  696. uint32_t width;
  697. uint32_t height;
  698. uint32_t depthOrArrayLayers;
  699. } WGPUExtent3D;
  700. typedef struct WGPUFuture {
  701. uint64_t id;
  702. } WGPUFuture;
  703. typedef struct WGPUInstanceLimits {
  704. WGPUChainedStruct * nextInChain;
  705. size_t timedWaitAnyMaxCount;
  706. } WGPUInstanceLimits;
  707. typedef struct WGPULimits {
  708. WGPUChainedStruct * nextInChain;
  709. uint32_t maxTextureDimension1D;
  710. uint32_t maxTextureDimension2D;
  711. uint32_t maxTextureDimension3D;
  712. uint32_t maxTextureArrayLayers;
  713. uint32_t maxBindGroups;
  714. uint32_t maxBindGroupsPlusVertexBuffers;
  715. uint32_t maxBindingsPerBindGroup;
  716. uint32_t maxDynamicUniformBuffersPerPipelineLayout;
  717. uint32_t maxDynamicStorageBuffersPerPipelineLayout;
  718. uint32_t maxSampledTexturesPerShaderStage;
  719. uint32_t maxSamplersPerShaderStage;
  720. uint32_t maxStorageBuffersPerShaderStage;
  721. uint32_t maxStorageTexturesPerShaderStage;
  722. uint32_t maxUniformBuffersPerShaderStage;
  723. uint64_t maxUniformBufferBindingSize;
  724. uint64_t maxStorageBufferBindingSize;
  725. uint32_t minUniformBufferOffsetAlignment;
  726. uint32_t minStorageBufferOffsetAlignment;
  727. uint32_t maxVertexBuffers;
  728. uint64_t maxBufferSize;
  729. uint32_t maxVertexAttributes;
  730. uint32_t maxVertexBufferArrayStride;
  731. uint32_t maxInterStageShaderVariables;
  732. uint32_t maxColorAttachments;
  733. uint32_t maxColorAttachmentBytesPerSample;
  734. uint32_t maxComputeWorkgroupStorageSize;
  735. uint32_t maxComputeInvocationsPerWorkgroup;
  736. uint32_t maxComputeWorkgroupSizeX;
  737. uint32_t maxComputeWorkgroupSizeY;
  738. uint32_t maxComputeWorkgroupSizeZ;
  739. uint32_t maxComputeWorkgroupsPerDimension;
  740. uint32_t maxImmediateSize;
  741. } WGPULimits;
  742. typedef struct WGPUMultisampleState {
  743. WGPUChainedStruct * nextInChain;
  744. uint32_t count;
  745. uint32_t mask;
  746. WGPUBool alphaToCoverageEnabled;
  747. } WGPUMultisampleState;
  748. typedef struct WGPUOrigin3D {
  749. uint32_t x;
  750. uint32_t y;
  751. uint32_t z;
  752. } WGPUOrigin3D;
  753. typedef struct WGPUPassTimestampWrites {
  754. WGPUChainedStruct * nextInChain;
  755. WGPUQuerySet querySet;
  756. uint32_t beginningOfPassWriteIndex;
  757. uint32_t endOfPassWriteIndex;
  758. } WGPUPassTimestampWrites;
  759. typedef struct WGPUPipelineLayoutDescriptor {
  760. WGPUChainedStruct * nextInChain;
  761. WGPUStringView label;
  762. size_t bindGroupLayoutCount;
  763. WGPUBindGroupLayout const * bindGroupLayouts;
  764. uint32_t immediateSize;
  765. } WGPUPipelineLayoutDescriptor;
  766. typedef struct WGPUPrimitiveState {
  767. WGPUChainedStruct * nextInChain;
  768. WGPUPrimitiveTopology topology;
  769. WGPUIndexFormat stripIndexFormat;
  770. WGPUFrontFace frontFace;
  771. WGPUCullMode cullMode;
  772. WGPUBool unclippedDepth;
  773. } WGPUPrimitiveState;
  774. typedef struct WGPUQueueDescriptor {
  775. WGPUChainedStruct * nextInChain;
  776. WGPUStringView label;
  777. } WGPUQueueDescriptor;
  778. typedef struct WGPURenderPassDepthStencilAttachment {
  779. WGPUChainedStruct * nextInChain;
  780. WGPUTextureView view;
  781. WGPULoadOp depthLoadOp;
  782. WGPUStoreOp depthStoreOp;
  783. float depthClearValue;
  784. WGPUBool depthReadOnly;
  785. WGPULoadOp stencilLoadOp;
  786. WGPUStoreOp stencilStoreOp;
  787. uint32_t stencilClearValue;
  788. WGPUBool stencilReadOnly;
  789. } WGPURenderPassDepthStencilAttachment;
  790. typedef struct WGPUSamplerBindingLayout {
  791. WGPUChainedStruct * nextInChain;
  792. WGPUSamplerBindingType type;
  793. } WGPUSamplerBindingLayout;
  794. typedef struct WGPUSamplerDescriptor {
  795. WGPUChainedStruct * nextInChain;
  796. WGPUStringView label;
  797. WGPUAddressMode addressModeU;
  798. WGPUAddressMode addressModeV;
  799. WGPUAddressMode addressModeW;
  800. WGPUFilterMode magFilter;
  801. WGPUFilterMode minFilter;
  802. WGPUMipmapFilterMode mipmapFilter;
  803. float lodMinClamp;
  804. float lodMaxClamp;
  805. WGPUCompareFunction compare;
  806. uint16_t maxAnisotropy;
  807. } WGPUSamplerDescriptor;
  808. typedef struct WGPUShaderSourceWGSL {
  809. WGPUChainedStruct chain;
  810. WGPUStringView code;
  811. } WGPUShaderSourceWGSL;
  812. typedef struct WGPUStencilFaceState {
  813. WGPUCompareFunction compare;
  814. WGPUStencilOperation failOp;
  815. WGPUStencilOperation depthFailOp;
  816. WGPUStencilOperation passOp;
  817. } WGPUStencilFaceState;
  818. typedef struct WGPUStorageTextureBindingLayout {
  819. WGPUChainedStruct * nextInChain;
  820. WGPUStorageTextureAccess access;
  821. WGPUTextureFormat format;
  822. WGPUTextureViewDimension viewDimension;
  823. } WGPUStorageTextureBindingLayout;
  824. typedef struct WGPUSurfaceCapabilities {
  825. WGPUChainedStruct * nextInChain;
  826. WGPUTextureUsage usages;
  827. size_t formatCount;
  828. WGPUTextureFormat const * formats;
  829. size_t presentModeCount;
  830. WGPUPresentMode const * presentModes;
  831. size_t alphaModeCount;
  832. WGPUCompositeAlphaMode const * alphaModes;
  833. } WGPUSurfaceCapabilities;
  834. typedef struct WGPUSurfaceConfiguration {
  835. WGPUChainedStruct * nextInChain;
  836. WGPUDevice device;
  837. WGPUTextureFormat format;
  838. WGPUTextureUsage usage;
  839. uint32_t width;
  840. uint32_t height;
  841. size_t viewFormatCount;
  842. WGPUTextureFormat const * viewFormats;
  843. WGPUCompositeAlphaMode alphaMode;
  844. WGPUPresentMode presentMode;
  845. } WGPUSurfaceConfiguration;
  846. typedef struct WGPUSurfaceTexture {
  847. WGPUChainedStruct * nextInChain;
  848. WGPUTexture texture;
  849. WGPUSurfaceGetCurrentTextureStatus status;
  850. } WGPUSurfaceTexture;
  851. typedef struct WGPUTexelCopyBufferLayout {
  852. uint64_t offset;
  853. uint32_t bytesPerRow;
  854. uint32_t rowsPerImage;
  855. } WGPUTexelCopyBufferLayout;
  856. typedef struct WGPUTextureBindingLayout {
  857. WGPUChainedStruct * nextInChain;
  858. WGPUTextureSampleType sampleType;
  859. WGPUTextureViewDimension viewDimension;
  860. WGPUBool multisampled;
  861. } WGPUTextureBindingLayout;
  862. typedef struct WGPUTextureViewDescriptor {
  863. WGPUChainedStruct * nextInChain;
  864. WGPUStringView label;
  865. WGPUTextureFormat format;
  866. WGPUTextureViewDimension dimension;
  867. uint32_t baseMipLevel;
  868. uint32_t mipLevelCount;
  869. uint32_t baseArrayLayer;
  870. uint32_t arrayLayerCount;
  871. WGPUTextureAspect aspect;
  872. WGPUTextureUsage usage;
  873. } WGPUTextureViewDescriptor;
  874. typedef struct WGPUVertexAttribute {
  875. WGPUChainedStruct * nextInChain;
  876. WGPUVertexFormat format;
  877. uint64_t offset;
  878. uint32_t shaderLocation;
  879. } WGPUVertexAttribute;
  880. typedef struct WGPUBindGroupDescriptor {
  881. WGPUChainedStruct * nextInChain;
  882. WGPUStringView label;
  883. WGPUBindGroupLayout layout;
  884. size_t entryCount;
  885. WGPUBindGroupEntry const * entries;
  886. } WGPUBindGroupDescriptor;
  887. typedef struct WGPUBindGroupLayoutEntry {
  888. WGPUChainedStruct * nextInChain;
  889. uint32_t binding;
  890. WGPUShaderStage visibility;
  891. uint32_t bindingArraySize;
  892. WGPUBufferBindingLayout buffer;
  893. WGPUSamplerBindingLayout sampler;
  894. WGPUTextureBindingLayout texture;
  895. WGPUStorageTextureBindingLayout storageTexture;
  896. } WGPUBindGroupLayoutEntry;
  897. typedef struct WGPUBlendState {
  898. WGPUBlendComponent color;
  899. WGPUBlendComponent alpha;
  900. } WGPUBlendState;
  901. typedef struct WGPUDepthStencilState {
  902. WGPUChainedStruct * nextInChain;
  903. WGPUTextureFormat format;
  904. WGPUOptionalBool depthWriteEnabled;
  905. WGPUCompareFunction depthCompare;
  906. WGPUStencilFaceState stencilFront;
  907. WGPUStencilFaceState stencilBack;
  908. uint32_t stencilReadMask;
  909. uint32_t stencilWriteMask;
  910. int32_t depthBias;
  911. float depthBiasSlopeScale;
  912. float depthBiasClamp;
  913. } WGPUDepthStencilState;
  914. typedef struct WGPUDeviceDescriptor {
  915. WGPUChainedStruct * nextInChain;
  916. WGPUStringView label;
  917. size_t requiredFeatureCount;
  918. WGPUFeatureName const * requiredFeatures;
  919. WGPU_NULLABLE WGPULimits const * requiredLimits;
  920. WGPUQueueDescriptor defaultQueue;
  921. WGPUDeviceLostCallbackInfo deviceLostCallbackInfo;
  922. WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo;
  923. } WGPUDeviceDescriptor;
  924. typedef struct WGPUInstanceDescriptor {
  925. WGPUChainedStruct * nextInChain;
  926. size_t requiredFeatureCount;
  927. WGPUInstanceFeatureName const * requiredFeatures;
  928. WGPU_NULLABLE WGPUInstanceLimits const * requiredLimits;
  929. } WGPUInstanceDescriptor;
  930. typedef struct WGPURenderPassColorAttachment {
  931. WGPUChainedStruct * nextInChain;
  932. WGPU_NULLABLE WGPUTextureView view;
  933. uint32_t depthSlice;
  934. WGPU_NULLABLE WGPUTextureView resolveTarget;
  935. WGPULoadOp loadOp;
  936. WGPUStoreOp storeOp;
  937. WGPUColor clearValue;
  938. } WGPURenderPassColorAttachment;
  939. typedef struct WGPURequestAdapterOptions {
  940. WGPUChainedStruct * nextInChain;
  941. WGPUFeatureLevel featureLevel;
  942. WGPUPowerPreference powerPreference;
  943. WGPUBool forceFallbackAdapter;
  944. WGPUBackendType backendType;
  945. WGPU_NULLABLE WGPUSurface compatibleSurface;
  946. } WGPURequestAdapterOptions;
  947. typedef struct WGPUShaderModuleDescriptor {
  948. WGPUChainedStruct * nextInChain;
  949. WGPUStringView label;
  950. } WGPUShaderModuleDescriptor;
  951. typedef struct WGPUTexelCopyBufferInfo {
  952. WGPUTexelCopyBufferLayout layout;
  953. WGPUBuffer buffer;
  954. } WGPUTexelCopyBufferInfo;
  955. typedef struct WGPUTexelCopyTextureInfo {
  956. WGPUTexture texture;
  957. uint32_t mipLevel;
  958. WGPUOrigin3D origin;
  959. WGPUTextureAspect aspect;
  960. } WGPUTexelCopyTextureInfo;
  961. typedef struct WGPUTextureDescriptor {
  962. WGPUChainedStruct * nextInChain;
  963. WGPUStringView label;
  964. WGPUTextureUsage usage;
  965. WGPUTextureDimension dimension;
  966. WGPUExtent3D size;
  967. WGPUTextureFormat format;
  968. uint32_t mipLevelCount;
  969. uint32_t sampleCount;
  970. size_t viewFormatCount;
  971. WGPUTextureFormat const * viewFormats;
  972. } WGPUTextureDescriptor;
  973. typedef struct WGPUVertexBufferLayout {
  974. WGPUChainedStruct * nextInChain;
  975. WGPUVertexStepMode stepMode;
  976. uint64_t arrayStride;
  977. size_t attributeCount;
  978. WGPUVertexAttribute const * attributes;
  979. } WGPUVertexBufferLayout;
  980. typedef struct WGPUBindGroupLayoutDescriptor {
  981. WGPUChainedStruct * nextInChain;
  982. WGPUStringView label;
  983. size_t entryCount;
  984. WGPUBindGroupLayoutEntry const * entries;
  985. } WGPUBindGroupLayoutDescriptor;
  986. typedef struct WGPUColorTargetState {
  987. WGPUChainedStruct * nextInChain;
  988. WGPUTextureFormat format;
  989. WGPU_NULLABLE WGPUBlendState const * blend;
  990. WGPUColorWriteMask writeMask;
  991. } WGPUColorTargetState;
  992. typedef struct WGPURenderPassDescriptor {
  993. WGPUChainedStruct * nextInChain;
  994. WGPUStringView label;
  995. size_t colorAttachmentCount;
  996. WGPURenderPassColorAttachment const * colorAttachments;
  997. WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment;
  998. WGPU_NULLABLE WGPUQuerySet occlusionQuerySet;
  999. WGPU_NULLABLE WGPUPassTimestampWrites const * timestampWrites;
  1000. } WGPURenderPassDescriptor;
  1001. typedef struct WGPUVertexState {
  1002. WGPUChainedStruct * nextInChain;
  1003. WGPUShaderModule module;
  1004. WGPUStringView entryPoint;
  1005. size_t constantCount;
  1006. WGPUConstantEntry const * constants;
  1007. size_t bufferCount;
  1008. WGPUVertexBufferLayout const * buffers;
  1009. } WGPUVertexState;
  1010. typedef struct WGPUFragmentState {
  1011. WGPUChainedStruct * nextInChain;
  1012. WGPUShaderModule module;
  1013. WGPUStringView entryPoint;
  1014. size_t constantCount;
  1015. WGPUConstantEntry const * constants;
  1016. size_t targetCount;
  1017. WGPUColorTargetState const * targets;
  1018. } WGPUFragmentState;
  1019. typedef struct WGPURenderPipelineDescriptor {
  1020. WGPUChainedStruct * nextInChain;
  1021. WGPUStringView label;
  1022. WGPU_NULLABLE WGPUPipelineLayout layout;
  1023. WGPUVertexState vertex;
  1024. WGPUPrimitiveState primitive;
  1025. WGPU_NULLABLE WGPUDepthStencilState const * depthStencil;
  1026. WGPUMultisampleState multisample;
  1027. WGPU_NULLABLE WGPUFragmentState const * fragment;
  1028. } WGPURenderPipelineDescriptor;
  1029. #define IMPORT(str) __attribute__((import_module("imports"), import_name(str)))
  1030. IMPORT("wgpuDeviceCreateTexture") WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const *descriptor);
  1031. IMPORT("wgpuTextureCreateView") WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const *descriptor);
  1032. IMPORT("wgpuCreateInstance") WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const *descriptor);
  1033. // IMPORT("wgpuInstanceRequestAdapter") WGPUFuture wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options,
  1034. // WGPURequestAdapterCallbackInfo callbackInfo);
  1035. IMPORT("wgpuAdapterGetInfo") WGPUStatus wgpuAdapterGetInfo(WGPUAdapter adapter, WGPUAdapterInfo *info);
  1036. IMPORT("wgpuAdapterInfoFreeMembers") void wgpuAdapterInfoFreeMembers(WGPUAdapterInfo adapterInfo);
  1037. IMPORT("wgpuAdapterRequestDevice")
  1038. WGPUFuture wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const *descriptor, WGPURequestDeviceCallbackInfo callbackInfo);
  1039. IMPORT("wgpuDeviceGetQueue") WGPUQueue wgpuDeviceGetQueue(WGPUDevice device);
  1040. IMPORT("wgpuDeviceCreateBindGroupLayout")
  1041. WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const *descriptor);
  1042. IMPORT("wgpuDeviceCreateBuffer") WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const *descriptor);
  1043. IMPORT("wgpuBufferGetMappedRange") void *wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size);
  1044. IMPORT("wgpuBufferUnmap") void wgpuBufferUnmap(WGPUBuffer buffer);
  1045. IMPORT("wgpuDeviceCreateCommandEncoder")
  1046. WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const *descriptor);
  1047. IMPORT("wgpuCommandEncoderCopyBufferToTexture")
  1048. void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUTexelCopyBufferInfo const *source,
  1049. WGPUTexelCopyTextureInfo const *destination, WGPUExtent3D const *copySize);
  1050. IMPORT("wgpuCommandEncoderFinish")
  1051. WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const *descriptor);
  1052. IMPORT("wgpuQueueSubmit") void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const *commands);
  1053. IMPORT("wgpuBufferRelease") void wgpuBufferRelease(WGPUBuffer buffer);
  1054. IMPORT("wgpuDeviceCreateSampler") WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const *descriptor);
  1055. IMPORT("wgpuSurfaceGetCapabilities") WGPUStatus wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities *capabilities);
  1056. IMPORT("wgpuSurfaceCapabilitiesFreeMembers") void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities);
  1057. IMPORT("wgpuBufferDestroy") void wgpuBufferDestroy(WGPUBuffer buffer);
  1058. IMPORT("wgpuSurfaceGetCurrentTexture") void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture *surfaceTexture);
  1059. IMPORT("wgpuCommandEncoderBeginRenderPass")
  1060. WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const *descriptor);
  1061. IMPORT("wgpuRenderPassEncoderSetViewport")
  1062. void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth);
  1063. IMPORT("wgpuRenderPassEncoderSetScissorRect")
  1064. void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height);
  1065. IMPORT("wgpuRenderPassEncoderEnd") void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder);
  1066. IMPORT("wgpuRenderPassEncoderRelease") void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder);
  1067. IMPORT("wgpuCommandBufferRelease") void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer);
  1068. IMPORT("wgpuCommandEncoderRelease") void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder);
  1069. IMPORT("wgpuSurfacePresent") WGPUStatus wgpuSurfacePresent(WGPUSurface surface);
  1070. IMPORT("wgpuRenderPassEncoderDrawIndexed")
  1071. void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex,
  1072. int32_t baseVertex, uint32_t firstInstance);
  1073. IMPORT("wgpuRenderPassEncoderSetPipeline") void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline);
  1074. IMPORT("wgpuRenderPassEncoderSetVertexBuffer")
  1075. void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset,
  1076. uint64_t size);
  1077. IMPORT("wgpuRenderPassEncoderSetIndexBuffer")
  1078. void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
  1079. IMPORT("wgpuDeviceCreateBindGroup") WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const *descriptor);
  1080. IMPORT("wgpuRenderPassEncoderSetBindGroup")
  1081. void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group,
  1082. size_t dynamicOffsetCount, uint32_t const *dynamicOffsets);
  1083. IMPORT("wgpuBindGroupRelease") void wgpuBindGroupRelease(WGPUBindGroup bindGroup);
  1084. IMPORT("wgpuRenderPipelineRelease") void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline);
  1085. IMPORT("wgpuPipelineLayoutRelease") void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout);
  1086. IMPORT("wgpuDeviceCreatePipelineLayout") WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const *descriptor);
  1087. IMPORT("wgpuDeviceCreateShaderModule") WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const *descriptor);
  1088. IMPORT("wgpuDeviceCreateRenderPipeline") WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const *descriptor);
  1089. IMPORT("wgpuShaderModuleRelease") void wgpuShaderModuleRelease(WGPUShaderModule shaderModule);
  1090. IMPORT("wgpuQueueWriteBuffer") void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const *data, size_t size);
  1091. IMPORT("wgpuTextureDestroy") void wgpuTextureDestroy(WGPUTexture texture);
  1092. IMPORT("wgpuTextureRelease") void wgpuTextureRelease(WGPUTexture texture);
  1093. IMPORT("wgpuTextureViewRelease") void wgpuTextureViewRelease(WGPUTextureView textureView);
  1094. IMPORT("wgpuCommandEncoderCopyBufferToBuffer")
  1095. void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination,
  1096. uint64_t destinationOffset, uint64_t size);
  1097. IMPORT("wgpuSurfaceConfigure") void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const *config);
  1098. IMPORT("wgpuInstanceRequestAdapterSync") WGPUAdapter wgpuInstanceRequestAdapterSync();
  1099. IMPORT("wgpuAdapterRequestDeviceSync") WGPUDevice wgpuAdapterRequestDeviceSync();
  1100. IMPORT("wgpuBufferUnmap2") void wgpuBufferUnmap2(WGPUBuffer buffer, void *data, int start, int count);