Skip to content

Commit

Permalink
Fix issue with Quest devices running in desktop mode
Browse files Browse the repository at this point in the history
  • Loading branch information
puckey committed Jan 31, 2024
1 parent 3f05c05 commit bcd6b3b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { OutdatedBenchmarksError } from './internal/error';
import { getGPUVersion } from './internal/getGPUVersion';
import {
getLevenshteinDistance,
tokenizeForLevenshteinDistance
tokenizeForLevenshteinDistance,
} from './internal/getLevenshteinDistance';
import { getWebGLContext } from './internal/getWebGLContext';
import { isSSR } from './internal/ssr';
Expand Down Expand Up @@ -144,7 +144,15 @@ export const getGPUTier = async ({
'powervr',
'samsung',
] as const)
: (['intel', 'apple', 'amd', 'radeon', 'nvidia', 'geforce'] as const);
: ([
'intel',
'apple',
'amd',
'radeon',
'nvidia',
'geforce',
'adreno',
] as const);
for (const type of types) {
if (renderer.includes(type)) {
return type;
Expand Down Expand Up @@ -216,10 +224,7 @@ export const getGPUTier = async ({
(match) =>
[
match,
getLevenshteinDistance(
tokenizedRenderer,
match[2]
),
getLevenshteinDistance(tokenizedRenderer, match[2]),
] as const
)
.sort(([, a], [, b]) => a - b)[0][0]
Expand Down Expand Up @@ -287,7 +292,9 @@ export const getGPUTier = async ({
return toResult(0, 'WEBGL_UNSUPPORTED');
}

const debugRendererInfo = deviceInfo?.isFirefox ? null : gl.getExtension('WEBGL_debug_renderer_info');
const debugRendererInfo = deviceInfo?.isFirefox
? null
: gl.getExtension('WEBGL_debug_renderer_info');

renderer = debugRendererInfo
? gl.getParameter(debugRendererInfo.UNMASKED_RENDERER_WEBGL)
Expand Down

0 comments on commit bcd6b3b

Please sign in to comment.