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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268
|
// BSD 3-Clause License
//
// Copyright (c) 2019, "WebGPU native" developers
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#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)
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)
typedef uint32_t WGPUFlags;
typedef struct WGPUAdapterImpl* WGPUAdapter;
typedef struct WGPUBindGroupImpl* WGPUBindGroup;
typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout;
typedef struct WGPUBufferImpl* WGPUBuffer;
typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer;
typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder;
typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder;
typedef struct WGPUComputePipelineImpl* WGPUComputePipeline;
typedef struct WGPUDeviceImpl* WGPUDevice;
typedef struct WGPUFenceImpl* WGPUFence;
typedef struct WGPUInstanceImpl* WGPUInstance;
typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout;
typedef struct WGPUQuerySetImpl* WGPUQuerySet;
typedef struct WGPUQueueImpl* WGPUQueue;
typedef struct WGPURenderBundleImpl* WGPURenderBundle;
typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder;
typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder;
typedef struct WGPURenderPipelineImpl* WGPURenderPipeline;
typedef struct WGPUSamplerImpl* WGPUSampler;
typedef struct WGPUShaderModuleImpl* WGPUShaderModule;
typedef struct WGPUSurfaceImpl* WGPUSurface;
typedef struct WGPUSwapChainImpl* WGPUSwapChain;
typedef struct WGPUTextureImpl* WGPUTexture;
typedef struct WGPUTextureViewImpl* WGPUTextureView;
typedef enum WGPUAdapterType {
WGPUAdapterType_DiscreteGPU = 0x00000000,
WGPUAdapterType_IntegratedGPU = 0x00000001,
WGPUAdapterType_CPU = 0x00000002,
WGPUAdapterType_Unknown = 0x00000003,
WGPUAdapterType_Force32 = 0x7FFFFFFF
} WGPUAdapterType;
typedef enum WGPUAddressMode {
WGPUAddressMode_Repeat = 0x00000000,
WGPUAddressMode_MirrorRepeat = 0x00000001,
WGPUAddressMode_ClampToEdge = 0x00000002,
WGPUAddressMode_Force32 = 0x7FFFFFFF
} WGPUAddressMode;
typedef enum WGPUBackendType {
WGPUBackendType_Null = 0x00000000,
WGPUBackendType_D3D11 = 0x00000001,
WGPUBackendType_D3D12 = 0x00000002,
WGPUBackendType_Metal = 0x00000003,
WGPUBackendType_Vulkan = 0x00000004,
WGPUBackendType_OpenGL = 0x00000005,
WGPUBackendType_OpenGLES = 0x00000006,
WGPUBackendType_Force32 = 0x7FFFFFFF
} WGPUBackendType;
typedef enum WGPUBindingType {
WGPUBindingType_UniformBuffer = 0x00000000,
WGPUBindingType_StorageBuffer = 0x00000001,
WGPUBindingType_ReadonlyStorageBuffer = 0x00000002,
WGPUBindingType_Sampler = 0x00000003,
WGPUBindingType_ComparisonSampler = 0x00000004,
WGPUBindingType_SampledTexture = 0x00000005,
WGPUBindingType_MultisampledTexture = 0x00000006,
WGPUBindingType_ReadonlyStorageTexture = 0x00000007,
WGPUBindingType_WriteonlyStorageTexture = 0x00000008,
WGPUBindingType_Force32 = 0x7FFFFFFF
} WGPUBindingType;
typedef enum WGPUBlendFactor {
WGPUBlendFactor_Zero = 0x00000000,
WGPUBlendFactor_One = 0x00000001,
WGPUBlendFactor_SrcColor = 0x00000002,
WGPUBlendFactor_OneMinusSrcColor = 0x00000003,
WGPUBlendFactor_SrcAlpha = 0x00000004,
WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005,
WGPUBlendFactor_DstColor = 0x00000006,
WGPUBlendFactor_OneMinusDstColor = 0x00000007,
WGPUBlendFactor_DstAlpha = 0x00000008,
WGPUBlendFactor_OneMinusDstAlpha = 0x00000009,
WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A,
WGPUBlendFactor_BlendColor = 0x0000000B,
WGPUBlendFactor_OneMinusBlendColor = 0x0000000C,
WGPUBlendFactor_Force32 = 0x7FFFFFFF
} WGPUBlendFactor;
typedef enum WGPUBlendOperation {
WGPUBlendOperation_Add = 0x00000000,
WGPUBlendOperation_Subtract = 0x00000001,
WGPUBlendOperation_ReverseSubtract = 0x00000002,
WGPUBlendOperation_Min = 0x00000003,
WGPUBlendOperation_Max = 0x00000004,
WGPUBlendOperation_Force32 = 0x7FFFFFFF
} WGPUBlendOperation;
typedef enum WGPUBufferMapAsyncStatus {
WGPUBufferMapAsyncStatus_Success = 0x00000000,
WGPUBufferMapAsyncStatus_Error = 0x00000001,
WGPUBufferMapAsyncStatus_Unknown = 0x00000002,
WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003,
WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF
} WGPUBufferMapAsyncStatus;
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;
typedef enum WGPUCullMode {
WGPUCullMode_None = 0x00000000,
WGPUCullMode_Front = 0x00000001,
WGPUCullMode_Back = 0x00000002,
WGPUCullMode_Force32 = 0x7FFFFFFF
} WGPUCullMode;
typedef enum WGPUErrorFilter {
WGPUErrorFilter_None = 0x00000000,
WGPUErrorFilter_Validation = 0x00000001,
WGPUErrorFilter_OutOfMemory = 0x00000002,
WGPUErrorFilter_Force32 = 0x7FFFFFFF
} WGPUErrorFilter;
typedef enum WGPUErrorType {
WGPUErrorType_NoError = 0x00000000,
WGPUErrorType_Validation = 0x00000001,
WGPUErrorType_OutOfMemory = 0x00000002,
WGPUErrorType_Unknown = 0x00000003,
WGPUErrorType_DeviceLost = 0x00000004,
WGPUErrorType_Force32 = 0x7FFFFFFF
} WGPUErrorType;
typedef enum WGPUFenceCompletionStatus {
WGPUFenceCompletionStatus_Success = 0x00000000,
WGPUFenceCompletionStatus_Error = 0x00000001,
WGPUFenceCompletionStatus_Unknown = 0x00000002,
WGPUFenceCompletionStatus_DeviceLost = 0x00000003,
WGPUFenceCompletionStatus_Force32 = 0x7FFFFFFF
} WGPUFenceCompletionStatus;
typedef enum WGPUFilterMode {
WGPUFilterMode_Nearest = 0x00000000,
WGPUFilterMode_Linear = 0x00000001,
WGPUFilterMode_Force32 = 0x7FFFFFFF
} WGPUFilterMode;
typedef enum WGPUFrontFace {
WGPUFrontFace_CCW = 0x00000000,
WGPUFrontFace_CW = 0x00000001,
WGPUFrontFace_Force32 = 0x7FFFFFFF
} WGPUFrontFace;
typedef enum WGPUIndexFormat {
WGPUIndexFormat_Undefined = 0x00000000,
WGPUIndexFormat_Uint16 = 0x00000001,
WGPUIndexFormat_Uint32 = 0x00000002,
WGPUIndexFormat_Force32 = 0x7FFFFFFF
} WGPUIndexFormat;
typedef enum WGPUInputStepMode {
WGPUInputStepMode_Vertex = 0x00000000,
WGPUInputStepMode_Instance = 0x00000001,
WGPUInputStepMode_Force32 = 0x7FFFFFFF
} WGPUInputStepMode;
typedef enum WGPULoadOp {
WGPULoadOp_Clear = 0x00000000,
WGPULoadOp_Load = 0x00000001,
WGPULoadOp_Force32 = 0x7FFFFFFF
} WGPULoadOp;
typedef enum WGPUPipelineStatisticName {
WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000,
WGPUPipelineStatisticName_ClipperInvocations = 0x00000001,
WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002,
WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003,
WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004,
WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF
} WGPUPipelineStatisticName;
typedef enum WGPUPresentMode {
WGPUPresentMode_Immediate = 0x00000000,
WGPUPresentMode_Mailbox = 0x00000001,
WGPUPresentMode_Fifo = 0x00000002,
WGPUPresentMode_Force32 = 0x7FFFFFFF
} WGPUPresentMode;
typedef enum WGPUPrimitiveTopology {
WGPUPrimitiveTopology_PointList = 0x00000000,
WGPUPrimitiveTopology_LineList = 0x00000001,
WGPUPrimitiveTopology_LineStrip = 0x00000002,
WGPUPrimitiveTopology_TriangleList = 0x00000003,
WGPUPrimitiveTopology_TriangleStrip = 0x00000004,
WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF
} WGPUPrimitiveTopology;
typedef enum WGPUQueryType {
WGPUQueryType_Occlusion = 0x00000000,
WGPUQueryType_PipelineStatistics = 0x00000001,
WGPUQueryType_Timestamp = 0x00000002,
WGPUQueryType_Force32 = 0x7FFFFFFF
} WGPUQueryType;
typedef enum WGPUSType {
WGPUSType_Invalid = 0x00000000,
WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001,
WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002,
WGPUSType_SurfaceDescriptorFromXlib = 0x00000003,
WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004,
WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005,
WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006,
WGPUSType_Force32 = 0x7FFFFFFF
} WGPUSType;
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;
typedef enum WGPUStoreOp {
WGPUStoreOp_Store = 0x00000000,
WGPUStoreOp_Clear = 0x00000001,
WGPUStoreOp_Force32 = 0x7FFFFFFF
} WGPUStoreOp;
typedef enum WGPUTextureAspect {
WGPUTextureAspect_All = 0x00000000,
WGPUTextureAspect_StencilOnly = 0x00000001,
WGPUTextureAspect_DepthOnly = 0x00000002,
WGPUTextureAspect_Force32 = 0x7FFFFFFF
} WGPUTextureAspect;
typedef enum WGPUTextureComponentType {
WGPUTextureComponentType_Float = 0x00000000,
WGPUTextureComponentType_Sint = 0x00000001,
WGPUTextureComponentType_Uint = 0x00000002,
WGPUTextureComponentType_DepthComparison = 0x00000003,
WGPUTextureComponentType_Force32 = 0x7FFFFFFF
} WGPUTextureComponentType;
typedef enum WGPUTextureDimension {
WGPUTextureDimension_1D = 0x00000000,
WGPUTextureDimension_2D = 0x00000001,
WGPUTextureDimension_3D = 0x00000002,
WGPUTextureDimension_Force32 = 0x7FFFFFFF
} WGPUTextureDimension;
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_RGB10A2Unorm = 0x00000019,
WGPUTextureFormat_RG11B10Ufloat = 0x0000001A,
WGPUTextureFormat_RGB9E5Ufloat = 0x0000001B,
WGPUTextureFormat_RG32Float = 0x0000001C,
WGPUTextureFormat_RG32Uint = 0x0000001D,
WGPUTextureFormat_RG32Sint = 0x0000001E,
WGPUTextureFormat_RGBA16Uint = 0x0000001F,
WGPUTextureFormat_RGBA16Sint = 0x00000020,
WGPUTextureFormat_RGBA16Float = 0x00000021,
WGPUTextureFormat_RGBA32Float = 0x00000022,
WGPUTextureFormat_RGBA32Uint = 0x00000023,
WGPUTextureFormat_RGBA32Sint = 0x00000024,
WGPUTextureFormat_Depth32Float = 0x00000025,
WGPUTextureFormat_Depth24Plus = 0x00000026,
WGPUTextureFormat_Depth24PlusStencil8 = 0x00000027,
WGPUTextureFormat_BC1RGBAUnorm = 0x00000028,
WGPUTextureFormat_BC1RGBAUnormSrgb = 0x00000029,
WGPUTextureFormat_BC2RGBAUnorm = 0x0000002A,
WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002B,
WGPUTextureFormat_BC3RGBAUnorm = 0x0000002C,
WGPUTextureFormat_BC3RGBAUnormSrgb = 0x0000002D,
WGPUTextureFormat_BC4RUnorm = 0x0000002E,
WGPUTextureFormat_BC4RSnorm = 0x0000002F,
WGPUTextureFormat_BC5RGUnorm = 0x00000030,
WGPUTextureFormat_BC5RGSnorm = 0x00000031,
WGPUTextureFormat_BC6HRGBUfloat = 0x00000032,
WGPUTextureFormat_BC6HRGBFloat = 0x00000033,
WGPUTextureFormat_BC7RGBAUnorm = 0x00000034,
WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000035,
WGPUTextureFormat_Force32 = 0x7FFFFFFF
} WGPUTextureFormat;
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;
typedef enum WGPUVertexFormat {
WGPUVertexFormat_UChar2 = 0x00000000,
WGPUVertexFormat_UChar4 = 0x00000001,
WGPUVertexFormat_Char2 = 0x00000002,
WGPUVertexFormat_Char4 = 0x00000003,
WGPUVertexFormat_UChar2Norm = 0x00000004,
WGPUVertexFormat_UChar4Norm = 0x00000005,
WGPUVertexFormat_Char2Norm = 0x00000006,
WGPUVertexFormat_Char4Norm = 0x00000007,
WGPUVertexFormat_UShort2 = 0x00000008,
WGPUVertexFormat_UShort4 = 0x00000009,
WGPUVertexFormat_Short2 = 0x0000000A,
WGPUVertexFormat_Short4 = 0x0000000B,
WGPUVertexFormat_UShort2Norm = 0x0000000C,
WGPUVertexFormat_UShort4Norm = 0x0000000D,
WGPUVertexFormat_Short2Norm = 0x0000000E,
WGPUVertexFormat_Short4Norm = 0x0000000F,
WGPUVertexFormat_Half2 = 0x00000010,
WGPUVertexFormat_Half4 = 0x00000011,
WGPUVertexFormat_Float = 0x00000012,
WGPUVertexFormat_Float2 = 0x00000013,
WGPUVertexFormat_Float3 = 0x00000014,
WGPUVertexFormat_Float4 = 0x00000015,
WGPUVertexFormat_UInt = 0x00000016,
WGPUVertexFormat_UInt2 = 0x00000017,
WGPUVertexFormat_UInt3 = 0x00000018,
WGPUVertexFormat_UInt4 = 0x00000019,
WGPUVertexFormat_Int = 0x0000001A,
WGPUVertexFormat_Int2 = 0x0000001B,
WGPUVertexFormat_Int3 = 0x0000001C,
WGPUVertexFormat_Int4 = 0x0000001D,
WGPUVertexFormat_Force32 = 0x7FFFFFFF
} WGPUVertexFormat;
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;
typedef WGPUFlags WGPUBufferUsageFlags;
typedef enum WGPUColorWriteMask {
WGPUColorWriteMask_None = 0x00000000,
WGPUColorWriteMask_Red = 0x00000001,
WGPUColorWriteMask_Green = 0x00000002,
WGPUColorWriteMask_Blue = 0x00000004,
WGPUColorWriteMask_Alpha = 0x00000008,
WGPUColorWriteMask_All = 0x0000000F,
WGPUColorWriteMask_Force32 = 0x7FFFFFFF
} WGPUColorWriteMask;
typedef WGPUFlags WGPUColorWriteMaskFlags;
typedef enum WGPUMapMode {
WGPUMapMode_Read = 0x00000001,
WGPUMapMode_Write = 0x00000002,
WGPUMapMode_Force32 = 0x7FFFFFFF
} WGPUMapMode;
typedef WGPUFlags WGPUMapModeFlags;
typedef enum WGPUShaderStage {
WGPUShaderStage_None = 0x00000000,
WGPUShaderStage_Vertex = 0x00000001,
WGPUShaderStage_Fragment = 0x00000002,
WGPUShaderStage_Compute = 0x00000004,
WGPUShaderStage_Force32 = 0x7FFFFFFF
} WGPUShaderStage;
typedef WGPUFlags WGPUShaderStageFlags;
typedef enum WGPUTextureUsage {
WGPUTextureUsage_None = 0x00000000,
WGPUTextureUsage_CopySrc = 0x00000001,
WGPUTextureUsage_CopyDst = 0x00000002,
WGPUTextureUsage_Sampled = 0x00000004,
WGPUTextureUsage_Storage = 0x00000008,
WGPUTextureUsage_OutputAttachment = 0x00000010,
WGPUTextureUsage_Force32 = 0x7FFFFFFF
} WGPUTextureUsage;
typedef WGPUFlags WGPUTextureUsageFlags;
typedef struct WGPUChainedStruct {
struct WGPUChainedStruct const * next;
WGPUSType sType;
} WGPUChainedStruct;
typedef struct WGPUAdapterProperties {
WGPUChainedStruct const * nextInChain;
uint32_t deviceID;
uint32_t vendorID;
char const * name;
WGPUAdapterType adapterType;
WGPUBackendType backendType;
} WGPUAdapterProperties;
typedef struct WGPUBindGroupEntry {
uint32_t binding;
WGPUBuffer buffer;
uint64_t offset;
uint64_t size;
WGPUSampler sampler;
WGPUTextureView textureView;
} WGPUBindGroupEntry;
typedef struct WGPUBindGroupLayoutEntry {
uint32_t binding;
WGPUShaderStageFlags visibility;
WGPUBindingType type;
bool hasDynamicOffset;
uint64_t minBufferBindingSize;
WGPUTextureViewDimension viewDimension;
WGPUTextureComponentType textureComponentType;
WGPUTextureFormat storageTextureFormat;
} WGPUBindGroupLayoutEntry;
typedef struct WGPUBlendDescriptor {
WGPUBlendOperation operation;
WGPUBlendFactor srcFactor;
WGPUBlendFactor dstFactor;
} WGPUBlendDescriptor;
typedef struct WGPUBufferDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUBufferUsageFlags usage;
uint64_t size;
bool mappedAtCreation;
} WGPUBufferDescriptor;
typedef struct WGPUColor {
float r;
float g;
float b;
float a;
} WGPUColor;
typedef struct WGPUCommandBufferDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPUCommandBufferDescriptor;
typedef struct WGPUCommandEncoderDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPUCommandEncoderDescriptor;
typedef struct WGPUComputePassDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPUComputePassDescriptor;
typedef struct WGPUDeviceDescriptor {
WGPUChainedStruct const * nextInChain;
} WGPUDeviceDescriptor;
typedef struct WGPUExtent3D {
uint32_t width;
uint32_t height;
uint32_t depth;
} WGPUExtent3D;
typedef struct WGPUFenceDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
uint64_t initialValue;
} WGPUFenceDescriptor;
typedef struct WGPUInstanceDescriptor {
WGPUChainedStruct const * nextInChain;
} WGPUInstanceDescriptor;
typedef struct WGPUOrigin3D {
uint32_t x;
uint32_t y;
uint32_t z;
} WGPUOrigin3D;
typedef struct WGPUPipelineLayoutDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
uint32_t bindGroupLayoutCount;
WGPUBindGroupLayout const * bindGroupLayouts;
} WGPUPipelineLayoutDescriptor;
typedef struct WGPUProgrammableStageDescriptor {
WGPUChainedStruct const * nextInChain;
WGPUShaderModule module;
char const * entryPoint;
} WGPUProgrammableStageDescriptor;
typedef struct WGPUQuerySetDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUQueryType type;
uint32_t count;
WGPUPipelineStatisticName const * pipelineStatistics;
uint32_t pipelineStatisticsCount;
} WGPUQuerySetDescriptor;
typedef struct WGPURasterizationStateDescriptor {
WGPUChainedStruct const * nextInChain;
WGPUFrontFace frontFace;
WGPUCullMode cullMode;
int32_t depthBias;
float depthBiasSlopeScale;
float depthBiasClamp;
} WGPURasterizationStateDescriptor;
typedef struct WGPURenderBundleDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPURenderBundleDescriptor;
typedef struct WGPURenderBundleEncoderDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
uint32_t colorFormatsCount;
WGPUTextureFormat const * colorFormats;
WGPUTextureFormat depthStencilFormat;
uint32_t sampleCount;
} WGPURenderBundleEncoderDescriptor;
typedef struct WGPURenderPassDepthStencilAttachmentDescriptor {
WGPUTextureView attachment;
WGPULoadOp depthLoadOp;
WGPUStoreOp depthStoreOp;
float clearDepth;
bool depthReadOnly;
WGPULoadOp stencilLoadOp;
WGPUStoreOp stencilStoreOp;
uint32_t clearStencil;
bool stencilReadOnly;
} WGPURenderPassDepthStencilAttachmentDescriptor;
typedef struct WGPURequestAdapterOptions {
WGPUChainedStruct const * nextInChain;
WGPUSurface compatibleSurface;
} WGPURequestAdapterOptions;
typedef struct WGPUSamplerDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUAddressMode addressModeU;
WGPUAddressMode addressModeV;
WGPUAddressMode addressModeW;
WGPUFilterMode magFilter;
WGPUFilterMode minFilter;
WGPUFilterMode mipmapFilter;
float lodMinClamp;
float lodMaxClamp;
WGPUCompareFunction compare;
} WGPUSamplerDescriptor;
typedef struct WGPUShaderModuleDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPUShaderModuleDescriptor;
typedef struct WGPUShaderModuleSPIRVDescriptor {
WGPUChainedStruct chain;
uint32_t codeSize;
uint32_t const * code;
} WGPUShaderModuleSPIRVDescriptor;
typedef struct WGPUShaderModuleWGSLDescriptor {
WGPUChainedStruct chain;
char const * source;
} WGPUShaderModuleWGSLDescriptor;
typedef struct WGPUStencilStateFaceDescriptor {
WGPUCompareFunction compare;
WGPUStencilOperation failOp;
WGPUStencilOperation depthFailOp;
WGPUStencilOperation passOp;
} WGPUStencilStateFaceDescriptor;
typedef struct WGPUSurfaceDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
} WGPUSurfaceDescriptor;
typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector {
WGPUChainedStruct chain;
char const * selector;
} WGPUSurfaceDescriptorFromCanvasHTMLSelector;
typedef struct WGPUSurfaceDescriptorFromMetalLayer {
WGPUChainedStruct chain;
void * layer;
} WGPUSurfaceDescriptorFromMetalLayer;
typedef struct WGPUSurfaceDescriptorFromWindowsHWND {
WGPUChainedStruct chain;
void * hinstance;
void * hwnd;
} WGPUSurfaceDescriptorFromWindowsHWND;
typedef struct WGPUSurfaceDescriptorFromXlib {
WGPUChainedStruct chain;
void * display;
uint32_t window;
} WGPUSurfaceDescriptorFromXlib;
typedef struct WGPUSwapChainDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUTextureUsageFlags usage;
WGPUTextureFormat format;
uint32_t width;
uint32_t height;
WGPUPresentMode presentMode;
} WGPUSwapChainDescriptor;
typedef struct WGPUTextureDataLayout {
WGPUChainedStruct const * nextInChain;
uint64_t offset;
uint32_t bytesPerRow;
uint32_t rowsPerImage;
} WGPUTextureDataLayout;
typedef struct WGPUTextureViewDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUTextureFormat format;
WGPUTextureViewDimension dimension;
uint32_t baseMipLevel;
uint32_t mipLevelCount;
uint32_t baseArrayLayer;
uint32_t arrayLayerCount;
WGPUTextureAspect aspect;
} WGPUTextureViewDescriptor;
typedef struct WGPUVertexAttributeDescriptor {
WGPUVertexFormat format;
uint64_t offset;
uint32_t shaderLocation;
} WGPUVertexAttributeDescriptor;
typedef struct WGPUBindGroupDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUBindGroupLayout layout;
uint32_t entryCount;
WGPUBindGroupEntry const * entries;
} WGPUBindGroupDescriptor;
typedef struct WGPUBindGroupLayoutDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
uint32_t entryCount;
WGPUBindGroupLayoutEntry const * entries;
} WGPUBindGroupLayoutDescriptor;
typedef struct WGPUBufferCopyView {
WGPUChainedStruct const * nextInChain;
WGPUTextureDataLayout layout;
WGPUBuffer buffer;
} WGPUBufferCopyView;
typedef struct WGPUColorStateDescriptor {
WGPUChainedStruct const * nextInChain;
WGPUTextureFormat format;
WGPUBlendDescriptor alphaBlend;
WGPUBlendDescriptor colorBlend;
WGPUColorWriteMaskFlags writeMask;
} WGPUColorStateDescriptor;
typedef struct WGPUComputePipelineDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUPipelineLayout layout;
WGPUProgrammableStageDescriptor computeStage;
} WGPUComputePipelineDescriptor;
typedef struct WGPUDepthStencilStateDescriptor {
WGPUChainedStruct const * nextInChain;
WGPUTextureFormat format;
bool depthWriteEnabled;
WGPUCompareFunction depthCompare;
WGPUStencilStateFaceDescriptor stencilFront;
WGPUStencilStateFaceDescriptor stencilBack;
uint32_t stencilReadMask;
uint32_t stencilWriteMask;
} WGPUDepthStencilStateDescriptor;
typedef struct WGPURenderPassColorAttachmentDescriptor {
WGPUTextureView attachment;
WGPUTextureView resolveTarget;
WGPULoadOp loadOp;
WGPUStoreOp storeOp;
WGPUColor clearColor;
} WGPURenderPassColorAttachmentDescriptor;
typedef struct WGPUTextureCopyView {
WGPUChainedStruct const * nextInChain;
WGPUTexture texture;
uint32_t mipLevel;
WGPUOrigin3D origin;
} WGPUTextureCopyView;
typedef struct WGPUTextureDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUTextureUsageFlags usage;
WGPUTextureDimension dimension;
WGPUExtent3D size;
WGPUTextureFormat format;
uint32_t mipLevelCount;
uint32_t sampleCount;
} WGPUTextureDescriptor;
typedef struct WGPUVertexBufferLayoutDescriptor {
uint64_t arrayStride;
WGPUInputStepMode stepMode;
uint32_t attributeCount;
WGPUVertexAttributeDescriptor const * attributes;
} WGPUVertexBufferLayoutDescriptor;
typedef struct WGPURenderPassDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
uint32_t colorAttachmentCount;
WGPURenderPassColorAttachmentDescriptor const * colorAttachments;
WGPURenderPassDepthStencilAttachmentDescriptor const * depthStencilAttachment;
WGPUQuerySet occlusionQuerySet;
} WGPURenderPassDescriptor;
typedef struct WGPUVertexStateDescriptor {
WGPUChainedStruct const * nextInChain;
WGPUIndexFormat indexFormat;
uint32_t vertexBufferCount;
WGPUVertexBufferLayoutDescriptor const * vertexBuffers;
} WGPUVertexStateDescriptor;
typedef struct WGPURenderPipelineDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUPipelineLayout layout;
WGPUProgrammableStageDescriptor vertexStage;
WGPUProgrammableStageDescriptor const * fragmentStage;
WGPUVertexStateDescriptor const * vertexState;
WGPUPrimitiveTopology primitiveTopology;
WGPURasterizationStateDescriptor const * rasterizationState;
uint32_t sampleCount;
WGPUDepthStencilStateDescriptor const * depthStencilState;
uint32_t colorStateCount;
WGPUColorStateDescriptor const * colorStates;
uint32_t sampleMask;
bool alphaToCoverageEnabled;
} WGPURenderPipelineDescriptor;
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata);
typedef void (*WGPUDeviceLostCallback)(char const * message, void * userdata);
typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata);
typedef void (*WGPUFenceOnCompletionCallback)(WGPUFenceCompletionStatus status, void * userdata);
typedef void (*WGPURequestAdapterCallback)(WGPUAdapter result, void * userdata);
typedef void (*WGPURequestDeviceCallback)(WGPUDevice result, void * userdata);
typedef void (*WGPUSurfaceGetPreferredFormatCallback)(WGPUTextureFormat format, void * userdata);
typedef void (*WGPUProc)(void);
#if !defined(WGPU_SKIP_PROCS)
typedef WGPUInstance (*WGPUProcCreateInstance)(WGPUInstanceDescriptor const * descriptor);
typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName);
// Procs of Adapter
typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties);
typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata);
// Procs of BindGroup
typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup);
typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup);
// Procs of BindGroupLayout
typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout);
typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout);
// Procs of Buffer
typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer);
typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size);
typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size);
typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata);
typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer);
typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer);
typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer);
// Procs of CommandBuffer
typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer);
typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer);
// Procs of CommandEncoder
typedef WGPUComputePassEncoder (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor);
typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor);
typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size);
typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUBufferCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize);
typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUBufferCopyView const * destination, WGPUExtent3D const * copySize);
typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize);
typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor);
typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel);
typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder);
typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel);
typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset);
typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder);
typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder);
// Procs of ComputePassEncoder
typedef void (*WGPUProcComputePassEncoderBeginPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
typedef void (*WGPUProcComputePassEncoderDispatch)(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z);
typedef void (*WGPUProcComputePassEncoderDispatchIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
typedef void (*WGPUProcComputePassEncoderEndPass)(WGPUComputePassEncoder computePassEncoder);
typedef void (*WGPUProcComputePassEncoderEndPipelineStatisticsQuery)(WGPUComputePassEncoder computePassEncoder);
typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel);
typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder);
typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel);
typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline);
typedef void (*WGPUProcComputePassEncoderWriteTimestamp)(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder);
typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder);
// Procs of ComputePipeline
typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex);
typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline);
typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline);
// Procs of Device
typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor);
typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor);
typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor);
typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor);
typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor);
typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor);
typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor);
typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor);
typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor);
typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPUSamplerDescriptor const * descriptor);
typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor);
typedef WGPUSwapChain (*WGPUProcDeviceCreateSwapChain)(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor);
typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor);
typedef WGPUQueue (*WGPUProcDeviceGetDefaultQueue)(WGPUDevice device);
typedef bool (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter);
typedef void (*WGPUProcDeviceSetDeviceLostCallback)(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata);
typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
typedef void (*WGPUProcDeviceReference)(WGPUDevice device);
typedef void (*WGPUProcDeviceRelease)(WGPUDevice device);
// Procs of Fence
typedef uint64_t (*WGPUProcFenceGetCompletedValue)(WGPUFence fence);
typedef void (*WGPUProcFenceOnCompletion)(WGPUFence fence, uint64_t value, WGPUFenceOnCompletionCallback callback, void * userdata);
typedef void (*WGPUProcFenceReference)(WGPUFence fence);
typedef void (*WGPUProcFenceRelease)(WGPUFence fence);
// Procs of Instance
typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor);
typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance);
typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata);
typedef void (*WGPUProcInstanceReference)(WGPUInstance instance);
typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance);
// Procs of PipelineLayout
typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout);
typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout);
// Procs of QuerySet
typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet);
typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet);
typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet);
// Procs of Queue
typedef WGPUFence (*WGPUProcQueueCreateFence)(WGPUQueue queue, WGPUFenceDescriptor const * descriptor);
typedef void (*WGPUProcQueueSignal)(WGPUQueue queue, WGPUFence fence, uint64_t signalValue);
typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands);
typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size);
typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUTextureCopyView const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize);
typedef void (*WGPUProcQueueReference)(WGPUQueue queue);
typedef void (*WGPUProcQueueRelease)(WGPUQueue queue);
// Procs of RenderBundle
typedef void (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle);
typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle);
// Procs of RenderBundleEncoder
typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor);
typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel);
typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder);
typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel);
typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderBundleEncoderSetIndexBufferWithFormat)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline);
typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder);
typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder renderBundleEncoder);
// Procs of RenderPassEncoder
typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex);
typedef void (*WGPUProcRenderPassEncoderBeginPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder);
typedef void (*WGPUProcRenderPassEncoderEndPass)(WGPURenderPassEncoder renderPassEncoder);
typedef void (*WGPUProcRenderPassEncoderEndPipelineStatisticsQuery)(WGPURenderPassEncoder renderPassEncoder);
typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles);
typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel);
typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder);
typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel);
typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
typedef void (*WGPUProcRenderPassEncoderSetBlendColor)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color);
typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderPassEncoderSetIndexBufferWithFormat)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline);
typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height);
typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference);
typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size);
typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth);
typedef void (*WGPUProcRenderPassEncoderWriteTimestamp)(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder);
typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder);
// Procs of RenderPipeline
typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex);
typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline);
typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline);
// Procs of Sampler
typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler);
typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler);
// Procs of ShaderModule
typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule);
typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule);
// Procs of Surface
typedef void (*WGPUProcSurfaceGetPreferredFormat)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceGetPreferredFormatCallback callback, void * userdata);
typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface);
typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface);
// Procs of SwapChain
typedef WGPUTextureView (*WGPUProcSwapChainGetCurrentTextureView)(WGPUSwapChain swapChain);
typedef void (*WGPUProcSwapChainPresent)(WGPUSwapChain swapChain);
typedef void (*WGPUProcSwapChainReference)(WGPUSwapChain swapChain);
typedef void (*WGPUProcSwapChainRelease)(WGPUSwapChain swapChain);
// Procs of Texture
typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor);
typedef void (*WGPUProcTextureDestroy)(WGPUTexture texture);
typedef void (*WGPUProcTextureReference)(WGPUTexture texture);
typedef void (*WGPUProcTextureRelease)(WGPUTexture texture);
// Procs of TextureView
typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView);
typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView);
#endif // !defined(WGPU_SKIP_PROCS)
#if !defined(WGPU_SKIP_DECLARATIONS)
WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor);
WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName);
// Methods of Adapter
WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties);
WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata);
// Methods of BindGroup
WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup);
WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup);
// Methods of BindGroupLayout
WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout);
WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout);
// Methods of Buffer
WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer);
WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size);
WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size);
WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata);
WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer);
WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer);
WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer);
// Methods of CommandBuffer
WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer);
WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer);
// Methods of CommandEncoder
WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor);
WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor);
WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size);
WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUBufferCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize);
WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUBufferCopyView const * destination, WGPUExtent3D const * copySize);
WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUTextureCopyView const * source, WGPUTextureCopyView const * destination, WGPUExtent3D const * copySize);
WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor);
WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel);
WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder);
WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel);
WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset);
WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder);
WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder);
// Methods of ComputePassEncoder
WGPU_EXPORT void wgpuComputePassEncoderBeginPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t x, uint32_t y, uint32_t z);
WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder);
WGPU_EXPORT void wgpuComputePassEncoderEndPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder);
WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel);
WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder);
WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel);
WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline);
WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder);
WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder);
// Methods of ComputePipeline
WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex);
WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline);
WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline);
// Methods of Device
WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor);
WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor);
WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor);
WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor);
WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor);
WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor);
WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor);
WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor);
WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor);
WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * descriptor);
WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor);
WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface, WGPUSwapChainDescriptor const * descriptor);
WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor);
WGPU_EXPORT WGPUQueue wgpuDeviceGetDefaultQueue(WGPUDevice device);
WGPU_EXPORT bool wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter);
WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata);
WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device);
WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device);
// Methods of Fence
WGPU_EXPORT uint64_t wgpuFenceGetCompletedValue(WGPUFence fence);
WGPU_EXPORT void wgpuFenceOnCompletion(WGPUFence fence, uint64_t value, WGPUFenceOnCompletionCallback callback, void * userdata);
WGPU_EXPORT void wgpuFenceReference(WGPUFence fence);
WGPU_EXPORT void wgpuFenceRelease(WGPUFence fence);
// Methods of Instance
WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor);
WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance);
WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata);
WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance);
WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance);
// Methods of PipelineLayout
WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout);
WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout);
// Methods of QuerySet
WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet);
WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet);
WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet);
// Methods of Queue
WGPU_EXPORT WGPUFence wgpuQueueCreateFence(WGPUQueue queue, WGPUFenceDescriptor const * descriptor);
WGPU_EXPORT void wgpuQueueSignal(WGPUQueue queue, WGPUFence fence, uint64_t signalValue);
WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands);
WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size);
WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUTextureCopyView const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize);
WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue);
WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue);
// Methods of RenderBundle
WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle);
WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle);
// Methods of RenderBundleEncoder
WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor);
WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel);
WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder);
WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel);
WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBufferWithFormat(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline);
WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder);
WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder);
// Methods of RenderPassEncoder
WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex);
WGPU_EXPORT void wgpuRenderPassEncoderBeginPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance);
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder);
WGPU_EXPORT void wgpuRenderPassEncoderEndPass(WGPURenderPassEncoder renderPassEncoder);
WGPU_EXPORT void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder);
WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles);
WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel);
WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder);
WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel);
WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
WGPU_EXPORT void wgpuRenderPassEncoderSetBlendColor(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color);
WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBufferWithFormat(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline);
WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height);
WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference);
WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size);
WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth);
WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder);
WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder);
// Methods of RenderPipeline
WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex);
WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline);
WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline);
// Methods of Sampler
WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler);
WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler);
// Methods of ShaderModule
WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule);
WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule);
// Methods of Surface
WGPU_EXPORT void wgpuSurfaceGetPreferredFormat(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceGetPreferredFormatCallback callback, void * userdata);
WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface);
WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface);
// Methods of SwapChain
WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain);
WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain);
WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain);
WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain);
// Methods of Texture
WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor);
WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture);
WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture);
WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture);
// Methods of TextureView
WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView);
WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView);
#endif // !defined(WGPU_SKIP_DECLARATIONS)
#ifdef __cplusplus
} // extern "C"
#endif
#endif // WEBGPU_H_
|