Skip to content

Commit

Permalink
Fixes error scope tests for Linux/Intel (#3141)
Browse files Browse the repository at this point in the history
* Forces device to use adapter limits in error scope tests.

* Actually pass the adapter limit...

* Removes un-needed values

* Allow missing stacks

* Update src/webgpu/api/validation/error_scope.spec.ts

Co-authored-by: Kai Ninomiya <[email protected]>

---------

Co-authored-by: Kai Ninomiya <[email protected]>
  • Loading branch information
lokokung and kainino0x authored Nov 9, 2023
1 parent afc627f commit 04c09a8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/webgpu/api/validation/error_scope.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ class ErrorScopeTests extends Fixture {
const gpu = getGPU(this.rec);
const adapter = await gpu.requestAdapter();
assert(adapter !== null);
const device = await adapter.requestDevice();

// We need to max out the adapter limits related to texture dimensions to more reliably cause an
// OOM error when asked for it, so set that on the device now.
const device = this.trackForCleanup(
await adapter.requestDevice({
requiredLimits: {
maxTextureDimension2D: adapter.limits.maxTextureDimension2D,
},
})
);
assert(device !== null);
this._device = device;
}
Expand Down Expand Up @@ -146,7 +155,7 @@ Tests that popping an empty error scope stack should reject.
)
.fn(t => {
const promise = t.device.popErrorScope();
t.shouldReject('OperationError', promise);
t.shouldReject('OperationError', promise, { allowMissingStack: true });
});

g.test('parent_scope')
Expand Down Expand Up @@ -250,7 +259,7 @@ Tests that sibling error scopes need to be balanced.
{
// Trying to pop an additional non-existing scope should reject.
const promise = t.device.popErrorScope();
t.shouldReject('OperationError', promise);
t.shouldReject('OperationError', promise, { allowMissingStack: true });
}

const errors = await Promise.all(promises);
Expand Down Expand Up @@ -286,6 +295,6 @@ Tests that nested error scopes need to be balanced.
{
// Trying to pop an additional non-existing scope should reject.
const promise = t.device.popErrorScope();
t.shouldReject('OperationError', promise);
t.shouldReject('OperationError', promise, { allowMissingStack: true });
}
});

0 comments on commit 04c09a8

Please sign in to comment.