1
1
export const description = `
2
2
Validation for attachment compatibility between render passes, bundles, and pipelines
3
+
4
+ TODO(#3363): Make this into a MaxLimitTest and increase kMaxColorAttachments.
3
5
` ;
4
6
5
7
import { makeTestGroup } from '../../../../common/framework/test_group.js' ;
6
8
import { range } from '../../../../common/util/util.js' ;
7
- import { kMaxColorAttachmentsToTest , kTextureSampleCounts } from '../../../capability_info.js' ;
9
+ import { getDefaultLimits , kTextureSampleCounts } from '../../../capability_info.js' ;
8
10
import {
9
11
kRegularTextureFormats ,
10
12
kSizedDepthStencilFormats ,
@@ -15,7 +17,11 @@ import {
15
17
} from '../../../format_info.js' ;
16
18
import { ValidationTest } from '../validation_test.js' ;
17
19
18
- const kColorAttachmentCounts = range ( kMaxColorAttachmentsToTest , i => i + 1 ) ;
20
+ // MAINTENANCE_TODO: This should be changed to kMaxColorAttachmentsToTest
21
+ // when this is made a MaxLimitTest (see above).
22
+ const kMaxColorAttachments = getDefaultLimits ( 'core' ) . maxColorAttachments . default ;
23
+
24
+ const kColorAttachmentCounts = range ( kMaxColorAttachments , i => i + 1 ) ;
19
25
const kColorAttachments = kColorAttachmentCounts
20
26
. map ( count => {
21
27
// generate cases with 0..1 null attachments at different location
@@ -240,26 +246,25 @@ g.test('render_pass_and_bundle,color_sparse')
240
246
// introduce attachmentCount to make it easier to split the test
241
247
. combine ( 'attachmentCount' , kColorAttachmentCounts )
242
248
. beginSubcases ( )
243
- . combine ( 'passAttachments' , kColorAttachments )
244
- . combine ( 'bundleAttachments' , kColorAttachments )
245
- . filter (
246
- p =>
247
- p . attachmentCount === p . passAttachments . length &&
248
- p . attachmentCount === p . bundleAttachments . length
249
+ // Indices into kColorAttachments
250
+ . expand ( 'iPass' , p =>
251
+ range ( kColorAttachments . length , i => i ) . filter (
252
+ i => kColorAttachments [ i ] . length === p . attachmentCount
253
+ )
254
+ )
255
+ . expand ( 'iBundle' , p =>
256
+ range ( kColorAttachments . length , i => i ) . filter (
257
+ i => kColorAttachments [ i ] . length === p . attachmentCount
258
+ )
249
259
)
250
260
)
251
261
. fn ( t => {
252
- const { passAttachments, bundleAttachments } = t . params ;
262
+ const passAttachments = kColorAttachments [ t . params . iPass ] ;
263
+ const bundleAttachments = kColorAttachments [ t . params . iBundle ] ;
253
264
254
265
const { maxColorAttachments } = t . device . limits ;
255
- t . skipIf (
256
- passAttachments . length > maxColorAttachments ,
257
- `num passAttachments: ${ passAttachments . length } > maxColorAttachments for device: ${ maxColorAttachments } `
258
- ) ;
259
- t . skipIf (
260
- bundleAttachments . length > maxColorAttachments ,
261
- `num bundleAttachments: ${ bundleAttachments . length } > maxColorAttachments for device: ${ maxColorAttachments } `
262
- ) ;
266
+ t . skipIf ( passAttachments . length > maxColorAttachments ) ;
267
+ t . skipIf ( bundleAttachments . length > maxColorAttachments ) ;
263
268
264
269
const colorFormats = bundleAttachments . map ( i => ( i ? 'rgba8uint' : null ) ) ;
265
270
const bundleEncoder = t . device . createRenderBundleEncoder ( {
@@ -445,25 +450,26 @@ Test that each of color attachments in render passes or bundles match that of th
445
450
// introduce attachmentCount to make it easier to split the test
446
451
. combine ( 'attachmentCount' , kColorAttachmentCounts )
447
452
. beginSubcases ( )
448
- . combine ( 'encoderAttachments' , kColorAttachments )
449
- . combine ( 'pipelineAttachments' , kColorAttachments )
450
- . filter (
451
- p =>
452
- p . attachmentCount === p . encoderAttachments . length &&
453
- p . attachmentCount === p . pipelineAttachments . length
453
+ // Indices into kColorAttachments
454
+ . expand ( 'iEncoder' , p =>
455
+ range ( kColorAttachments . length , i => i ) . filter (
456
+ i => kColorAttachments [ i ] . length === p . attachmentCount
457
+ )
458
+ )
459
+ . expand ( 'iPipeline' , p =>
460
+ range ( kColorAttachments . length , i => i ) . filter (
461
+ i => kColorAttachments [ i ] . length === p . attachmentCount
462
+ )
454
463
)
455
464
)
456
465
. fn ( t => {
457
- const { encoderType, encoderAttachments, pipelineAttachments } = t . params ;
466
+ const { encoderType } = t . params ;
467
+ const encoderAttachments = kColorAttachments [ t . params . iEncoder ] ;
468
+ const pipelineAttachments = kColorAttachments [ t . params . iPipeline ] ;
469
+
458
470
const { maxColorAttachments } = t . device . limits ;
459
- t . skipIf (
460
- encoderAttachments . length > maxColorAttachments ,
461
- `num encoderAttachments: ${ encoderAttachments . length } > maxColorAttachments for device: ${ maxColorAttachments } `
462
- ) ;
463
- t . skipIf (
464
- pipelineAttachments . length > maxColorAttachments ,
465
- `num pipelineAttachments: ${ pipelineAttachments . length } > maxColorAttachments for device: ${ maxColorAttachments } `
466
- ) ;
471
+ t . skipIf ( encoderAttachments . length > maxColorAttachments ) ;
472
+ t . skipIf ( pipelineAttachments . length > maxColorAttachments ) ;
467
473
468
474
const colorTargets = pipelineAttachments . map ( i =>
469
475
i ? ( { format : 'rgba8uint' , writeMask : 0 } as GPUColorTargetState ) : null
0 commit comments