From 33c0d79ded594a35d041ef32a4aef3f6eba18194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Wed, 11 Dec 2024 09:39:51 +0100 Subject: [PATCH] Address feedback --- src/common/runtime/cmdline.ts | 1 + src/common/runtime/helper/utils_worker.ts | 2 +- src/common/runtime/server.ts | 1 + src/common/runtime/standalone.ts | 2 +- src/common/util/navigator_gpu.ts | 3 --- src/webgpu/api/operation/adapter/info.spec.ts | 1 + 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/runtime/cmdline.ts b/src/common/runtime/cmdline.ts index c1e0c28d17c1..b2d220ec8ef9 100644 --- a/src/common/runtime/cmdline.ts +++ b/src/common/runtime/cmdline.ts @@ -124,6 +124,7 @@ if (globalTestConfig.compatibility || globalTestConfig.forceFallbackAdapter) { // MAINTENANCE_TODO: remove the cast once compatibilityMode is officially added setDefaultRequestAdapterOptions({ compatibilityMode: globalTestConfig.compatibility, + featureLevel: globalTestConfig.compatibility ? 'compatibility' : 'core', forceFallbackAdapter: globalTestConfig.forceFallbackAdapter, } as GPURequestAdapterOptions); } diff --git a/src/common/runtime/helper/utils_worker.ts b/src/common/runtime/helper/utils_worker.ts index 13880635bca7..5886839f6c33 100644 --- a/src/common/runtime/helper/utils_worker.ts +++ b/src/common/runtime/helper/utils_worker.ts @@ -27,7 +27,7 @@ export function setupWorkerEnvironment(ctsOptions: CTSOptions): Logger { setDefaultRequestAdapterOptions({ ...(powerPreference && { powerPreference }), // MAINTENANCE_TODO: Change this to whatever the option ends up being - ...(compatibility && { compatibilityMode: true }), + ...(compatibility && { compatibilityMode: true, featureLevel: 'compatibility' }), }); } diff --git a/src/common/runtime/server.ts b/src/common/runtime/server.ts index 38ad04479430..d908ce89ba7a 100644 --- a/src/common/runtime/server.ts +++ b/src/common/runtime/server.ts @@ -123,6 +123,7 @@ if (globalTestConfig.compatibility || globalTestConfig.forceFallbackAdapter) { // MAINTENANCE_TODO: remove the cast once compatibilityMode is officially added setDefaultRequestAdapterOptions({ compatibilityMode: globalTestConfig.compatibility, + featureLevel: globalTestConfig.compatibility ? 'compatibility' : 'core', forceFallbackAdapter: globalTestConfig.forceFallbackAdapter, } as GPURequestAdapterOptions); } diff --git a/src/common/runtime/standalone.ts b/src/common/runtime/standalone.ts index 0305031cc790..a079ac28dd98 100644 --- a/src/common/runtime/standalone.ts +++ b/src/common/runtime/standalone.ts @@ -85,7 +85,7 @@ if (powerPreference || compatibility || forceFallbackAdapter) { setDefaultRequestAdapterOptions({ ...(powerPreference && { powerPreference }), // MAINTENANCE_TODO: Change this to whatever the option ends up being - ...(compatibility && { compatibilityMode: true }), + ...(compatibility && { compatibilityMode: true, featureLevel: 'compatibility' }), ...(forceFallbackAdapter && { forceFallbackAdapter: true }), }); } diff --git a/src/common/util/navigator_gpu.ts b/src/common/util/navigator_gpu.ts index 40242db746ab..4e58797097ed 100644 --- a/src/common/util/navigator_gpu.ts +++ b/src/common/util/navigator_gpu.ts @@ -43,9 +43,6 @@ export function setDefaultRequestAdapterOptions(options: GPURequestAdapterOption throw new Error('must call setDefaultRequestAdapterOptions before getGPU'); } defaultRequestAdapterOptions = { ...options }; - // MAINTENANCE_TODO: remove this once compatibilityMode is removed. - defaultRequestAdapterOptions.featureLevel = - 'compatibilityMode' in options && options.compatibilityMode ? 'compatibility' : 'core'; } export function getDefaultRequestAdapterOptions() { diff --git a/src/webgpu/api/operation/adapter/info.spec.ts b/src/webgpu/api/operation/adapter/info.spec.ts index 0d9e120015eb..a38528034554 100644 --- a/src/webgpu/api/operation/adapter/info.spec.ts +++ b/src/webgpu/api/operation/adapter/info.spec.ts @@ -21,6 +21,7 @@ g.test('adapter_info') .fn(async t => { const gpu = getGPU(t.rec); const adapter = await gpu.requestAdapter(); + console.log(adapter); assert(adapter !== null); const adapterInfo = adapter.info;