Skip to content

Commit 3ee6c33

Browse files
authored
Update webgl-rendering-context.md (#543)
1 parent c1b1793 commit 3ee6c33

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

documentation/docs/api/webgl-rendering-context.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type WebGLContextAttributes = {
1010
readonly antialias?: boolean;
1111
readonly depth?: boolean;
1212
readonly failIfMajorPerformanceCaveat?: boolean;
13-
readonly powerPreference?: "default" | "high-performance" | "low-power";
13+
readonly powerPreference?: 0 | 1 | 2;
1414
readonly premultipliedAlpha?: boolean;
1515
readonly preserveDrawingBuffer?: boolean;
1616
readonly stencil?: boolean;
@@ -43,6 +43,16 @@ If the value is true, context creation will fail if the implementation determine
4343

4444
Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. This may influence which GPU is used in a system with multiple GPUs. For example, a dual-GPU system might have one GPU that consumes less power at the expense of rendering performance. Note that this property is only a hint and a WebGL implementation may choose to ignore it. WebGL implementations use context lost and restored events to regulate power and memory consumption, regardless of the value of this attribute.
4545

46+
The value expected to be `0` for `default`, `1` for `low-power` or `2` for `high-performance`. See the following enum:
47+
48+
```json
49+
{
50+
0: 'default',
51+
1: 'low-power',
52+
2: 'high-performance'
53+
}
54+
```
55+
4656
#### Premultiplied alpha
4757

4858
If set to true, the color channels in the framebuffer will be stored premultipled by the alpha channel to improve performance.

0 commit comments

Comments
 (0)