Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/webgpu/api/validation/encoding/encoder_state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ TODO:
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { objectEquals } from '../../../../common/util/util.js';
import { AllFeaturesMaxLimitsGPUTest } from '../../../gpu_test.js';

class F extends AllFeaturesMaxLimitsGPUTest {
Expand Down Expand Up @@ -51,9 +50,6 @@ g.test('pass_end_invalid_order')
`
Test that beginning a {compute,render} pass before ending the previous {compute,render} pass
causes an error.

TODO(https://github.com/gpuweb/gpuweb/issues/5207): Resolve whether a validation error
should be raised immediately if '!firstPassEnd && endPasses = [1, 0]'.
`
)
.params(u =>
Expand All @@ -63,8 +59,6 @@ g.test('pass_end_invalid_order')
.beginSubcases()
.combine('firstPassEnd', [true, false])
.combine('endPasses', [[], [0], [1], [0, 1], [1, 0]])
// Don't end the first pass multiple times (that generates a validation error but doesn't invalidate the encoder)
.unless(p => p.firstPassEnd && p.endPasses.includes(0))
)
.fn(t => {
const { pass0Type, pass1Type, firstPassEnd, endPasses } = t.params;
Expand All @@ -83,15 +77,16 @@ g.test('pass_end_invalid_order')

const passes = [firstPass, secondPass];
for (const index of endPasses) {
passes[index].end();
const validEnd = (index === 0 && !firstPassEnd) || (index === 1 && firstPassEnd);
t.expectValidationError(() => {
passes[index].end();
}, !validEnd);
}

// If {endPasses} is '[1]' and {firstPass} ends, it's a control case.
const valid = firstPassEnd && objectEquals(endPasses, [1]);

const validFinish = firstPassEnd && endPasses.includes(1);
t.expectValidationError(() => {
encoder.finish();
}, !valid);
}, !validFinish);
});

g.test('call_after_successful_finish')
Expand Down