#gpu #graphics #2d


A hardware-accelerated 2D graphics backend for piet using wgpu

6 releases

0.3.1 Oct 12, 2023
0.3.0 Jul 29, 2023
0.2.2 May 27, 2023
0.1.1 May 7, 2023

#197 in Graphics APIs

Download history 132/week @ 2023-07-30 32/week @ 2023-08-06 25/week @ 2023-08-13 17/week @ 2023-08-20 21/week @ 2023-08-27 28/week @ 2023-09-03 27/week @ 2023-09-10 21/week @ 2023-09-17 33/week @ 2023-09-24 23/week @ 2023-10-01 53/week @ 2023-10-08 13/week @ 2023-10-15 8/week @ 2023-10-22 16/week @ 2023-10-29 6/week @ 2023-11-05 17/week @ 2023-11-12

51 downloads per month
Used in theo

LGPL-3.0-or-later OR MPL-2.0

1.5K SLoC


A piet implementation based on wgpu.


piet-wgpu is free software: you can redistribute it and/or modify it under the terms of either:

  • GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  • Mozilla Public License as published by the Mozilla Foundation, version 2.

piet-wgpu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the Mozilla Public License for more details.

You should have received a copy of the GNU Lesser General Public License and the Mozilla Public License along with piet-wgpu. If not, see https://www.gnu.org/licenses/ or https://www.mozilla.org/en-US/MPL/2.0/.


A GPU-accelerated 2D graphics backend for piet that uses the wgpu crate.

This crate follows the wgpu middleware pattern, but in a somewhat unique way.

  • The user creates the WgpuContext by calling new() with a device and expected texture format.
  • Before rendering, the user creates a RenderContext by calling prepare() on the WgpuContext with a Device and a Queue. prepare() returns the context, which is expected to be written to.
  • Finally, by calling render on the WgpuContext, the user renders all of the material that was written to the RenderContext using the piet API.


~826K SLoC