Skip to content

Commit 12e1d0e

Browse files
Move isFallbackAdapter into GPUAdapterInfo (#171)
Following gpuweb/gpuweb#5099, this PR moves `isFallbackAdapter` into `GPUAdapterInfo`
1 parent a5655f0 commit 12e1d0e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

dist/index.d.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ interface GPURequestAdapterOptions {
13441344
* {@link GPURequestAdapterOptions#forceFallbackAdapter} is set to `false` and either no
13451345
* other appropriate adapter is available or the user agent chooses to return a
13461346
* fallback adapter. Developers that wish to prevent their applications from running on
1347-
* fallback adapters should check the {@link GPUAdapter}.{@link GPUAdapter#isFallbackAdapter}
1347+
* fallback adapters should check the {@link GPUAdapter#info}.{@link GPUAdapterInfo#isFallbackAdapter}
13481348
* attribute prior to requesting a {@link GPUDevice}.
13491349
*/
13501350
forceFallbackAdapter?: boolean;
@@ -1979,8 +1979,11 @@ interface GPUAdapter {
19791979
readonly info: GPUAdapterInfo;
19801980
/**
19811981
* Returns the value of {@link GPUAdapter#[[adapter]]}.{@link adapter#[[fallback]]}.
1982+
*
1983+
* @deprecated Use {@link GPUAdapterInfo#isFallbackAdapter}.
1984+
* (Note if it's not available, it will be `undefined` which is still falsy.)
19821985
*/
1983-
readonly isFallbackAdapter: boolean;
1986+
readonly isFallbackAdapter?: boolean;
19841987
/**
19851988
* Requests a device from the adapter.
19861989
* This is a one-time action: if a device is returned successfully,
@@ -2039,6 +2042,10 @@ interface GPUAdapterInfo {
20392042
* adapter.
20402043
*/
20412044
readonly subgroupMaxSize: number;
2045+
/**
2046+
* Whether the adapter is a fallback adapter.
2047+
**/
2048+
readonly isFallbackAdapter?: boolean;
20422049
}
20432050

20442051
declare var GPUAdapterInfo: {

0 commit comments

Comments
 (0)