docs.rs failed to build webgpu-shim-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
WebGPU Shim
A thin shim layer that provides WebGPU-compatible C ABI interfaces on top of wgpu-native.
Problem
wgpu-native uses wgpu-core as its foundation, which means Textures and other resources cannot be directly shared between:
- A Rust application using the
wgpucrate - A C++ library expecting the standard WebGPU interface
This crate solves that interoperability problem.
Overview
This library:
- Downloads the official
webgpu.hheader - Generates Rust bindings using
bindgen - Wraps wgpu-native types to expose them with WebGPU-compatible ABIs
- Adds a thin conversion layer between wgpu and WebGPU types
Usage
Add to your Cargo.toml:
[]
= { = "0.1.0", = "path/to/webgpu-shim" }
The crate exposes:
- WebGPU-compatible type definitions (e.g.,
WGPUDevice,WGPUTexture) - Function bindings matching the WebGPU C API
Build Requirements
- Rust 2024 edition
bindgen(build dependency)- Clang/LLVM (for bindgen)
- Network access (to download
webgpu.hon first build)
License
Dual-licensed under:
- Apache License, Version 2.0
- MIT License
See the wgpu-native license for the base code this is derived from.
Related Projects
- wgpu-native - Native WebGPU implementation
- webgpu-headers - Official WebGPU C API headers
- wgpu - Rust WebGPU implementation