vello/piet-wgsl
Raph Levien 876a3ad581 Combine info and bin_data buffers
We need to reduce the number of buffer bindings to 8 so it can run on
all WebGPU devices. The best candidate was to combine info and bin_data,
which are written by two different stages (draw_leaf and binning,
respectively), both read by coarse, and are unstructured, so the only
real shader change needed is to add the offset for the binning data.

I thought I was going to have to do a blit to make it fit, but
fortunately that wasn't needed.

Progress to #202
2022-11-29 17:39:22 -08:00
..
examples clip changes/blend group alpha 2022-11-29 13:28:25 -05:00
shader Combine info and bin_data buffers 2022-11-29 17:39:22 -08:00
src Combine info and bin_data buffers 2022-11-29 17:39:22 -08:00
Cargo.toml Libify piet-wgsl 2022-11-26 14:27:19 -05:00
README.md Initial commit of piet-wgsl 2022-10-24 15:08:14 -07:00

piet-wgsl

This crate is currently a highly experimental proof-of-concept port of the piet-gpu renderer to the WGSL shader language, so it could be run on WebGPU. Depending on how well it works out, it may become the authoritative source for piet-gpu.

The shaders are actually handlebars templates over WGSL, as it's important to share common data structures; it's likely we'll use the template mechanism to supply various parameters which are not supported by the WGSL language, for example to specify grayscale or RGBA buffer output for fine rasterization.

This crate also uses a very different approach to the GPU abstraction than piet-gpu. That is essentially a HAL that supports an immediate mode approach to creating resources and submitting commands. Here, we generate a Recording, which is basically a simple value type, then an Engine plays that recording to the actual GPU. The idea is that this can abstract easily over multiple GPU back-ends, without either the render logic needing to be polymorphic or having dynamic dispatch at the GPU abstraction. The goal is to be more agile.

Scene encoding is shared with piet-gpu, and currently uses piet-scene in the same repo with no changes.

This module is still an experimental work in progress. Contributions can be made with the same policy as the root repo, but expect things to change quickly.