diff --git a/.github/copyright.sh b/.github/copyright.sh
index b090c0879..07de4c95f 100755
--- a/.github/copyright.sh
+++ b/.github/copyright.sh
@@ -7,7 +7,7 @@
# -g "!src/special_directory"
# Check all the standard Rust source files
-output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Vello Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT$\n\n" --files-without-match --multiline -g "*.rs" -g "!{shader,crates/shaders/src/cpu}" .)
+output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Vello Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT$\n\n" --files-without-match --multiline -g "*.rs" -g "!vello_shaders/{shader,src/cpu}" .)
if [ -n "$output" ]; then
echo -e "The following files lack the correct copyright header:\n"
@@ -20,7 +20,7 @@ if [ -n "$output" ]; then
fi
# Check all the shaders, both WGSL and CPU shaders in Rust, as they also have Unlicense
-output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Vello Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT OR Unlicense$\n\n" --files-without-match --multiline -g "{shader,crates/shaders/src/cpu}/**/*.{rs,wgsl}" .)
+output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Vello Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT OR Unlicense$\n\n" --files-without-match --multiline -g "vello_shaders/{shader,src/cpu}/**/*.{rs,wgsl}" .)
if [ -n "$output" ]; then
echo -e "The following shader files lack the correct copyright header:\n"
diff --git a/.vscode/settings.json b/.vscode/settings.json
index bda7c8724..6be52f083 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,18 +1,18 @@
{
"wgsl-analyzer.customImports": {
- "bbox": "${workspaceFolder}/shader/shared/bbox.wgsl",
- "blend": "${workspaceFolder}/shader/shared/blend.wgsl",
- "bump": "${workspaceFolder}/shader/shared/bump.wgsl",
- "clip": "${workspaceFolder}/shader/shared/clip.wgsl",
- "config": "${workspaceFolder}/shader/shared/config.wgsl",
- "cubic": "${workspaceFolder}/shader/shared/cubic.wgsl",
- "drawtag": "${workspaceFolder}/shader/shared/drawtag.wgsl",
- "pathtag": "${workspaceFolder}/shader/shared/pathtag.wgsl",
- "ptcl": "${workspaceFolder}/shader/shared/ptcl.wgsl",
- "segment": "${workspaceFolder}/shader/shared/segment.wgsl",
- "tile": "${workspaceFolder}/shader/shared/tile.wgsl",
- "transform": "${workspaceFolder}/shader/shared/transform.wgsl",
- "util": "${workspaceFolder}/shader/shared/util.wgsl"
+ "bbox": "${workspaceFolder}/vello_shaders/shader/shared/bbox.wgsl",
+ "blend": "${workspaceFolder}/vello_shaders/shader/shared/blend.wgsl",
+ "bump": "${workspaceFolder}/vello_shaders/shader/shared/bump.wgsl",
+ "clip": "${workspaceFolder}/vello_shaders/shader/shared/clip.wgsl",
+ "config": "${workspaceFolder}/vello_shaders/shader/shared/config.wgsl",
+ "cubic": "${workspaceFolder}/vello_shaders/shader/shared/cubic.wgsl",
+ "drawtag": "${workspaceFolder}/vello_shaders/shader/shared/drawtag.wgsl",
+ "pathtag": "${workspaceFolder}/vello_shaders/shader/shared/pathtag.wgsl",
+ "ptcl": "${workspaceFolder}/vello_shaders/shader/shared/ptcl.wgsl",
+ "segment": "${workspaceFolder}/vello_shaders/shader/shared/segment.wgsl",
+ "tile": "${workspaceFolder}/vello_shaders/shader/shared/tile.wgsl",
+ "transform": "${workspaceFolder}/vello_shaders/shader/shared/transform.wgsl",
+ "util": "${workspaceFolder}/vello_shaders/shader/shared/util.wgsl"
},
"wgsl-analyzer.diagnostics.nagaVersion": "main",
"wgsl-analyzer.preprocessor.shaderDefs": [
diff --git a/README.md b/README.md
index 077c024bf..f9e27ee0f 100644
--- a/README.md
+++ b/README.md
@@ -274,9 +274,9 @@ Licensed under either of
at your option.
-In addition, all files in the [`shader`](https://github.com/linebender/vello/tree/main/shader) and [`src/cpu_shader`](https://github.com/linebender/vello/tree/main/src/cpu_shader)
+In addition, all files in the [`vello_shaders/shader`](https://github.com/linebender/vello/tree/main/vello_shaders/shader) and [`vello_shaders/src/cpu`](https://github.com/linebender/vello/tree/main/vello_shaders/src/cpu)
directories and subdirectories thereof are alternatively licensed under
-the Unlicense ([shader/UNLICENSE](https://github.com/linebender/vello/tree/main/shader/UNLICENSE) or ).
+the Unlicense ([shader/UNLICENSE](https://github.com/linebender/vello/tree/main/vello_shaders/shader/UNLICENSE) or ).
For clarity, these files are also licensed under either of the above licenses.
The intent is for this research to be used in as broad a context as possible.
diff --git a/doc/ARCHITECTURE.md b/doc/ARCHITECTURE.md
index 7abbe3740..f0650f5ee 100644
--- a/doc/ARCHITECTURE.md
+++ b/doc/ARCHITECTURE.md
@@ -31,16 +31,15 @@ Our current priority is to fill in missing features and to fix rendering artifac
The repository is structured as such:
-- `crates/`
- - `encoding/` - Types that represent the data that needs to be rendered.
- - `shaders/` - Infrastructure to preprocess and cross-compile shaders at compile time; see "Shader templating".
- - `cpu/` - Functions that perform the same work as their equivalently-named WGSL shaders for the CPU fallbacks. The name is a bit loose; they're "shaders" in the sense that they work on resource bindings with the exact same layout as actual GPU shaders.
- - `tests/` - Helper code for writing tests; current has a single smoke test and not much else.
- `doc/` - Various documents detailing the vision for Vello as it was developed. This directory should probably be refactored away; adding to it not recommended.
-- `examples/` - Example projects using Vello. Each example is its own crate, with its own dependencies. The simplest example is the `shapes` one.
-- `shader/` - This is where the magic happens. WGSL shaders that define the compute operations (often variations of prefix sum) that Vello does to render a scene.
- - `shared/` - Shared types, functions and constants included in other shaders through non-standard `#import` preprocessor directives (see "Shader templating").
-- `src/` - Code for the main `vello` crate.
+- `examples/` - Example projects using Vello. Each example is its own crate, with its own dependencies. The simplest example is called `simple`.
+- `vello/` - Code for the main `vello` crate.
+- `vello_encoding/` - Types that represent the data that needs to be rendered.
+- `vello_shaders/` - Infrastructure to preprocess and cross-compile shaders at compile time; see "Shader templating".
+ - `shader/` - This is where the magic happens. WGSL shaders that define the compute operations (often variations of prefix sum) that Vello does to render a scene.
+ - `shared/` - Shared types, functions and constants included in other shaders through non-standard `#import` preprocessor directives (see "Shader templating").
+ - `cpu/` - Functions that perform the same work as their equivalently-named WGSL shaders for the CPU fallbacks. The name is a bit loose; they're "shaders" in the sense that they work on resource bindings with the exact same layout as actual GPU shaders.
+- `vello_tests/` - Helper code for writing tests; current has a single smoke test and not much else.
## Shader templating
@@ -81,7 +80,7 @@ In principle, other backends could consume a `Recording`, but for now the only i
### CPU rendering
-The code in `cpu_shader/*.rs` and `cpu_dispatch.rs` provides *some* support for CPU-side rendering. It's in an awkward place right now:
+The code in `vello_shaders/src/cpu/*.rs` and `vello_shaders/src/cpu.rs` provides *some* support for CPU-side rendering. It's in an awkward place right now:
- It's called through WgpuEngine, so the dependency on wgpu is still there.
- Fine rasterization (the part at the end that puts pixels on screen) doesn't work in CPU yet (see [#386]).
diff --git a/vello/README.md b/vello/README.md
new file mode 100644
index 000000000..f9e27ee0f
--- /dev/null
+++ b/vello/README.md
@@ -0,0 +1,296 @@
+
+
+# Vello
+
+**An experimental GPU compute-centric 2D renderer**
+
+[![Linebender Zulip](https://img.shields.io/badge/Linebender-%23gpu-blue?logo=Zulip)](https://xi.zulipchat.com/#narrow/stream/197075-gpu)
+[![dependency status](https://deps.rs/repo/github/linebender/vello/status.svg)](https://deps.rs/repo/github/linebender/vello)
+[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](#license)
+[![wgpu version](https://img.shields.io/badge/wgpu-v0.20.0-orange.svg)](https://crates.io/crates/wgpu)
+
+[![Crates.io](https://img.shields.io/crates/v/vello.svg)](https://crates.io/crates/vello)
+[![Docs](https://docs.rs/vello/badge.svg)](https://docs.rs/vello)
+[![Build status](https://github.com/linebender/vello/workflows/CI/badge.svg)](https://github.com/linebender/vello/actions)
+
+
+
+Vello is an experimental 2D graphics rendering engine written in Rust, with a focus on GPU compute.
+It can draw large 2D scenes with interactive or near-interactive performance, using [`wgpu`] for GPU access.
+
+Quickstart to run an example program:
+
+```shell
+cargo run -p with_winit
+```
+
+![image](https://github.com/linebender/vello/assets/8573618/cc2b742e-2135-4b70-8051-c49aeddb5d19)
+
+It is used as the rendering backend for [Xilem], a Rust GUI toolkit.
+
+> [!WARNING]
+> Vello can currently be considered in an alpha state. In particular, we're still working on the following:
+>
+> - [Implementing blur and filter effects](https://github.com/linebender/vello/issues/476).
+> - [Conflations artifacts](https://github.com/linebender/vello/issues/49).
+> - [GPU memory allocation strategy](https://github.com/linebender/vello/issues/366)
+> - [Glyph caching](https://github.com/linebender/vello/issues/204)
+
+## Motivation
+
+Vello is meant to fill the same place in the graphics stack as other vector graphics renderers like [Skia](https://skia.org/), [Cairo](https://www.cairographics.org/), and its predecessor project [Piet](https://github.com/linebender/piet).
+On a basic level, that means it provides tools to render shapes, images, gradients, text, etc, using a PostScript-inspired API, the same that powers SVG files and [the browser `