summaryrefslogtreecommitdiffstats
path: root/gfx/wgpu_bindings/cbindgen.toml
blob: 3ba8399a1ae92ef9eb9bf14787a2cf4f90287b74 (plain)
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
header = """/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */"""
autogen_warning = """/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
 *
 * This file is generated based on the configuration in
 * `gfx/wgpu_bindings/moz.build`, which directs the build system module
 * `build/RunCbindgen.py` to run the following command at the top of
 * the object file directory:
 *
 *     $CBINDGEN $TOPSRCDIR --lockfile $TOPSRCDIR/Cargo.lock --crate wgpu_bindings --metadata config/cbindgen-metadata.json --cpp-compat > gfx/wgpu_bindings/wgpu_ffi_generated.h
 *
 * where:
 * - $TOPSRCDIR is the top of the Firefox source tree, and
 * - $CBINDGEN is the path to the cbindgen executable provided by mozbuild (the exact version often matters)
 */

#include "nsString.h"

struct WGPUByteBuf;
typedef uint64_t WGPUNonZeroU64;
typedef uint64_t WGPUOption_BufferSize;
typedef uint32_t WGPUOption_NonZeroU32;
typedef uint8_t WGPUOption_NonZeroU8;
typedef uint64_t WGPUOption_AdapterId;
typedef uint64_t WGPUOption_BufferId;
typedef uint64_t WGPUOption_PipelineLayoutId;
typedef uint64_t WGPUOption_BindGroupLayoutId;
typedef uint64_t WGPUOption_SamplerId;
typedef uint64_t WGPUOption_SurfaceId;
typedef uint64_t WGPUOption_TextureViewId;
typedef uint64_t WGPUOption_QuerySetId;

typedef uint64_t WGPUAdapterId;
typedef uint64_t WGPUBindGroupId;
typedef uint64_t WGPUBindGroupLayoutId;
typedef uint64_t WGPUBufferId;
typedef uint64_t WGPUCommandBufferId;
typedef uint64_t WGPUCommandEncoderId;
typedef uint64_t WGPUComputePipelineId;
typedef uint64_t WGPUDeviceId;
typedef uint64_t WGPUPipelineLayoutId;
typedef uint64_t WGPUQuerySetId;
typedef uint64_t WGPUQueueId;
typedef uint64_t WGPURenderBundleId;
typedef uint64_t WGPURenderPipelineId;
typedef uint64_t WGPUSamplerId;
typedef uint64_t WGPUShaderModuleId;
typedef uint64_t WGPUStagingBufferId;
typedef uint64_t WGPUSurfaceId;
typedef uint64_t WGPUTextureId;
typedef uint64_t WGPUTextureViewId;
"""
include_version = true
braces = "SameLine"
line_length = 100
tab_width = 2
language = "C"
style = "tag"

[export]
prefix = "WGPU"
renaming_overrides_prefixing = true
exclude = [
	"Option_AdapterId", "Option_BufferId", "Option_PipelineLayoutId", "Option_BindGroupLayoutId",
	"Option_SamplerId", "Option_SurfaceId", "Option_TextureViewId",
	"Option_BufferSize", "Option_NonZeroU32", "Option_NonZeroU8",
	"ANativeWindow_setBuffersGeometry", "Option_QuerySetId",
]
include = ["BufferUsages"]

[export.rename]
"nsString" = "nsString"
"nsCString" = "nsCString"
"nsAString" = "nsAString"
"nsACString" = "nsACString"
"nsStringRepr" = "nsString"
"BufferDescriptor______nsACString" = "WGPUBufferDescriptor"
"CommandBufferDescriptor______nsACString" = "WGPUCommandBufferDescriptor"
"CommandEncoderDescriptor______nsACString" = "WGPUCommandEncoderDescriptor"
"RenderBundleDescriptor______nsACString" = "WGPURenderBundleDescriptor"
"DeviceDescriptor______nsACString" = "WGPUDeviceDescriptor"
"TextureDescriptor______nsACString__FfiSlice_TextureFormat" = "WGPUTextureDescriptor"
"SamplerDescriptor______nsACString" = "WGPUSamplerDescriptor"
"AdapterInformation_nsString" = "WGPUAdapterInformation"

[parse]
parse_deps = true
include = ["wgpu-core", "wgpu-types", "wgpu-hal"]

extra_bindings = ["wgpu-core", "wgpu-types", "wgpu-hal"]

[fn]
prefix = "WGPU_INLINE"
postfix = "WGPU_FUNC"
args = "Vertical"
rename_args = "GeckoCase"

[struct]
derive_eq = true

[enum]
prefix_with_name = true
derive_helper_methods = true
add_sentinel = true

[macro_expansion]
bitflags = true

[defines]
"target_os = windows" = "XP_WIN"
"target_os = macos" = "XP_MACOSX"
"target_os = android" = "ANDROID"
"feature = id32" = "WGPU_FEATURE_ID32"