File: MetalBackendShaders.md

package info (click to toggle)
webkit2gtk 2.51.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 457,708 kB
  • sloc: cpp: 3,884,629; javascript: 198,661; ansic: 165,298; python: 49,171; asm: 21,849; ruby: 18,095; perl: 16,914; xml: 4,623; sh: 2,397; yacc: 2,356; java: 2,019; lex: 1,330; pascal: 372; makefile: 197
file content (33 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download | duplicates (26)
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
```