|
| 1 | +# elicit_wgpu |
| 2 | + |
| 3 | +`elicit_wgpu` is the [elicitation] shadow crate for [wgpu]. All tools are **emit-only**: they |
| 4 | +generate idiomatic Rust code snippets for GPU applications. No GPU device is created or accessed |
| 5 | +at runtime — no `wgpu::Device`, surface, or buffer lives in the MCP server process. |
| 6 | + |
| 7 | +## Plugins |
| 8 | + |
| 9 | +| Plugin | Namespace | Tools | Coverage | |
| 10 | +|---|---|---|---| |
| 11 | +| `WgpuInitPlugin` | `wgpu_init__*` | 4 | Instance, adapter, device, surface configuration | |
| 12 | +| `WgpuResourcePlugin` | `wgpu_resource__*` | 3 | Buffer, texture, and sampler descriptors | |
| 13 | +| `WgpuPipelinePlugin` | `wgpu_pipeline__*` | 4 | Render pipeline state descriptors | |
| 14 | +| `WgpuShaderPlugin` | `wgpu_shader__*` | 3 | Shader module and vertex/fragment stage | |
| 15 | +| `WgpuComputePlugin` | `wgpu_compute__*` | 3 | Compute pipeline, dispatch, bind group layout | |
| 16 | + |
| 17 | +## Tool reference |
| 18 | + |
| 19 | +### `wgpu_init__*` |
| 20 | + |
| 21 | +| Tool | Description | |
| 22 | +|---|---| |
| 23 | +| `instance` | Generate code to create a `wgpu::Instance` | |
| 24 | +| `adapter_request` | Generate `instance.request_adapter(...)` code | |
| 25 | +| `device_request` | Generate `adapter.request_device(...)` code yielding `(Device, Queue)` | |
| 26 | +| `surface_config` | Generate a `wgpu::SurfaceConfiguration` struct literal | |
| 27 | + |
| 28 | +### `wgpu_resource__*` |
| 29 | + |
| 30 | +| Tool | Description | |
| 31 | +|---|---| |
| 32 | +| `buffer_desc` | Generate a `wgpu::BufferDescriptor` struct literal | |
| 33 | +| `texture_desc` | Generate a `wgpu::TextureDescriptor` struct literal | |
| 34 | +| `sampler_desc` | Generate a `wgpu::SamplerDescriptor` struct literal | |
| 35 | + |
| 36 | +### `wgpu_pipeline__*` |
| 37 | + |
| 38 | +| Tool | Description | |
| 39 | +|---|---| |
| 40 | +| `primitive_state` | Generate a `wgpu::PrimitiveState` for rasterization configuration | |
| 41 | +| `blend_state` | Generate a `wgpu::BlendState` with color and alpha blend components | |
| 42 | +| `color_target_state` | Generate a `wgpu::ColorTargetState` for a render pass attachment | |
| 43 | +| `render_pipeline_desc` | Generate a `wgpu::RenderPipelineDescriptor` block | |
| 44 | + |
| 45 | +### `wgpu_shader__*` |
| 46 | + |
| 47 | +| Tool | Description | |
| 48 | +|---|---| |
| 49 | +| `module_inline` | Generate code to create a `wgpu::ShaderModule` from an inline WGSL string | |
| 50 | +| `vertex_state` | Generate a `wgpu::VertexState` referencing a shader module variable | |
| 51 | +| `fragment_state` | Generate a `wgpu::FragmentState` referencing a shader module and targets | |
| 52 | + |
| 53 | +### `wgpu_compute__*` |
| 54 | + |
| 55 | +| Tool | Description | |
| 56 | +|---|---| |
| 57 | +| `pipeline_desc` | Generate a `wgpu::ComputePipelineDescriptor` code block | |
| 58 | +| `dispatch` | Generate a `compute_pass.dispatch_workgroups(x, y, z)` call | |
| 59 | +| `bind_group_layout_entry` | Generate a `wgpu::BindGroupLayoutEntry` for a buffer binding | |
| 60 | + |
| 61 | +## Usage |
| 62 | + |
| 63 | +```toml |
| 64 | +[dependencies] |
| 65 | +elicit_wgpu = "0.11" |
| 66 | +``` |
| 67 | + |
| 68 | +```rust |
| 69 | +use elicit_wgpu::{ |
| 70 | + WgpuInitPlugin, WgpuResourcePlugin, |
| 71 | + WgpuPipelinePlugin, WgpuShaderPlugin, WgpuComputePlugin, |
| 72 | +}; |
| 73 | + |
| 74 | +let server = server |
| 75 | + .register_plugin(WgpuInitPlugin::new()) |
| 76 | + .register_plugin(WgpuResourcePlugin::new()) |
| 77 | + .register_plugin(WgpuPipelinePlugin::new()) |
| 78 | + .register_plugin(WgpuShaderPlugin::new()) |
| 79 | + .register_plugin(WgpuComputePlugin::new()); |
| 80 | +``` |
| 81 | + |
| 82 | +[elicitation]: https://crates.io/crates/elicitation |
| 83 | +[wgpu]: https://crates.io/crates/wgpu |
0 commit comments