Skip to content

Commit 358f7e2

Browse files
committed
Test pass but not encoder ended in encoder_open_state
1 parent 776cad2 commit 358f7e2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/webgpu/api/validation/encoding/encoder_open_state.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,13 @@ g.test('render_pass_commands')
291291
`
292292
Test that functions of GPURenderPassEncoder generate a validation error if the encoder or the
293293
pass is already finished.
294-
295-
- TODO: Consider testing: nothing before command, end before command, end+finish before command.
296294
`
297295
)
298296
.params(u =>
299297
u
300298
.combine('command', kRenderPassEncoderCommands)
301299
.beginSubcases()
302-
.combine('finishBeforeCommand', [false, true])
300+
.combine('finishBeforeCommand', ['no', 'pass', 'encoder'])
303301
)
304302
.fn(t => {
305303
const { command, finishBeforeCommand } = t.params;
@@ -322,8 +320,10 @@ g.test('render_pass_commands')
322320

323321
const bindGroup = t.createBindGroupForTest();
324322

325-
if (finishBeforeCommand) {
323+
if (finishBeforeCommand !== 'no') {
326324
renderPass.end();
325+
}
326+
if (finishBeforeCommand === 'encoder') {
327327
encoder.finish();
328328
}
329329

@@ -437,7 +437,7 @@ g.test('render_pass_commands')
437437
default:
438438
unreachable();
439439
}
440-
}, finishBeforeCommand);
440+
}, finishBeforeCommand !== 'no');
441441
});
442442

443443
g.test('render_bundle_commands')
@@ -541,15 +541,13 @@ g.test('compute_pass_commands')
541541
`
542542
Test that functions of GPUComputePassEncoder generate a validation error if the encoder or the
543543
pass is already finished.
544-
545-
- TODO: Consider testing: nothing before command, end before command, end+finish before command.
546544
`
547545
)
548546
.params(u =>
549547
u
550548
.combine('command', kComputePassEncoderCommands)
551549
.beginSubcases()
552-
.combine('finishBeforeCommand', [false, true])
550+
.combine('finishBeforeCommand', ['no', 'pass', 'encoder'])
553551
)
554552
.fn(t => {
555553
const { command, finishBeforeCommand } = t.params;
@@ -566,8 +564,10 @@ g.test('compute_pass_commands')
566564

567565
const bindGroup = t.createBindGroupForTest();
568566

569-
if (finishBeforeCommand) {
567+
if (finishBeforeCommand !== 'no') {
570568
computePass.end();
569+
}
570+
if (finishBeforeCommand === 'encoder') {
571571
encoder.finish();
572572
}
573573

@@ -611,5 +611,5 @@ g.test('compute_pass_commands')
611611
default:
612612
unreachable();
613613
}
614-
}, finishBeforeCommand);
614+
}, finishBeforeCommand !== 'no');
615615
});

0 commit comments

Comments
 (0)