webgpu-shim 0.1.0

Webgpu shim based on wgpu
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.

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 wgpu crate
  • A C++ library expecting the standard WebGPU interface

This crate solves that interoperability problem.

Overview

This library:

  • Downloads the official webgpu.h header
  • 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:

[dependencies]
webgpu-shim = { version = "0.1.0", path = "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.h on 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