summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/capability_checks/limits/maxTextureArrayLayers.spec.ts
blob: 7dc5fccc97d07c692fe9e565073e3dbb768634d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { kMaximumLimitBaseParams, makeLimitTestGroup } from './limit_utils.js';

const limit = 'maxTextureArrayLayers';
export const { g, description } = makeLimitTestGroup(limit);

g.test('createTexture,at_over')
  .desc(`Test using at and over ${limit} limit`)
  .params(kMaximumLimitBaseParams)
  .fn(async t => {
    const { limitTest, testValueName } = t.params;
    await t.testDeviceWithRequestedMaximumLimits(
      limitTest,
      testValueName,
      async ({ device, testValue, shouldError }) => {
        await t.testForValidationErrorWithPossibleOutOfMemoryError(() => {
          const texture = device.createTexture({
            size: [1, 1, testValue],
            format: 'rgba8unorm',
            usage: GPUTextureUsage.TEXTURE_BINDING,
          });
          if (!shouldError) {
            texture.destroy();
          }
        }, shouldError);
      }
    );
  });