This test is not testable in Chrome as of v123 because in Chrome maxBindGroupsPlusVertexBuffers
is equal
to maxBindGroups
+ maxVertexBuffers
which mean you can't generate something large enough to test.
To test the test itself though, you can paste this into the CTS and you'll also need to set the expected
value of maxBindGroupsPlusVertexBuffers
in capability_info.js
to 12
GPU.prototype.requestAdapter = (function (origFn) {
return async function (this: GPU, desc: GPURequestAdapterOptions = {}) {
const adapter = await origFn.call(this, desc);
Object.defineProperty(adapter.limits, 'maxBindGroupsPlusVertexBuffers', { value: 12 });
return adapter;
};
})(GPU.prototype.requestAdapter);
GPUAdapter.prototype.requestDevice = (function (origFn) {
return async function (this: GPUAdapter, desc: GPUDeviceDescriptor = {}) {
if (desc.requiredLimits?.maxBindGroupsPlusVertexBuffers > 12) {
throw new DOMException('too many', "OperationError");
}
const device = await origFn.call(this, desc);
Object.defineProperty(device.limits, 'maxBindGroupsPlusVertexBuffers', { value: 12 });
return device;
};
})(GPUAdapter.prototype.requestDevice);