aboutsummaryrefslogtreecommitdiff
path: root/vendor/gioui.org/cpu/README.md
blob: 4244fe029419a68b0b3ebf1a2bc84e7da90b71d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Compile and run compute programs on CPU

This projects contains the compiler for turning Vulkan SPIR-V compute shaders
into binaries for arm64, arm or amd64, using
[SwiftShader](https://github.com/eliasnaur/swiftshader) with a few
modifications. A runtime implemented in C and Go is available for running the
resulting binaries.

The primary use is to support a CPU-based rendering fallback for
[Gio](https://gioui.org). In particular, the `gioui.org/shader/piet` package
contains arm, arm64, amd64 binaries for
[piet-gpu](https://github.com/linebender/piet-gpu).

# Compiling and running shaders

The `init.sh` script clones the modifed SwiftShader projects and builds it for
64-bit and 32-bit. SwiftShader is not designed to cross-compile which is why a
32-bit build is needed to compile shaders for arm.

The `example/run.sh` script demonstrates compiling and running a simple compute
program.

## Issues and contributions

See the [Gio contribution guide](https://gioui.org/doc/contribute).