-
Notifications
You must be signed in to change notification settings - Fork 5
/
webgpu.h
2091 lines (1831 loc) · 103 KB
/
webgpu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2019-2023 WebGPU-Native developers
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/** @file */
/**
* \mainpage
*
* **Important:** *This documentation is a Work In Progress.*
*
* This is the home of WebGPU C API specification. We define here the standard
* `webgpu.h` header that all implementations should provide.
*/
#ifndef WEBGPU_H_
#define WEBGPU_H_
#if defined(WGPU_SHARED_LIBRARY)
# if defined(_WIN32)
# if defined(WGPU_IMPLEMENTATION)
# define WGPU_EXPORT __declspec(dllexport)
# else
# define WGPU_EXPORT __declspec(dllimport)
# endif
# else // defined(_WIN32)
# if defined(WGPU_IMPLEMENTATION)
# define WGPU_EXPORT __attribute__((visibility("default")))
# else
# define WGPU_EXPORT
# endif
# endif // defined(_WIN32)
#else // defined(WGPU_SHARED_LIBRARY)
# define WGPU_EXPORT
#endif // defined(WGPU_SHARED_LIBRARY)
#if !defined(WGPU_OBJECT_ATTRIBUTE)
#define WGPU_OBJECT_ATTRIBUTE
#endif
#if !defined(WGPU_ENUM_ATTRIBUTE)
#define WGPU_ENUM_ATTRIBUTE
#endif
#if !defined(WGPU_STRUCTURE_ATTRIBUTE)
#define WGPU_STRUCTURE_ATTRIBUTE
#endif
#if !defined(WGPU_FUNCTION_ATTRIBUTE)
#define WGPU_FUNCTION_ATTRIBUTE
#endif
#if !defined(WGPU_NULLABLE)
#define WGPU_NULLABLE
#endif
#include <stdint.h>
#include <stddef.h>
/**
* \defgroup Constants
* \brief Constants.
*
* @{
*/
#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL)
#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL)
#define WGPU_DEPTH_SLICE_UNDEFINED (0xffffffffUL)
#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL)
#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL)
#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL)
#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL)
#define WGPU_WHOLE_MAP_SIZE (SIZE_MAX)
#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)
/** @} */
/**
* \defgroup Typedefs
* \brief Utility typedefs.
*
* @{
*/
typedef uint32_t WGPUFlags;
typedef uint32_t WGPUBool;
/** @} */
/**
* \defgroup Objects
* \brief Opaque, non-dispatchable handles to WebGPU objects.
*
* @{
*/
typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUBufferImpl* WGPUBuffer WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUComputePipelineImpl* WGPUComputePipeline WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUDeviceImpl* WGPUDevice WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUInstanceImpl* WGPUInstance WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUQuerySetImpl* WGPUQuerySet WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUQueueImpl* WGPUQueue WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPURenderBundleImpl* WGPURenderBundle WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPURenderPipelineImpl* WGPURenderPipeline WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUSamplerImpl* WGPUSampler WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUShaderModuleImpl* WGPUShaderModule WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUSurfaceImpl* WGPUSurface WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE;
typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE;
/** @} */
// Structure forward declarations
struct WGPUAdapterInfo;
struct WGPUBindGroupEntry;
struct WGPUBlendComponent;
struct WGPUBufferBindingLayout;
struct WGPUBufferDescriptor;
struct WGPUColor;
struct WGPUCommandBufferDescriptor;
struct WGPUCommandEncoderDescriptor;
struct WGPUCompilationMessage;
struct WGPUComputePassTimestampWrites;
struct WGPUConstantEntry;
struct WGPUExtent3D;
struct WGPUInstanceDescriptor;
struct WGPULimits;
struct WGPUMultisampleState;
struct WGPUOrigin3D;
struct WGPUPipelineLayoutDescriptor;
struct WGPUPrimitiveDepthClipControl;
struct WGPUPrimitiveState;
struct WGPUQuerySetDescriptor;
struct WGPUQueueDescriptor;
struct WGPURenderBundleDescriptor;
struct WGPURenderBundleEncoderDescriptor;
struct WGPURenderPassDepthStencilAttachment;
struct WGPURenderPassDescriptorMaxDrawCount;
struct WGPURenderPassTimestampWrites;
struct WGPURequestAdapterOptions;
struct WGPUSamplerBindingLayout;
struct WGPUSamplerDescriptor;
struct WGPUShaderModuleCompilationHint;
struct WGPUShaderModuleSPIRVDescriptor;
struct WGPUShaderModuleWGSLDescriptor;
struct WGPUStencilFaceState;
struct WGPUStorageTextureBindingLayout;
struct WGPUSurfaceCapabilities;
struct WGPUSurfaceConfiguration;
struct WGPUSurfaceDescriptor;
struct WGPUSurfaceDescriptorFromAndroidNativeWindow;
struct WGPUSurfaceDescriptorFromCanvasHTMLSelector;
struct WGPUSurfaceDescriptorFromMetalLayer;
struct WGPUSurfaceDescriptorFromWaylandSurface;
struct WGPUSurfaceDescriptorFromWindowsHWND;
struct WGPUSurfaceDescriptorFromXcbWindow;
struct WGPUSurfaceDescriptorFromXlibWindow;
struct WGPUSurfaceTexture;
struct WGPUTextureBindingLayout;
struct WGPUTextureDataLayout;
struct WGPUTextureViewDescriptor;
struct WGPUUncapturedErrorCallbackInfo;
struct WGPUVertexAttribute;
struct WGPUBindGroupDescriptor;
struct WGPUBindGroupLayoutEntry;
struct WGPUBlendState;
struct WGPUCompilationInfo;
struct WGPUComputePassDescriptor;
struct WGPUDepthStencilState;
struct WGPUImageCopyBuffer;
struct WGPUImageCopyTexture;
struct WGPUProgrammableStageDescriptor;
struct WGPURenderPassColorAttachment;
struct WGPURequiredLimits;
struct WGPUShaderModuleDescriptor;
struct WGPUSupportedLimits;
struct WGPUTextureDescriptor;
struct WGPUVertexBufferLayout;
struct WGPUBindGroupLayoutDescriptor;
struct WGPUColorTargetState;
struct WGPUComputePipelineDescriptor;
struct WGPUDeviceDescriptor;
struct WGPURenderPassDescriptor;
struct WGPUVertexState;
struct WGPUFragmentState;
struct WGPURenderPipelineDescriptor;
/**
* \defgroup Enumerations
* \brief Enums.
*
* @{
*/
typedef enum WGPUAdapterType {
WGPUAdapterType_DiscreteGPU = 0x00000000,
WGPUAdapterType_IntegratedGPU = 0x00000001,
WGPUAdapterType_CPU = 0x00000002,
WGPUAdapterType_Unknown = 0x00000003,
WGPUAdapterType_Force32 = 0x7FFFFFFF
} WGPUAdapterType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUAddressMode {
WGPUAddressMode_Repeat = 0x00000000,
WGPUAddressMode_MirrorRepeat = 0x00000001,
WGPUAddressMode_ClampToEdge = 0x00000002,
WGPUAddressMode_Force32 = 0x7FFFFFFF
} WGPUAddressMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBackendType {
WGPUBackendType_Undefined = 0x00000000,
WGPUBackendType_Null = 0x00000001,
WGPUBackendType_WebGPU = 0x00000002,
WGPUBackendType_D3D11 = 0x00000003,
WGPUBackendType_D3D12 = 0x00000004,
WGPUBackendType_Metal = 0x00000005,
WGPUBackendType_Vulkan = 0x00000006,
WGPUBackendType_OpenGL = 0x00000007,
WGPUBackendType_OpenGLES = 0x00000008,
WGPUBackendType_Force32 = 0x7FFFFFFF
} WGPUBackendType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBlendFactor {
WGPUBlendFactor_Zero = 0x00000000,
WGPUBlendFactor_One = 0x00000001,
WGPUBlendFactor_Src = 0x00000002,
WGPUBlendFactor_OneMinusSrc = 0x00000003,
WGPUBlendFactor_SrcAlpha = 0x00000004,
WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005,
WGPUBlendFactor_Dst = 0x00000006,
WGPUBlendFactor_OneMinusDst = 0x00000007,
WGPUBlendFactor_DstAlpha = 0x00000008,
WGPUBlendFactor_OneMinusDstAlpha = 0x00000009,
WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A,
WGPUBlendFactor_Constant = 0x0000000B,
WGPUBlendFactor_OneMinusConstant = 0x0000000C,
WGPUBlendFactor_Force32 = 0x7FFFFFFF
} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBlendOperation {
WGPUBlendOperation_Add = 0x00000000,
WGPUBlendOperation_Subtract = 0x00000001,
WGPUBlendOperation_ReverseSubtract = 0x00000002,
WGPUBlendOperation_Min = 0x00000003,
WGPUBlendOperation_Max = 0x00000004,
WGPUBlendOperation_Force32 = 0x7FFFFFFF
} WGPUBlendOperation WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBufferBindingType {
WGPUBufferBindingType_Undefined = 0x00000000,
WGPUBufferBindingType_Uniform = 0x00000001,
WGPUBufferBindingType_Storage = 0x00000002,
WGPUBufferBindingType_ReadOnlyStorage = 0x00000003,
WGPUBufferBindingType_Force32 = 0x7FFFFFFF
} WGPUBufferBindingType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBufferMapAsyncStatus {
WGPUBufferMapAsyncStatus_Success = 0x00000000,
WGPUBufferMapAsyncStatus_ValidationError = 0x00000001,
WGPUBufferMapAsyncStatus_Unknown = 0x00000002,
WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003,
WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004,
WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005,
WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000006,
WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000007,
WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000008,
WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF
} WGPUBufferMapAsyncStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUBufferMapState {
WGPUBufferMapState_Unmapped = 0x00000000,
WGPUBufferMapState_Pending = 0x00000001,
WGPUBufferMapState_Mapped = 0x00000002,
WGPUBufferMapState_Force32 = 0x7FFFFFFF
} WGPUBufferMapState WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCompareFunction {
WGPUCompareFunction_Undefined = 0x00000000,
WGPUCompareFunction_Never = 0x00000001,
WGPUCompareFunction_Less = 0x00000002,
WGPUCompareFunction_LessEqual = 0x00000003,
WGPUCompareFunction_Greater = 0x00000004,
WGPUCompareFunction_GreaterEqual = 0x00000005,
WGPUCompareFunction_Equal = 0x00000006,
WGPUCompareFunction_NotEqual = 0x00000007,
WGPUCompareFunction_Always = 0x00000008,
WGPUCompareFunction_Force32 = 0x7FFFFFFF
} WGPUCompareFunction WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCompilationInfoRequestStatus {
WGPUCompilationInfoRequestStatus_Success = 0x00000000,
WGPUCompilationInfoRequestStatus_Error = 0x00000001,
WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002,
WGPUCompilationInfoRequestStatus_Unknown = 0x00000003,
WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF
} WGPUCompilationInfoRequestStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCompilationMessageType {
WGPUCompilationMessageType_Error = 0x00000000,
WGPUCompilationMessageType_Warning = 0x00000001,
WGPUCompilationMessageType_Info = 0x00000002,
WGPUCompilationMessageType_Force32 = 0x7FFFFFFF
} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCompositeAlphaMode {
WGPUCompositeAlphaMode_Auto = 0x00000000,
WGPUCompositeAlphaMode_Opaque = 0x00000001,
WGPUCompositeAlphaMode_Premultiplied = 0x00000002,
WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003,
WGPUCompositeAlphaMode_Inherit = 0x00000004,
WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF
} WGPUCompositeAlphaMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCreatePipelineAsyncStatus {
WGPUCreatePipelineAsyncStatus_Success = 0x00000000,
WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000001,
WGPUCreatePipelineAsyncStatus_InternalError = 0x00000002,
WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000003,
WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000004,
WGPUCreatePipelineAsyncStatus_Unknown = 0x00000005,
WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF
} WGPUCreatePipelineAsyncStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUCullMode {
WGPUCullMode_None = 0x00000000,
WGPUCullMode_Front = 0x00000001,
WGPUCullMode_Back = 0x00000002,
WGPUCullMode_Force32 = 0x7FFFFFFF
} WGPUCullMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUDeviceLostReason {
WGPUDeviceLostReason_Unknown = 0x00000001,
WGPUDeviceLostReason_Destroyed = 0x00000002,
WGPUDeviceLostReason_Force32 = 0x7FFFFFFF
} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUErrorFilter {
WGPUErrorFilter_Validation = 0x00000000,
WGPUErrorFilter_OutOfMemory = 0x00000001,
WGPUErrorFilter_Internal = 0x00000002,
WGPUErrorFilter_Force32 = 0x7FFFFFFF
} WGPUErrorFilter WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUErrorType {
WGPUErrorType_NoError = 0x00000000,
WGPUErrorType_Validation = 0x00000001,
WGPUErrorType_OutOfMemory = 0x00000002,
WGPUErrorType_Internal = 0x00000003,
WGPUErrorType_Unknown = 0x00000004,
WGPUErrorType_DeviceLost = 0x00000005,
WGPUErrorType_Force32 = 0x7FFFFFFF
} WGPUErrorType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUFeatureName {
WGPUFeatureName_Undefined = 0x00000000,
WGPUFeatureName_DepthClipControl = 0x00000001,
WGPUFeatureName_Depth32FloatStencil8 = 0x00000002,
WGPUFeatureName_TimestampQuery = 0x00000003,
WGPUFeatureName_TextureCompressionBC = 0x00000004,
WGPUFeatureName_TextureCompressionETC2 = 0x00000005,
WGPUFeatureName_TextureCompressionASTC = 0x00000006,
WGPUFeatureName_IndirectFirstInstance = 0x00000007,
WGPUFeatureName_ShaderF16 = 0x00000008,
WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009,
WGPUFeatureName_BGRA8UnormStorage = 0x0000000A,
WGPUFeatureName_Float32Filterable = 0x0000000B,
WGPUFeatureName_Force32 = 0x7FFFFFFF
} WGPUFeatureName WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUFilterMode {
WGPUFilterMode_Nearest = 0x00000000,
WGPUFilterMode_Linear = 0x00000001,
WGPUFilterMode_Force32 = 0x7FFFFFFF
} WGPUFilterMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUFrontFace {
WGPUFrontFace_CCW = 0x00000000,
WGPUFrontFace_CW = 0x00000001,
WGPUFrontFace_Force32 = 0x7FFFFFFF
} WGPUFrontFace WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUIndexFormat {
WGPUIndexFormat_Undefined = 0x00000000,
WGPUIndexFormat_Uint16 = 0x00000001,
WGPUIndexFormat_Uint32 = 0x00000002,
WGPUIndexFormat_Force32 = 0x7FFFFFFF
} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE;
typedef enum WGPULoadOp {
WGPULoadOp_Undefined = 0x00000000,
WGPULoadOp_Clear = 0x00000001,
WGPULoadOp_Load = 0x00000002,
WGPULoadOp_Force32 = 0x7FFFFFFF
} WGPULoadOp WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUMipmapFilterMode {
WGPUMipmapFilterMode_Nearest = 0x00000000,
WGPUMipmapFilterMode_Linear = 0x00000001,
WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF
} WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUPowerPreference {
WGPUPowerPreference_Undefined = 0x00000000,
WGPUPowerPreference_LowPower = 0x00000001,
WGPUPowerPreference_HighPerformance = 0x00000002,
WGPUPowerPreference_Force32 = 0x7FFFFFFF
} WGPUPowerPreference WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUPresentMode {
WGPUPresentMode_Fifo = 0x00000000,
WGPUPresentMode_FifoRelaxed = 0x00000001,
WGPUPresentMode_Immediate = 0x00000002,
WGPUPresentMode_Mailbox = 0x00000003,
WGPUPresentMode_Force32 = 0x7FFFFFFF
} WGPUPresentMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUPrimitiveTopology {
WGPUPrimitiveTopology_PointList = 0x00000000,
WGPUPrimitiveTopology_LineList = 0x00000001,
WGPUPrimitiveTopology_LineStrip = 0x00000002,
WGPUPrimitiveTopology_TriangleList = 0x00000003,
WGPUPrimitiveTopology_TriangleStrip = 0x00000004,
WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF
} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUQueryType {
WGPUQueryType_Occlusion = 0x00000000,
WGPUQueryType_Timestamp = 0x00000001,
WGPUQueryType_Force32 = 0x7FFFFFFF
} WGPUQueryType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUQueueWorkDoneStatus {
WGPUQueueWorkDoneStatus_Success = 0x00000000,
WGPUQueueWorkDoneStatus_Error = 0x00000001,
WGPUQueueWorkDoneStatus_Unknown = 0x00000002,
WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003,
WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF
} WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPURequestAdapterStatus {
WGPURequestAdapterStatus_Success = 0x00000000,
WGPURequestAdapterStatus_Unavailable = 0x00000001,
WGPURequestAdapterStatus_Error = 0x00000002,
WGPURequestAdapterStatus_Unknown = 0x00000003,
WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF
} WGPURequestAdapterStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPURequestDeviceStatus {
WGPURequestDeviceStatus_Success = 0x00000000,
WGPURequestDeviceStatus_Error = 0x00000001,
WGPURequestDeviceStatus_Unknown = 0x00000002,
WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF
} WGPURequestDeviceStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUSType {
WGPUSType_Invalid = 0x00000000,
WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001,
WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002,
WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003,
WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004,
WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005,
WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006,
WGPUSType_PrimitiveDepthClipControl = 0x00000007,
WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008,
WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009,
WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A,
WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F,
WGPUSType_Force32 = 0x7FFFFFFF
} WGPUSType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUSamplerBindingType {
WGPUSamplerBindingType_Undefined = 0x00000000,
WGPUSamplerBindingType_Filtering = 0x00000001,
WGPUSamplerBindingType_NonFiltering = 0x00000002,
WGPUSamplerBindingType_Comparison = 0x00000003,
WGPUSamplerBindingType_Force32 = 0x7FFFFFFF
} WGPUSamplerBindingType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUStencilOperation {
WGPUStencilOperation_Keep = 0x00000000,
WGPUStencilOperation_Zero = 0x00000001,
WGPUStencilOperation_Replace = 0x00000002,
WGPUStencilOperation_Invert = 0x00000003,
WGPUStencilOperation_IncrementClamp = 0x00000004,
WGPUStencilOperation_DecrementClamp = 0x00000005,
WGPUStencilOperation_IncrementWrap = 0x00000006,
WGPUStencilOperation_DecrementWrap = 0x00000007,
WGPUStencilOperation_Force32 = 0x7FFFFFFF
} WGPUStencilOperation WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUStorageTextureAccess {
WGPUStorageTextureAccess_Undefined = 0x00000000,
WGPUStorageTextureAccess_WriteOnly = 0x00000001,
WGPUStorageTextureAccess_ReadOnly = 0x00000002,
WGPUStorageTextureAccess_ReadWrite = 0x00000003,
WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF
} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUStoreOp {
WGPUStoreOp_Undefined = 0x00000000,
WGPUStoreOp_Store = 0x00000001,
WGPUStoreOp_Discard = 0x00000002,
WGPUStoreOp_Force32 = 0x7FFFFFFF
} WGPUStoreOp WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUSurfaceGetCurrentTextureStatus {
WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000,
WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001,
WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002,
WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003,
WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004,
WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005,
WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF
} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureAspect {
WGPUTextureAspect_All = 0x00000000,
WGPUTextureAspect_StencilOnly = 0x00000001,
WGPUTextureAspect_DepthOnly = 0x00000002,
WGPUTextureAspect_Force32 = 0x7FFFFFFF
} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureDimension {
WGPUTextureDimension_1D = 0x00000000,
WGPUTextureDimension_2D = 0x00000001,
WGPUTextureDimension_3D = 0x00000002,
WGPUTextureDimension_Force32 = 0x7FFFFFFF
} WGPUTextureDimension WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureFormat {
WGPUTextureFormat_Undefined = 0x00000000,
WGPUTextureFormat_R8Unorm = 0x00000001,
WGPUTextureFormat_R8Snorm = 0x00000002,
WGPUTextureFormat_R8Uint = 0x00000003,
WGPUTextureFormat_R8Sint = 0x00000004,
WGPUTextureFormat_R16Uint = 0x00000005,
WGPUTextureFormat_R16Sint = 0x00000006,
WGPUTextureFormat_R16Float = 0x00000007,
WGPUTextureFormat_RG8Unorm = 0x00000008,
WGPUTextureFormat_RG8Snorm = 0x00000009,
WGPUTextureFormat_RG8Uint = 0x0000000A,
WGPUTextureFormat_RG8Sint = 0x0000000B,
WGPUTextureFormat_R32Float = 0x0000000C,
WGPUTextureFormat_R32Uint = 0x0000000D,
WGPUTextureFormat_R32Sint = 0x0000000E,
WGPUTextureFormat_RG16Uint = 0x0000000F,
WGPUTextureFormat_RG16Sint = 0x00000010,
WGPUTextureFormat_RG16Float = 0x00000011,
WGPUTextureFormat_RGBA8Unorm = 0x00000012,
WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013,
WGPUTextureFormat_RGBA8Snorm = 0x00000014,
WGPUTextureFormat_RGBA8Uint = 0x00000015,
WGPUTextureFormat_RGBA8Sint = 0x00000016,
WGPUTextureFormat_BGRA8Unorm = 0x00000017,
WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018,
WGPUTextureFormat_RGB10A2Uint = 0x00000019,
WGPUTextureFormat_RGB10A2Unorm = 0x0000001A,
WGPUTextureFormat_RG11B10Ufloat = 0x0000001B,
WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C,
WGPUTextureFormat_RG32Float = 0x0000001D,
WGPUTextureFormat_RG32Uint = 0x0000001E,
WGPUTextureFormat_RG32Sint = 0x0000001F,
WGPUTextureFormat_RGBA16Uint = 0x00000020,
WGPUTextureFormat_RGBA16Sint = 0x00000021,
WGPUTextureFormat_RGBA16Float = 0x00000022,
WGPUTextureFormat_RGBA32Float = 0x00000023,
WGPUTextureFormat_RGBA32Uint = 0x00000024,
WGPUTextureFormat_RGBA32Sint = 0x00000025,
WGPUTextureFormat_Stencil8 = 0x00000026,
WGPUTextureFormat_Depth16Unorm = 0x00000027,
WGPUTextureFormat_Depth24Plus = 0x00000028,
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000029,
WGPUTextureFormat_Depth32Float = 0x0000002A,
WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B,
WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C,
WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D,
WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E,
WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F,
WGPUTextureFormat_BC3RGBAUnorm = 0x00000030,
WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031,
WGPUTextureFormat_BC4RUnorm = 0x00000032,
WGPUTextureFormat_BC4RSnorm = 0x00000033,
WGPUTextureFormat_BC5RGUnorm = 0x00000034,
WGPUTextureFormat_BC5RGSnorm = 0x00000035,
WGPUTextureFormat_BC6HRGBUfloat = 0x00000036,
WGPUTextureFormat_BC6HRGBFloat = 0x00000037,
WGPUTextureFormat_BC7RGBAUnorm = 0x00000038,
WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039,
WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A,
WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B,
WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C,
WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D,
WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E,
WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F,
WGPUTextureFormat_EACR11Unorm = 0x00000040,
WGPUTextureFormat_EACR11Snorm = 0x00000041,
WGPUTextureFormat_EACRG11Unorm = 0x00000042,
WGPUTextureFormat_EACRG11Snorm = 0x00000043,
WGPUTextureFormat_ASTC4x4Unorm = 0x00000044,
WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045,
WGPUTextureFormat_ASTC5x4Unorm = 0x00000046,
WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047,
WGPUTextureFormat_ASTC5x5Unorm = 0x00000048,
WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049,
WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A,
WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B,
WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C,
WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D,
WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E,
WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F,
WGPUTextureFormat_ASTC8x6Unorm = 0x00000050,
WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051,
WGPUTextureFormat_ASTC8x8Unorm = 0x00000052,
WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053,
WGPUTextureFormat_ASTC10x5Unorm = 0x00000054,
WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055,
WGPUTextureFormat_ASTC10x6Unorm = 0x00000056,
WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057,
WGPUTextureFormat_ASTC10x8Unorm = 0x00000058,
WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059,
WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A,
WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B,
WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C,
WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D,
WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E,
WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F,
WGPUTextureFormat_Force32 = 0x7FFFFFFF
} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureSampleType {
WGPUTextureSampleType_Undefined = 0x00000000,
WGPUTextureSampleType_Float = 0x00000001,
WGPUTextureSampleType_UnfilterableFloat = 0x00000002,
WGPUTextureSampleType_Depth = 0x00000003,
WGPUTextureSampleType_Sint = 0x00000004,
WGPUTextureSampleType_Uint = 0x00000005,
WGPUTextureSampleType_Force32 = 0x7FFFFFFF
} WGPUTextureSampleType WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureViewDimension {
WGPUTextureViewDimension_Undefined = 0x00000000,
WGPUTextureViewDimension_1D = 0x00000001,
WGPUTextureViewDimension_2D = 0x00000002,
WGPUTextureViewDimension_2DArray = 0x00000003,
WGPUTextureViewDimension_Cube = 0x00000004,
WGPUTextureViewDimension_CubeArray = 0x00000005,
WGPUTextureViewDimension_3D = 0x00000006,
WGPUTextureViewDimension_Force32 = 0x7FFFFFFF
} WGPUTextureViewDimension WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUVertexFormat {
WGPUVertexFormat_Undefined = 0x00000000,
WGPUVertexFormat_Uint8x2 = 0x00000001,
WGPUVertexFormat_Uint8x4 = 0x00000002,
WGPUVertexFormat_Sint8x2 = 0x00000003,
WGPUVertexFormat_Sint8x4 = 0x00000004,
WGPUVertexFormat_Unorm8x2 = 0x00000005,
WGPUVertexFormat_Unorm8x4 = 0x00000006,
WGPUVertexFormat_Snorm8x2 = 0x00000007,
WGPUVertexFormat_Snorm8x4 = 0x00000008,
WGPUVertexFormat_Uint16x2 = 0x00000009,
WGPUVertexFormat_Uint16x4 = 0x0000000A,
WGPUVertexFormat_Sint16x2 = 0x0000000B,
WGPUVertexFormat_Sint16x4 = 0x0000000C,
WGPUVertexFormat_Unorm16x2 = 0x0000000D,
WGPUVertexFormat_Unorm16x4 = 0x0000000E,
WGPUVertexFormat_Snorm16x2 = 0x0000000F,
WGPUVertexFormat_Snorm16x4 = 0x00000010,
WGPUVertexFormat_Float16x2 = 0x00000011,
WGPUVertexFormat_Float16x4 = 0x00000012,
WGPUVertexFormat_Float32 = 0x00000013,
WGPUVertexFormat_Float32x2 = 0x00000014,
WGPUVertexFormat_Float32x3 = 0x00000015,
WGPUVertexFormat_Float32x4 = 0x00000016,
WGPUVertexFormat_Uint32 = 0x00000017,
WGPUVertexFormat_Uint32x2 = 0x00000018,
WGPUVertexFormat_Uint32x3 = 0x00000019,
WGPUVertexFormat_Uint32x4 = 0x0000001A,
WGPUVertexFormat_Sint32 = 0x0000001B,
WGPUVertexFormat_Sint32x2 = 0x0000001C,
WGPUVertexFormat_Sint32x3 = 0x0000001D,
WGPUVertexFormat_Sint32x4 = 0x0000001E,
WGPUVertexFormat_Force32 = 0x7FFFFFFF
} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUVertexStepMode {
WGPUVertexStepMode_Vertex = 0x00000000,
WGPUVertexStepMode_Instance = 0x00000001,
WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002,
WGPUVertexStepMode_Force32 = 0x7FFFFFFF
} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUWGSLFeatureName {
WGPUWGSLFeatureName_Undefined = 0x00000000,
WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001,
WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002,
WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003,
WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004,
WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF
} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE;
/** @} */
/**
* \defgroup Bitflags
* \brief Enum used as bit flags.
*
* @{
*/
typedef enum WGPUBufferUsage {
WGPUBufferUsage_None = 0x00000000,
WGPUBufferUsage_MapRead = 0x00000001,
WGPUBufferUsage_MapWrite = 0x00000002,
WGPUBufferUsage_CopySrc = 0x00000004,
WGPUBufferUsage_CopyDst = 0x00000008,
WGPUBufferUsage_Index = 0x00000010,
WGPUBufferUsage_Vertex = 0x00000020,
WGPUBufferUsage_Uniform = 0x00000040,
WGPUBufferUsage_Storage = 0x00000080,
WGPUBufferUsage_Indirect = 0x00000100,
WGPUBufferUsage_QueryResolve = 0x00000200,
WGPUBufferUsage_Force32 = 0x7FFFFFFF
} WGPUBufferUsage WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUBufferUsageFlags WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUColorWriteMask {
WGPUColorWriteMask_None = 0x00000000,
WGPUColorWriteMask_Red = 0x00000001,
WGPUColorWriteMask_Green = 0x00000002,
WGPUColorWriteMask_Blue = 0x00000004,
WGPUColorWriteMask_Alpha = 0x00000008,
WGPUColorWriteMask_All = WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha,
WGPUColorWriteMask_Force32 = 0x7FFFFFFF
} WGPUColorWriteMask WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUColorWriteMaskFlags WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUMapMode {
WGPUMapMode_None = 0x00000000,
WGPUMapMode_Read = 0x00000001,
WGPUMapMode_Write = 0x00000002,
WGPUMapMode_Force32 = 0x7FFFFFFF
} WGPUMapMode WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUMapModeFlags WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUShaderStage {
WGPUShaderStage_None = 0x00000000,
WGPUShaderStage_Vertex = 0x00000001,
WGPUShaderStage_Fragment = 0x00000002,
WGPUShaderStage_Compute = 0x00000004,
WGPUShaderStage_Force32 = 0x7FFFFFFF
} WGPUShaderStage WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUShaderStageFlags WGPU_ENUM_ATTRIBUTE;
typedef enum WGPUTextureUsage {
WGPUTextureUsage_None = 0x00000000,
WGPUTextureUsage_CopySrc = 0x00000001,
WGPUTextureUsage_CopyDst = 0x00000002,
WGPUTextureUsage_TextureBinding = 0x00000004,
WGPUTextureUsage_StorageBinding = 0x00000008,
WGPUTextureUsage_RenderAttachment = 0x00000010,
WGPUTextureUsage_Force32 = 0x7FFFFFFF
} WGPUTextureUsage WGPU_ENUM_ATTRIBUTE;
typedef WGPUFlags WGPUTextureUsageFlags WGPU_ENUM_ATTRIBUTE;
/** @} */
typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE;
/**
* \defgroup Callbacks
* \brief Callbacks through which asynchronous functions return.
*
* @{
*/
typedef void (*WGPUAdapterRequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUBufferMapAsyncCallback)(WGPUBufferMapAsyncStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUDeviceCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUDeviceCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUInstanceRequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUQueueOnSubmittedWorkDoneCallback)(WGPUQueueWorkDoneStatus status, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
typedef void (*WGPUShaderModuleGetCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, WGPU_NULLABLE void * userdata) WGPU_FUNCTION_ATTRIBUTE;
/** @} */
/**
* \defgroup ChainedStructures Chained Structures
* \brief Structures used to extend descriptors.
*
* @{
*/
typedef struct WGPUChainedStruct {
struct WGPUChainedStruct const * next;
WGPUSType sType;
} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUChainedStructOut {
struct WGPUChainedStructOut * next;
WGPUSType sType;
} WGPUChainedStructOut WGPU_STRUCTURE_ATTRIBUTE;
/** @} */
/**
* \defgroup Structures
* \brief Descriptors and other transparent structures.
*
* @{
*/
typedef struct WGPUAdapterInfo {
WGPUChainedStructOut * nextInChain;
char const * vendor;
char const * architecture;
char const * device;
char const * description;
WGPUBackendType backendType;
WGPUAdapterType adapterType;
uint32_t vendorID;
uint32_t deviceID;
} WGPUAdapterInfo WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUBindGroupEntry {
WGPUChainedStruct const * nextInChain;
uint32_t binding;
WGPU_NULLABLE WGPUBuffer buffer;
uint64_t offset;
uint64_t size;
WGPU_NULLABLE WGPUSampler sampler;
WGPU_NULLABLE WGPUTextureView textureView;
} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUBlendComponent {
WGPUBlendOperation operation;
WGPUBlendFactor srcFactor;
WGPUBlendFactor dstFactor;
} WGPUBlendComponent WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUBufferBindingLayout {
WGPUChainedStruct const * nextInChain;
WGPUBufferBindingType type;
WGPUBool hasDynamicOffset;
uint64_t minBindingSize;
} WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUBufferDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
WGPUBufferUsageFlags usage;
uint64_t size;
WGPUBool mappedAtCreation;
} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUColor {
double r;
double g;
double b;
double a;
} WGPUColor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUCommandBufferDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
} WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUCommandEncoderDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
} WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUCompilationMessage {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * message;
WGPUCompilationMessageType type;
uint64_t lineNum;
uint64_t linePos;
uint64_t offset;
uint64_t length;
uint64_t utf16LinePos;
uint64_t utf16Offset;
uint64_t utf16Length;
} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUComputePassTimestampWrites {
WGPUQuerySet querySet;
uint32_t beginningOfPassWriteIndex;
uint32_t endOfPassWriteIndex;
} WGPUComputePassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUConstantEntry {
WGPUChainedStruct const * nextInChain;
char const * key;
double value;
} WGPUConstantEntry WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUExtent3D {
uint32_t width;
uint32_t height;
uint32_t depthOrArrayLayers;
} WGPUExtent3D WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUInstanceDescriptor {
WGPUChainedStruct const * nextInChain;
} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPULimits {
uint32_t maxTextureDimension1D;
uint32_t maxTextureDimension2D;
uint32_t maxTextureDimension3D;
uint32_t maxTextureArrayLayers;
uint32_t maxBindGroups;
uint32_t maxBindGroupsPlusVertexBuffers;
uint32_t maxBindingsPerBindGroup;
uint32_t maxDynamicUniformBuffersPerPipelineLayout;
uint32_t maxDynamicStorageBuffersPerPipelineLayout;
uint32_t maxSampledTexturesPerShaderStage;
uint32_t maxSamplersPerShaderStage;
uint32_t maxStorageBuffersPerShaderStage;
uint32_t maxStorageTexturesPerShaderStage;
uint32_t maxUniformBuffersPerShaderStage;
uint64_t maxUniformBufferBindingSize;
uint64_t maxStorageBufferBindingSize;
uint32_t minUniformBufferOffsetAlignment;
uint32_t minStorageBufferOffsetAlignment;
uint32_t maxVertexBuffers;
uint64_t maxBufferSize;
uint32_t maxVertexAttributes;
uint32_t maxVertexBufferArrayStride;
uint32_t maxInterStageShaderComponents;
uint32_t maxInterStageShaderVariables;
uint32_t maxColorAttachments;
uint32_t maxColorAttachmentBytesPerSample;
uint32_t maxComputeWorkgroupStorageSize;
uint32_t maxComputeInvocationsPerWorkgroup;
uint32_t maxComputeWorkgroupSizeX;
uint32_t maxComputeWorkgroupSizeY;
uint32_t maxComputeWorkgroupSizeZ;
uint32_t maxComputeWorkgroupsPerDimension;
} WGPULimits WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUMultisampleState {
WGPUChainedStruct const * nextInChain;
uint32_t count;
uint32_t mask;
WGPUBool alphaToCoverageEnabled;
} WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUOrigin3D {
uint32_t x;
uint32_t y;
uint32_t z;
} WGPUOrigin3D WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUPipelineLayoutDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
size_t bindGroupLayoutCount;
WGPUBindGroupLayout const * bindGroupLayouts;
} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUPrimitiveDepthClipControl {
WGPUChainedStruct chain;
WGPUBool unclippedDepth;
} WGPUPrimitiveDepthClipControl WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUPrimitiveState {
WGPUChainedStruct const * nextInChain;
WGPUPrimitiveTopology topology;
WGPUIndexFormat stripIndexFormat;
WGPUFrontFace frontFace;
WGPUCullMode cullMode;
} WGPUPrimitiveState WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUQuerySetDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
WGPUQueryType type;
uint32_t count;
} WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUQueueDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
} WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPURenderBundleDescriptor {
WGPUChainedStruct const * nextInChain;