diff --git a/src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts b/src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts index 3ff293828b55..e9aa287c5a31 100644 --- a/src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts +++ b/src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts @@ -1,6 +1,15 @@ export const description = ` Tests that the final sample mask is the logical AND of all the relevant masks, including the rasterization mask, sample mask, fragment output mask, and alpha to coverage mask (when alphaToCoverageEnabled === true) + +TODO: add a test without a 0th color attachment (sparse color attachment), with different color attachments and alpha value output. +The cross-platform behavior is unknown. could be any of: +- coverage is always 100% +- coverage is always 0% +- it uses the first non-null attachment +- it's an error + +Details could be found at: https://github.com/gpuweb/cts/issues/2201 `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; @@ -242,7 +251,6 @@ class F extends GPUTest { GPUTextureUsage.RENDER_ATTACHMENT, } ); - this.trackForCleanup(this.sampleTexture); this.sampler = this.device.createSampler({ magFilter: 'nearest', @@ -693,7 +701,7 @@ color' <= color. }); // { < 0, = 0, = 1/16, = 2/16, ..., = 15/16, = 1, > 1 } - const alpha0ParamsArray = [-0.1, ...range(16, i => i / 16), 1.1]; + const alpha0ParamsArray = [-0.1, ...range(16, i => i / 16), 1.0, 1.1]; const colorResultPromises = []; const depthResultPromises = []; @@ -775,7 +783,7 @@ color' <= color. if (alpha0 <= 0) { const expected = getExpectedDataFn(sampleCount, rasterizationMask, sampleMask, 0x0); const check = checkElementsEqual(result.data, expected); - t.expect(check === undefined, `alpha <= 0 should have alphaToCoverageMask be 0x0`); + t.expectOK(check); } else if (alpha0 >= 1) { const expected = getExpectedDataFn( sampleCount, @@ -784,7 +792,7 @@ color' <= color. 0xffffffff ); const check = checkElementsEqual(result.data, expected); - t.expect(check === undefined, `alpha >= 1 should have alphaToCoverageMask be 0xffffffff`); + t.expectOK(check); } else { assert(i > 0); const prevResult = results[i - 1]; @@ -796,10 +804,7 @@ color' <= color. : value <= prevResult.data[index], {} ); - t.expect( - check === undefined, - `alpha greater than other alpha1 should have at least as many bits set to 1 as the mask for alpha1` - ); + t.expectOK(check); } }