Skip to content

Commit

Permalink
part 2: remove cases that are always no-ops at maxColorAttachments>8
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Dec 11, 2024
1 parent 1c88d9b commit 510829d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export const description = `
createRenderBundleEncoder validation tests.
TODO(#3363): Make this into a MaxLimitTest and increase kMaxColorAttachments.
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { range } from '../../../../common/util/util.js';
import { kMaxColorAttachmentsToTest } from '../../../capability_info.js';
import { getDefaultLimits } from '../../../capability_info.js';
import {
computeBytesPerSampleFromFormats,
kAllTextureFormats,
Expand All @@ -14,14 +16,18 @@ import {
} from '../../../format_info.js';
import { ValidationTest } from '../validation_test.js';

// MAINTENANCE_TODO: This should be changed to kMaxColorAttachmentsToTest
// when this is made a MaxLimitTest (see above).
const kMaxColorAttachments = getDefaultLimits('core').maxColorAttachments.default;

export const g = makeTestGroup(ValidationTest);

g.test('attachment_state,limits,maxColorAttachments')
.desc(`Tests that attachment state must have <= device.limits.maxColorAttachments.`)
.params(u =>
u.beginSubcases().combine(
'colorFormatCount',
range(kMaxColorAttachmentsToTest, i => i + 1)
range(kMaxColorAttachments, i => i + 1)
)
)
.fn(t => {
Expand Down Expand Up @@ -52,7 +58,7 @@ g.test('attachment_state,limits,maxColorAttachmentBytesPerSample,aligned')
.beginSubcases()
.combine(
'colorFormatCount',
range(kMaxColorAttachmentsToTest, i => i + 1)
range(kMaxColorAttachments, i => i + 1)
)
)
.beforeAllSubcases(t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export const description = `
Validation for attachment compatibility between render passes, bundles, and pipelines
TODO(#3363): Make this into a MaxLimitTest and increase kMaxColorAttachments.
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { range } from '../../../../common/util/util.js';
import { kMaxColorAttachmentsToTest, kTextureSampleCounts } from '../../../capability_info.js';
import { getDefaultLimits, kTextureSampleCounts } from '../../../capability_info.js';
import {
kRegularTextureFormats,
kSizedDepthStencilFormats,
Expand All @@ -15,7 +17,11 @@ import {
} from '../../../format_info.js';
import { ValidationTest } from '../validation_test.js';

const kColorAttachmentCounts = range(kMaxColorAttachmentsToTest, i => i + 1);
// MAINTENANCE_TODO: This should be changed to kMaxColorAttachmentsToTest
// when this is made a MaxLimitTest (see above).
const kMaxColorAttachments = getDefaultLimits('core').maxColorAttachments.default;

const kColorAttachmentCounts = range(kMaxColorAttachments, i => i + 1);
const kColorAttachments = kColorAttachmentCounts
.map(count => {
// generate cases with 0..1 null attachments at different location
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
export const description = `
render pass descriptor validation tests.
TODO(#3363): Make this into a MaxLimitTest and increase kMaxColorAttachments.
TODO: review for completeness
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { range } from '../../../../common/util/util.js';
import { kMaxColorAttachmentsToTest, kQueryTypes } from '../../../capability_info.js';
import { getDefaultLimits, kQueryTypes } from '../../../capability_info.js';
import { GPUConst } from '../../../constants.js';
import {
computeBytesPerSampleFromFormats,
Expand All @@ -16,6 +17,10 @@ import {
} from '../../../format_info.js';
import { ValidationTest } from '../validation_test.js';

// MAINTENANCE_TODO: This should be changed to kMaxColorAttachmentsToTest
// when this is made a MaxLimitTest (see above).
const kMaxColorAttachments = getDefaultLimits('core').maxColorAttachments.default;

class F extends ValidationTest {
createTestTexture(
options: {
Expand Down Expand Up @@ -201,7 +206,7 @@ g.test('color_attachments,limits,maxColorAttachmentBytesPerSample,aligned')
.beginSubcases()
.combine(
'attachmentCount',
range(kMaxColorAttachmentsToTest, i => i + 1)
range(kMaxColorAttachments, i => i + 1)
)
)
.beforeAllSubcases(t => {
Expand Down
10 changes: 8 additions & 2 deletions src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
export const description = `
This test dedicatedly tests validation of GPUFragmentState of createRenderPipeline.
TODO(#3363): Make this into a MaxLimitTest and increase kMaxColorAttachments.
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { assert, range } from '../../../../common/util/util.js';
import {
getDefaultLimits,
IsDualSourceBlendingFactor,
kBlendFactors,
kBlendOperations,
kMaxColorAttachmentsToTest,
} from '../../../capability_info.js';
import { GPUConst } from '../../../constants.js';
import {
Expand All @@ -28,6 +30,10 @@ import { kTexelRepresentationInfo } from '../../../util/texture/texel_data.js';

import { ColorTargetState, CreateRenderPipelineValidationTest } from './common.js';

// MAINTENANCE_TODO: This should be changed to kMaxColorAttachmentsToTest
// when this is made a MaxLimitTest (see above).
const kMaxColorAttachments = getDefaultLimits('core').maxColorAttachments.default;

export const g = makeTestGroup(CreateRenderPipelineValidationTest);

const values = [0, 1, 0, 1];
Expand Down Expand Up @@ -169,7 +175,7 @@ g.test('limits,maxColorAttachmentBytesPerSample,aligned')
.beginSubcases()
.combine(
'attachmentCount',
range(kMaxColorAttachmentsToTest, i => i + 1)
range(kMaxColorAttachments, i => i + 1)
)
.combine('isAsync', [false, true])
)
Expand Down

0 comments on commit 510829d

Please sign in to comment.