Skip to content

Commit

Permalink
Fix limits tests with new extra limits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greggman committed Jan 9, 2025
1 parent b5532d4 commit 9c1016b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 9c1016b

Please sign in to comment.