From 9c1016b2ce032a11a8198d52d2191a4a76c5f9ed Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Thu, 9 Jan 2025 09:57:41 -0800 Subject: [PATCH] Fix limits tests with new extra limits The code was not checking if the limits actually exist. If they don't then the test would fail. Since these limits have not been added to the spec, they're still being discussed, they are not required and therefore the tests should still run without them. --- .../validation/capability_checks/limits/limit_utils.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/webgpu/api/validation/capability_checks/limits/limit_utils.ts b/src/webgpu/api/validation/capability_checks/limits/limit_utils.ts index 8ab31f04b9d..3f72b90901e 100644 --- a/src/webgpu/api/validation/capability_checks/limits/limit_utils.ts +++ b/src/webgpu/api/validation/capability_checks/limits/limit_utils.ts @@ -417,10 +417,12 @@ export class LimitTestsImpl extends GPUTestBase { if (extraLimits) { for (const [extraLimitStr, limitMode] of Object.entries(extraLimits)) { const extraLimit = extraLimitStr as GPUSupportedLimit; - requiredLimits[extraLimit] = - limitMode === 'defaultLimit' - ? getDefaultLimitForAdapter(adapter, extraLimit) - : (adapter.limits[extraLimit] as number); + if (adapter.limits[extraLimit] !== undefined) { + requiredLimits[extraLimit] = + limitMode === 'defaultLimit' + ? getDefaultLimitForAdapter(adapter, extraLimit) + : (adapter.limits[extraLimit] as number); + } } }