gfx-rs/wgpu
wgpu-macros
wgpu-macros (wgpu-macros/) is a tiny proc-macro crate that re-exports the macro helpers used by the wgpu crate. It exists primarily because proc macros must live in their own crate; in practice the macros are very small.
Purpose
- Provide compile-time helpers consumed by
wgpu/src/macros.rsandwgpu/src/macros/. - Keep the macro implementation separate from the main
wgpucrate so it doesn't pollute the user-facing dependency surface.
Directory layout
wgpu-macros/
├── Cargo.toml
└── src/ # small, single-file crateWhat's inside
The macros are small and focused. They support code generation for vertex layouts and a few include_wgsl!-shaped helpers. The published wgpu::include_wgsl! macro is declared in wgpu/src/macros.rs and may use this crate as a helper.
Integration points
- Above:
wgpu(wgpu/src/macros/andwgpu/src/macros.rsre-export and use these macros). - Below:
proc-macro2,quote,syn— the standard proc-macro toolchain.
Entry points for modification
If you need a new macro for wgpu, decide whether it can be implemented as a macro_rules! in wgpu/src/macros.rs (preferred). Procedural macros require a recompilation of this crate even on small edits, so use them sparingly.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.