Skip to content

Commit

Permalink
Use featureLevel GPUAdapter attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Dec 19, 2024
1 parent 772b650 commit 65b57de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,11 @@ function parseAdapterFlags(adapter) {
const flags = {
'isFallbackAdapter': adapter.isFallbackAdapter,
};
if ('featureLevel' in adapter) {
flags.featureLevel = adapter.featureLevel;
}
if ('isCompatibilityMode' in adapter) {
flags.isCompatibilityMode = adapter.isCompatibilityMode
flags.isCompatibilityMode = adapter.isCompatibilityMode;
}
return flags;
}
Expand Down Expand Up @@ -593,7 +596,9 @@ async function checkWorker(parent, workerType) {
function adapterOptionsToDesc(requestAdapterOptions, adapter) {
const parts = [
...(adapter?.isFallbackAdapter ? ['fallback'] : []),
...(adapter?.isCompatibilityMode ? ['compatibilityMode'] : []),
...(adapter?.featureLevel == 'compatibility' || adapter?.isCompatibilityMode
? ['compatibilityMode']
: []),
];
return parts.length > 0
? parts.join(' ')
Expand Down

0 comments on commit 65b57de

Please sign in to comment.