{"id":18979561,"url":"https://github.com/xiaoiver/piet-wgpu","last_synced_at":"2026-04-11T13:30:15.172Z","repository":{"id":221375248,"uuid":"753492788","full_name":"xiaoiver/piet-wgpu","owner":"xiaoiver","description":"A backend for piet based on wgpu.","archived":false,"fork":false,"pushed_at":"2024-02-10T15:39:40.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T10:44:17.849Z","etag":null,"topics":["graphics2d","piet","wgpu"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaoiver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-06T08:28:51.000Z","updated_at":"2024-02-08T03:15:28.000Z","dependencies_parsed_at":"2024-02-10T16:47:07.649Z","dependency_job_id":null,"html_url":"https://github.com/xiaoiver/piet-wgpu","commit_stats":null,"previous_names":["xiaoiver/piet-wgpu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoiver%2Fpiet-wgpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoiver%2Fpiet-wgpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoiver%2Fpiet-wgpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoiver%2Fpiet-wgpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaoiver","download_url":"https://codeload.github.com/xiaoiver/piet-wgpu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985688,"owners_count":19729512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphics2d","piet","wgpu"],"created_at":"2024-11-08T15:44:04.993Z","updated_at":"2026-04-11T13:30:15.122Z","avatar_url":"https://github.com/xiaoiver.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# piet-wgpu\n\n![build status](https://github.com/xiaoiver/piet-wgpu/actions/workflows/ci.yml/badge.svg)\n\nThe [wgpu] backend for the [Piet 2D graphics abstraction].\n\nFeatures:\n\n- [x] Rely on [raw-window-handle] which provides a common interface that [winit] can easily talk with.\n- [x] Use [naga_oil] to combine and manipulate shader chunks.\n- [ ] Framegraph based on bevy.\n- [ ] Auto batching.\n- [ ] Use SDF for rendering Circle, Ellipse, Rect and Text.\n- [ ] Use GPU extruding for Line, Polyline and Path.\n\n## Getting Started\n\n```rust\n// Create renderer based on wgpu.\nlet mut renderer = WgpuRenderer::new(\n    \u0026window,\n    window.inner_size().width,\n    window.inner_size().height,\n).await;\n// Retrieve render context from renderer.\nlet mut ctx = Piet::new(\u0026mut renderer);\n\n// Use piet 2D API as usual.\nlet rect = Rect::new(0., 0., 100.0, 100.0);\nlet color = Color::rgb8(19, 86, 162);\nctx.fill(rect, \u0026color);\n\n// Release render context at last.\nctx.finish().unwrap();\nstd::mem::drop(ctx);\n```\n\n## Examples\n\n### with_winit\n\nIt rely on [raw-window-handle] which provides a common interface that winit can easily talk with.\n\n```bash\n$ cargo run -p with_winit\n```\n\n### wasm\n\nWe use [cargo-run-wasm] instead of [trunk] serving the wasm example. It seems that trunk has [ISSUE](https://github.com/trunk-rs/trunk/issues/445) with cargo workspace in watching mode.\n\n```bash\n$ cargo run_wasm -p with_winit\n```\n\n## Development\n\nUse [cargo-watch] like this:\n\n```bash\n$ cargo watch -x 'run_wasm -p with_winit'\n```\n\n## Other libs\n\n- [vello] An experimental GPU compute-centric 2D renderer.\n- [vger-rs] Use an uber shader to draw 2D SDF for Circle, Rect and Path.\n- [piet-wgpu] Tessellation with [lyon].\n- [rough-rs] Rust port of Rough.js.\n\n[Piet 2D graphics abstraction]: https://github.com/linebender/piet\n[wgpu]: https://github.com/gfx-rs/wgpu\n[naga_oil]: https://github.com/bevyengine/naga_oil\n[cargo-run-wasm]: https://github.com/rukai/cargo-run-wasm\n[trunk]: https://trunkrs.dev/\n[vello]: https://github.com/linebender/vello\n[vger-rs]: https://github.com/audulus/vger-rs\n[piet-wgpu]: https://github.com/lapce/piet-wgpu/\n[lyon]: https://github.com/nical/lyon\n[rough-rs]: https://github.com/orhanbalci/rough-rs\n[raw-window-handle]: https://github.com/rust-windowing/raw-window-handle\n[cargo-watch]: https://crates.io/crates/cargo-watch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaoiver%2Fpiet-wgpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaoiver%2Fpiet-wgpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaoiver%2Fpiet-wgpu/lists"}