diff options
Diffstat (limited to 'gfx/wgpu_bindings/cbindgen.toml')
-rw-r--r-- | gfx/wgpu_bindings/cbindgen.toml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/gfx/wgpu_bindings/cbindgen.toml b/gfx/wgpu_bindings/cbindgen.toml new file mode 100644 index 0000000000..eb745b1aa1 --- /dev/null +++ b/gfx/wgpu_bindings/cbindgen.toml @@ -0,0 +1,73 @@ +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. + * To generate this file: + * 1. Get the latest cbindgen using `cargo install --force cbindgen` + * a. Alternatively, you can clone `https://github.com/eqrion/cbindgen` and use a tagged release + * 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --lockfile Cargo.lock --crate wgpu_bindings -o dom/webgpu/ffi/wgpu_ffi_generated.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; +""" +include_version = true +braces = "SameLine" +line_length = 100 +tab_width = 2 +language = "C" +style = "tag" + +[export] +prefix = "WGPU" +exclude = [ + "Option_AdapterId", "Option_BufferId", "Option_PipelineLayoutId", "Option_BindGroupLayoutId", + "Option_SamplerId", "Option_SurfaceId", "Option_TextureViewId", + "Option_BufferSize", "Option_NonZeroU32", "Option_NonZeroU8", +] + +[export.rename] +"BufferDescriptor_RawString" = "BufferDescriptor" +"CommandBufferDescriptor_RawString" = "CommandBufferDescriptor" +"CommandEncoderDescriptor_RawString" = "CommandEncoderDescriptor" +"DeviceDescriptor_RawString" = "DeviceDescriptor" +"TextureDescriptor_RawString" = "TextureDescriptor" +"SamplerDescriptor_RawString" = "SamplerDescriptor" + +[parse] +parse_deps = true +include = ["wgpu-core", "wgpu-types"] + +extra_bindings = ["wgpu-core", "wgpu-types"] + +[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" |