File: MetalBackendShaders.md

package info (click to toggle)
webkit2gtk 2.50.1-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 445,776 kB
  • sloc: cpp: 3,798,329; javascript: 197,914; ansic: 161,337; python: 49,141; asm: 21,987; ruby: 18,540; perl: 16,723; xml: 4,623; yacc: 2,360; sh: 2,246; java: 2,019; lex: 1,327; pascal: 366; makefile: 289
file content (33 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download | duplicates (24)
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
26
27
28
29
30
31
32
33
# Metal Backend Shaders

ANGLE's Metal backend provides a couple of features for inspecting the
Metal Shading Language (MSL) produced by ANGLE's shader translator.

## printMetalShaders

The [`printMetalShaders`
feature](https://chromium-review.googlesource.com/c/angle/angle/+/4480976),
which can be enabled in Chromium via the command line argument
`--enable-angle-features=printMetalShaders`, dumps the blob cache key
and translated MSL for all shaders compiled by ANGLE. This is
currently used to [regenerate precompiled
shaders](https://crbug.com/1423136) shipped with Chrome.

## Environment variable

Setting the environment variable `ANGLE_METAL_PRINT_MSL_ENABLE` to `1`
indicates to the Metal backend to print the translated shaders as
they're compiled:

```
export ANGLE_METAL_PRINT_MSL_ENABLE=1
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --use-angle=metal
```

To pass this environment to WebKit / Safari's GPU process, set the
environment variable `__XPC_ANGLE_METAL_PRINT_MSL_ENABLE` to `1`:

```
export __XPC_ANGLE_METAL_PRINT_MSL_ENABLE=1
/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview
```