@@ -291,15 +291,13 @@ g.test('render_pass_commands')
291
291
`
292
292
Test that functions of GPURenderPassEncoder generate a validation error if the encoder or the
293
293
pass is already finished.
294
-
295
- - TODO: Consider testing: nothing before command, end before command, end+finish before command.
296
294
`
297
295
)
298
296
. params ( u =>
299
297
u
300
298
. combine ( 'command' , kRenderPassEncoderCommands )
301
299
. beginSubcases ( )
302
- . combine ( 'finishBeforeCommand' , [ false , true ] )
300
+ . combine ( 'finishBeforeCommand' , [ 'no' , 'pass' , 'encoder' ] )
303
301
)
304
302
. fn ( t => {
305
303
const { command, finishBeforeCommand } = t . params ;
@@ -322,8 +320,10 @@ g.test('render_pass_commands')
322
320
323
321
const bindGroup = t . createBindGroupForTest ( ) ;
324
322
325
- if ( finishBeforeCommand ) {
323
+ if ( finishBeforeCommand !== 'no' ) {
326
324
renderPass . end ( ) ;
325
+ }
326
+ if ( finishBeforeCommand === 'encoder' ) {
327
327
encoder . finish ( ) ;
328
328
}
329
329
@@ -437,7 +437,7 @@ g.test('render_pass_commands')
437
437
default :
438
438
unreachable ( ) ;
439
439
}
440
- } , finishBeforeCommand ) ;
440
+ } , finishBeforeCommand !== 'no' ) ;
441
441
} ) ;
442
442
443
443
g . test ( 'render_bundle_commands' )
@@ -541,15 +541,13 @@ g.test('compute_pass_commands')
541
541
`
542
542
Test that functions of GPUComputePassEncoder generate a validation error if the encoder or the
543
543
pass is already finished.
544
-
545
- - TODO: Consider testing: nothing before command, end before command, end+finish before command.
546
544
`
547
545
)
548
546
. params ( u =>
549
547
u
550
548
. combine ( 'command' , kComputePassEncoderCommands )
551
549
. beginSubcases ( )
552
- . combine ( 'finishBeforeCommand' , [ false , true ] )
550
+ . combine ( 'finishBeforeCommand' , [ 'no' , 'pass' , 'encoder' ] )
553
551
)
554
552
. fn ( t => {
555
553
const { command, finishBeforeCommand } = t . params ;
@@ -566,8 +564,10 @@ g.test('compute_pass_commands')
566
564
567
565
const bindGroup = t . createBindGroupForTest ( ) ;
568
566
569
- if ( finishBeforeCommand ) {
567
+ if ( finishBeforeCommand !== 'no' ) {
570
568
computePass . end ( ) ;
569
+ }
570
+ if ( finishBeforeCommand === 'encoder' ) {
571
571
encoder . finish ( ) ;
572
572
}
573
573
@@ -611,5 +611,5 @@ g.test('compute_pass_commands')
611
611
default :
612
612
unreachable ( ) ;
613
613
}
614
- } , finishBeforeCommand ) ;
614
+ } , finishBeforeCommand !== 'no' ) ;
615
615
} ) ;
0 commit comments