Skip to content

Commit eefe6f3

Browse files
authored
Check GPUAdapterInfo.isFallbackAdapter on explicit fallback request (#4483)
According to specification a fallback adapter may still be returned if forceFallbackAdapter is set to false and either no other appropriate adapter is available or the user agent chooses to return a fallback adapter. https://gpuweb.github.io/gpuweb/#dom-gpurequestadapteroptions-forcefallbackadapter Therefore, checking whether an adapter is a fallback adapter should only be performed if forceFallbackAdapter is true. Issue: #4480 Signed-off-by: Andrei Volykhin <[email protected]>
1 parent d03e3d9 commit eefe6f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/webgpu/api/operation/adapter/requestAdapter.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ g.test('requestAdapter')
124124
return;
125125
}
126126

127-
t.expect(adapter.info.isFallbackAdapter === Boolean(forceFallbackAdapter));
127+
// Only a fallback adapter may be returned when forceFallbackAdapter is true.
128+
if (forceFallbackAdapter === true) {
129+
t.expect(adapter.info.isFallbackAdapter === true);
130+
}
128131
await testAdapter(t, adapter);
129132
});
130133

0 commit comments

Comments
 (0)