From 510829d9f984fd44af6f0617cb6725ca13f67300 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Tue, 10 Dec 2024 23:39:03 -0500 Subject: [PATCH] part 2: remove cases that are always no-ops at maxColorAttachments>8 --- .../encoding/createRenderBundleEncoder.spec.ts | 12 +++++++++--- .../render_pass/attachment_compatibility.spec.ts | 10 ++++++++-- .../render_pass/render_pass_descriptor.spec.ts | 9 +++++++-- .../render_pipeline/fragment_state.spec.ts | 10 ++++++++-- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts b/src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts index b4beeb8fbe5d..ade00417411b 100644 --- a/src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts +++ b/src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts @@ -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, @@ -14,6 +16,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; + export const g = makeTestGroup(ValidationTest); g.test('attachment_state,limits,maxColorAttachments') @@ -21,7 +27,7 @@ g.test('attachment_state,limits,maxColorAttachments') .params(u => u.beginSubcases().combine( 'colorFormatCount', - range(kMaxColorAttachmentsToTest, i => i + 1) + range(kMaxColorAttachments, i => i + 1) ) ) .fn(t => { @@ -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 => { diff --git a/src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts b/src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts index f17d78edf9e7..8f5982f8af18 100644 --- a/src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts +++ b/src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts @@ -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, @@ -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 diff --git a/src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts b/src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts index 76fca77a90bf..3ded92c5c022 100644 --- a/src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts +++ b/src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts @@ -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, @@ -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: { @@ -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 => { diff --git a/src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts b/src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts index 51a5d5f79763..efbe8b0b5b94 100644 --- a/src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts +++ b/src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts @@ -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 { @@ -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]; @@ -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]) )