Skip to content

Commit dbe4b1e

Browse files
committed
docs: document TierType result values in README
Consumers had to read the source to know what values existed. Adds a table enumerating BENCHMARK / FALLBACK / BENCHMARK_FETCH_FAILED / BLOCKLISTED / WEBGL_UNSUPPORTED / SSR with one-line explanations of what each means for tier and when they fire.
1 parent dc23a29 commit dbe4b1e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ const gpuTier = await getGPUTier();
5656

5757
Based on the reported `fps` the GPU is then classified into either `tier: 1 (>= 15 fps)`, `tier: 2 (>= 30 fps)` or `tier: 3 (>= 60 fps)`. The higher the tier the more graphically intensive workload you can offer to the user.
5858

59+
## Result types
60+
61+
`getGPUTier()` returns a `type` field indicating how the result was produced:
62+
63+
| `type` | Meaning |
64+
| ------------------------ | ------------------------------------------------------------------------------------------- |
65+
| `BENCHMARK` | Matched a benchmark entry; `fps` reflects the measured framerate for that GPU. |
66+
| `FALLBACK` | Renderer recognised but no benchmark match found. `tier` is a conservative default. |
67+
| `BENCHMARK_FETCH_FAILED` | Benchmark fetch failed (CDN outage, strict CSP, offline, etc.). Safe to retry. |
68+
| `BLOCKLISTED` | Renderer is on a known-bad list (drivers with severe issues). `tier` is always 0. |
69+
| `WEBGL_UNSUPPORTED` | No WebGL context could be created. `tier` is always 0. |
70+
| `SSR` | Running server-side — no `window`, detection skipped. |
71+
5972
## API
6073

6174
```ts

0 commit comments

Comments
 (0)