Skip to content

Commit

Permalink
Merge pull request #22 from beaufortfrancois/featureLevelAttr
Browse files Browse the repository at this point in the history
Use featureLevel GPUAdapter attribute
  • Loading branch information
beaufortfrancois authored Dec 19, 2024
2 parents 772b650 + 65b57de commit f88f181
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 f88f181

Please sign in to comment.