From 3ed497b59345978f8460b5e375e7cd18f3b98872 Mon Sep 17 00:00:00 2001 From: petermcneeleychromium <96925679+petermcneeleychromium@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:00:41 -0500 Subject: [PATCH 1/6] Smoothstep validation changes : No compiler error for anything except low == high (for const/override) (#4082) * Update smoothstep validation to only fail on low/high equal * Change to triple equals --------- Co-authored-by: Peter McNeeley --- .../expression/call/builtin/smoothstep.spec.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/webgpu/shader/validation/expression/call/builtin/smoothstep.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/smoothstep.spec.ts index 2879055ab216..2adaac41a371 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/smoothstep.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/smoothstep.spec.ts @@ -51,8 +51,8 @@ Validates that constant evaluation and override evaluation of ${builtin}() rejec .fn(t => { const type = kValuesTypes[t.params.type]; - // We expect to fail if low >= high. - const expectedResult = t.params.value1 < t.params.value2; + // We expect to fail if low == high. + const expectedResult = t.params.value1 !== t.params.value2; validateConstOrOverrideBuiltinEval( t, @@ -66,7 +66,7 @@ Validates that constant evaluation and override evaluation of ${builtin}() rejec const kStages = [...kConstantAndOverrideStages, 'runtime'] as const; g.test('partial_eval_errors') - .desc('Validates that low < high') + .desc('Validates that low != high') .params(u => u .combine('lowStage', kStages) @@ -127,7 +127,7 @@ fn foo() { let tmp = smoothstep(${lowArg}, ${highArg}, x); }`; - const error = t.params.low >= t.params.high; + const error = t.params.low === t.params.high; const shader_error = error && t.params.lowStage === 'constant' && t.params.highStage === 'constant'; const pipeline_error = @@ -349,7 +349,7 @@ g.test('early_eval_errors') validateConstOrOverrideBuiltinEval( t, builtin, - /* expectedResult */ t.params.low < t.params.high, + /* expectedResult */ t.params.low !== t.params.high, [f32(t.params.low), f32(t.params.high), f32(0)], t.params.stage ); From 58d51090746647c523ddda207a5ecd5cc3cc1d58 Mon Sep 17 00:00:00 2001 From: Greggman Date: Mon, 9 Dec 2024 16:29:31 -0800 Subject: [PATCH 2/6] Add back unicode for texture diagrams (#4074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: ``` 0 1 2 3 ╔═══╤═══╦═══╤═══╗ 0 ║ a │ ║ │ ║ ╟───┼───╫───┼───╢ 1 ║ │ ║ │ ║ ╠═══╪═══╬═══╪═══╣ 2 ║ │ ║ │ ║ ╟───┼───╫───┼───╢ 3 ║ │ ║ │ b ║ ╚═══╧═══╩═══╧═══╝ ``` --- .../expression/call/builtin/texture_utils.ts | 123 +++++++++++++----- 1 file changed, 89 insertions(+), 34 deletions(-) diff --git a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts index ba8a58ae861c..b9013281e2cc 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts @@ -3430,25 +3430,72 @@ async function identifySamplePoints( // example when blockWidth = 2, blockHeight = 2 // // 0 1 2 3 - // +===+===+===+===+ - // 0 # a | # | # - // +---+---+---+---+ - // 1 # | # | # - // +===+===+===+===+ - // 2 # | # | # - // +---+---+---+---+ - // 3 # | # | b # - // +===+===+===+===+ + // ╔═══╤═══╦═══╤═══╗ + // 0 ║ a │ ║ │ ║ + // ╟───┼───╫───┼───╢ + // 1 ║ │ ║ │ ║ + // ╠═══╪═══╬═══╪═══╣ + // 2 ║ │ ║ │ ║ + // ╟───┼───╫───┼───╢ + // 3 ║ │ ║ │ b ║ + // ╚═══╧═══╩═══╧═══╝ + + /* prettier-ignore */ + const blockParts = { + top: { left: '╔', fill: '═══', right: '╗', block: '╦', texel: '╤' }, + mid: { left: '╠', fill: '═══', right: '╣', block: '╬', texel: '╪' }, + bot: { left: '╚', fill: '═══', right: '╝', block: '╩', texel: '╧' }, + texelMid: { left: '╟', fill: '───', right: '╢', block: '╫', texel: '┼' }, + value: { left: '║', fill: ' ', right: '║', block: '║', texel: '│' }, + } as const; + /* prettier-ignore */ + const nonBlockParts = { + top: { left: '┌', fill: '───', right: '┐', block: '┬', texel: '┬' }, + mid: { left: '├', fill: '───', right: '┤', block: '┼', texel: '┼' }, + bot: { left: '└', fill: '───', right: '┘', block: '┴', texel: '┴' }, + texelMid: { left: '├', fill: '───', right: '┤', block: '┼', texel: '┼' }, + value: { left: '│', fill: ' ', right: '│', block: '│', texel: '│' }, + } as const; const lines: string[] = []; const letter = (idx: number) => String.fromCodePoint(idx < 30 ? 97 + idx : idx + 9600 - 30); // 97: 'a' let idCount = 0; const { blockWidth, blockHeight } = kTextureFormatInfo[texture.descriptor.format]; - const [blockHChar, blockVChar] = Math.max(blockWidth, blockHeight) > 1 ? ['=', '#'] : ['-', '|']; - const blockHCell = '+'.padStart(4, blockHChar); // generates ---+ or ===+ // range + concatenate results. const rangeCat = (num: number, fn: (i: number) => T) => range(num, fn).join(''); + const joinFn = (arr: string[], fn: (i: number) => string) => { + const joins = range(arr.length - 1, fn); + return arr.map((s, i) => `${s}${joins[i] ?? ''}`).join(''); + }; + const parts = Math.max(blockWidth, blockHeight) > 1 ? blockParts : nonBlockParts; + /** + * Makes a row that's [left, fill, texel, fill, block, fill, texel, fill, right] + * except if `contents` is supplied then it would be + * [left, contents[0], texel, contents[1], block, contents[2], texel, contents[3], right] + */ + const makeRow = ( + blockPaddedWidth: number, + width: number, + { + left, + fill, + right, + block, + texel, + }: { + left: string; + fill: string; + right: string; + block: string; + texel: string; + }, + contents?: string[] + ) => { + return `${left}${joinFn(contents ?? range(blockPaddedWidth, x => fill), x => { + return (x + 1) % blockWidth === 0 ? block : texel; + })}${right}`; + }; for (let mipLevel = 0; mipLevel < mipLevelCount; ++mipLevel) { const level = levels[mipLevel]; @@ -3478,31 +3525,39 @@ async function identifySamplePoints( continue; } + const blockPaddedHeight = align(height, blockHeight); + const blockPaddedWidth = align(width, blockWidth); lines.push(` ${rangeCat(width, x => ` ${x.toString().padEnd(2)}`)}`); - lines.push(` +${rangeCat(width, () => blockHCell)}`); - for (let y = 0; y < height; y++) { - { - let line = `${y.toString().padStart(2)} ${blockVChar}`; - for (let x = 0; x < width; x++) { - const colChar = (x + 1) % blockWidth === 0 ? blockVChar : '|'; - const texelIdx = x + y * texelsPerRow; - const weight = layerEntries.get(texelIdx); - if (weight !== undefined) { - line += ` ${letter(idCount + orderedTexelIndices.length)} ${colChar}`; - orderedTexelIndices.push(texelIdx); - } else { - line += ` ${colChar}`; - } - } - lines.push(line); - } - if (y < height - 1) { - lines.push( - ` +${rangeCat(width, () => ((y + 1) % blockHeight === 0 ? blockHCell : '---+'))}` - ); - } + lines.push(` ${makeRow(blockPaddedWidth, width, parts.top)}`); + for (let y = 0; y < blockPaddedHeight; y++) { + lines.push( + `${y.toString().padStart(2)} ${makeRow( + blockPaddedWidth, + width, + parts.value, + range(blockPaddedWidth, x => { + const texelIdx = x + y * texelsPerRow; + const weight = layerEntries.get(texelIdx); + const outside = y >= height || x >= width; + if (outside || weight === undefined) { + return outside ? '░░░' : ' '; + } else { + const id = letter(idCount + orderedTexelIndices.length); + orderedTexelIndices.push(texelIdx); + return ` ${id} `; + } + }) + )}` + ); + // It's either a block row, a texel row, or the last row. + const end = y < blockPaddedHeight - 1; + const lineParts = end + ? (y + 1) % blockHeight === 0 + ? parts.mid + : parts.texelMid + : parts.bot; + lines.push(` ${makeRow(blockPaddedWidth, width, lineParts)}`); } - lines.push(` +${range(width, () => blockHCell).join('')}`); const pad2 = (n: number) => n.toString().padStart(2); const pad3 = (n: number) => n.toString().padStart(3); From a7274c9035492494fe2db16131463fb6dd2cf0a6 Mon Sep 17 00:00:00 2001 From: Greggman Date: Tue, 10 Dec 2024 18:13:13 -0800 Subject: [PATCH 3/6] Move MaxLimitsTest to MaxLimitTestMixin (#4085) I wanted to use MaxLimitsTest with resource_compatibility.spec.ts but that file's tests are based on `CreateRenderPipelineValidationTest` which itself is based on `ValidationTest` and so would force making `ValidationTest` be based on `MaxLimitsTest`. I actually think thats a good idea. The default should be max limits. But, it breaks too many things. So, MaxLimitsTest a mixin. --- .../api/operation/rendering/draw.spec.ts | 4 +-- .../sampling/sampler_texture.spec.ts | 4 +-- .../resource_compatibility.spec.ts | 2 +- src/webgpu/gpu_test.ts | 29 +++++++++++++------ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/webgpu/api/operation/rendering/draw.spec.ts b/src/webgpu/api/operation/rendering/draw.spec.ts index 262a96aaa7a0..b5df5297795a 100644 --- a/src/webgpu/api/operation/rendering/draw.spec.ts +++ b/src/webgpu/api/operation/rendering/draw.spec.ts @@ -11,10 +11,10 @@ import { TypedArrayBufferView, TypedArrayBufferViewConstructor, } from '../../../../common/util/util.js'; -import { MaxLimitsTest, TextureTestMixin } from '../../../gpu_test.js'; +import { GPUTest, MaxLimitsTestMixin, TextureTestMixin } from '../../../gpu_test.js'; import { PerPixelComparison } from '../../../util/texture/texture_ok.js'; -class DrawTest extends TextureTestMixin(MaxLimitsTest) { +class DrawTest extends TextureTestMixin(MaxLimitsTestMixin(GPUTest)) { checkTriangleDraw(opts: { firstIndex: number | undefined; count: number; diff --git a/src/webgpu/api/operation/sampling/sampler_texture.spec.ts b/src/webgpu/api/operation/sampling/sampler_texture.spec.ts index 1304d2d81608..4a5f2dbd3b36 100644 --- a/src/webgpu/api/operation/sampling/sampler_texture.spec.ts +++ b/src/webgpu/api/operation/sampling/sampler_texture.spec.ts @@ -7,10 +7,10 @@ Tests samplers with textures. import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { assert, range } from '../../../../common/util/util.js'; -import { MaxLimitsTest, TextureTestMixin } from '../../../gpu_test.js'; +import { GPUTest, MaxLimitsTestMixin, TextureTestMixin } from '../../../gpu_test.js'; import { TexelView } from '../../../util/texture/texel_view.js'; -export const g = makeTestGroup(TextureTestMixin(MaxLimitsTest)); +export const g = makeTestGroup(TextureTestMixin(MaxLimitsTestMixin(GPUTest))); g.test('sample_texture_combos') .desc( diff --git a/src/webgpu/api/validation/render_pipeline/resource_compatibility.spec.ts b/src/webgpu/api/validation/render_pipeline/resource_compatibility.spec.ts index 8c516ebb3b85..f14211482164 100644 --- a/src/webgpu/api/validation/render_pipeline/resource_compatibility.spec.ts +++ b/src/webgpu/api/validation/render_pipeline/resource_compatibility.spec.ts @@ -1,5 +1,5 @@ export const description = ` -Tests for resource compatibilty between pipeline layout and shader modules +Tests for resource compatibility between pipeline layout and shader modules `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; diff --git a/src/webgpu/gpu_test.ts b/src/webgpu/gpu_test.ts index d6d6626109d4..ffc20f5f2c22 100644 --- a/src/webgpu/gpu_test.ts +++ b/src/webgpu/gpu_test.ts @@ -1333,16 +1333,27 @@ export class MaxLimitsGPUTestSubcaseBatchState extends GPUTestSubcaseBatchState } } -/** - * A Test that requests all the max limits from the adapter on the device. - */ -export class MaxLimitsTest extends GPUTest { - public static override MakeSharedState( - recorder: TestCaseRecorder, - params: TestParams - ): GPUTestSubcaseBatchState { - return new MaxLimitsGPUTestSubcaseBatchState(recorder, params); +export type MaxLimitsTestMixinType = { + // placeholder. Change to an interface if we need MaxLimits specific methods. +}; + +export function MaxLimitsTestMixin>( + Base: F +): FixtureClassWithMixin { + class MaxLimitsImpl + extends (Base as FixtureClassInterface) + implements MaxLimitsTestMixinType + { + // + public static override MakeSharedState( + recorder: TestCaseRecorder, + params: TestParams + ): GPUTestSubcaseBatchState { + return new MaxLimitsGPUTestSubcaseBatchState(recorder, params); + } } + + return MaxLimitsImpl as unknown as FixtureClassWithMixin; } /** From 1afb7eba336735fac1716d8f9debb3532eefc7ce Mon Sep 17 00:00:00 2001 From: petermcneeleychromium <96925679+petermcneeleychromium@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:11:15 -0500 Subject: [PATCH 4/6] Expand valid input for smoothstep to include low > high (#4084) Co-authored-by: Peter McNeeley --- .../shader/execution/expression/call/builtin/smoothstep.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webgpu/shader/execution/expression/call/builtin/smoothstep.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/smoothstep.spec.ts index f65bb951bf25..dbdc43d9f937 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/smoothstep.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/smoothstep.spec.ts @@ -28,7 +28,7 @@ export const g = makeTestGroup(GPUTest); function validForConst(c: Case): boolean { const low = (c.input as Value[])[0] as ScalarValue; const high = (c.input as Value[])[1] as ScalarValue; - return low.value < high.value; + return low.value !== high.value; } g.test('abstract_float') From 1e545f5fc54cbb7f347effee407d76e64666bbc1 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Wed, 11 Dec 2024 00:53:58 -0500 Subject: [PATCH 5/6] Remove many test cases that never run because maxColorAttachments=8 (#4087) * part 1: use indices instead of full data for subcase params * part 2: remove cases that are always no-ops at maxColorAttachments>8 --- .../createRenderBundleEncoder.spec.ts | 12 +++- .../attachment_compatibility.spec.ts | 70 ++++++++++--------- .../render_pass_descriptor.spec.ts | 9 ++- .../render_pipeline/fragment_state.spec.ts | 10 ++- 4 files changed, 62 insertions(+), 39 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 b0a4bf226dba..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 @@ -240,26 +246,25 @@ g.test('render_pass_and_bundle,color_sparse') // introduce attachmentCount to make it easier to split the test .combine('attachmentCount', kColorAttachmentCounts) .beginSubcases() - .combine('passAttachments', kColorAttachments) - .combine('bundleAttachments', kColorAttachments) - .filter( - p => - p.attachmentCount === p.passAttachments.length && - p.attachmentCount === p.bundleAttachments.length + // Indices into kColorAttachments + .expand('iPass', p => + range(kColorAttachments.length, i => i).filter( + i => kColorAttachments[i].length === p.attachmentCount + ) + ) + .expand('iBundle', p => + range(kColorAttachments.length, i => i).filter( + i => kColorAttachments[i].length === p.attachmentCount + ) ) ) .fn(t => { - const { passAttachments, bundleAttachments } = t.params; + const passAttachments = kColorAttachments[t.params.iPass]; + const bundleAttachments = kColorAttachments[t.params.iBundle]; const { maxColorAttachments } = t.device.limits; - t.skipIf( - passAttachments.length > maxColorAttachments, - `num passAttachments: ${passAttachments.length} > maxColorAttachments for device: ${maxColorAttachments}` - ); - t.skipIf( - bundleAttachments.length > maxColorAttachments, - `num bundleAttachments: ${bundleAttachments.length} > maxColorAttachments for device: ${maxColorAttachments}` - ); + t.skipIf(passAttachments.length > maxColorAttachments); + t.skipIf(bundleAttachments.length > maxColorAttachments); const colorFormats = bundleAttachments.map(i => (i ? 'rgba8uint' : null)); const bundleEncoder = t.device.createRenderBundleEncoder({ @@ -445,25 +450,26 @@ Test that each of color attachments in render passes or bundles match that of th // introduce attachmentCount to make it easier to split the test .combine('attachmentCount', kColorAttachmentCounts) .beginSubcases() - .combine('encoderAttachments', kColorAttachments) - .combine('pipelineAttachments', kColorAttachments) - .filter( - p => - p.attachmentCount === p.encoderAttachments.length && - p.attachmentCount === p.pipelineAttachments.length + // Indices into kColorAttachments + .expand('iEncoder', p => + range(kColorAttachments.length, i => i).filter( + i => kColorAttachments[i].length === p.attachmentCount + ) + ) + .expand('iPipeline', p => + range(kColorAttachments.length, i => i).filter( + i => kColorAttachments[i].length === p.attachmentCount + ) ) ) .fn(t => { - const { encoderType, encoderAttachments, pipelineAttachments } = t.params; + const { encoderType } = t.params; + const encoderAttachments = kColorAttachments[t.params.iEncoder]; + const pipelineAttachments = kColorAttachments[t.params.iPipeline]; + const { maxColorAttachments } = t.device.limits; - t.skipIf( - encoderAttachments.length > maxColorAttachments, - `num encoderAttachments: ${encoderAttachments.length} > maxColorAttachments for device: ${maxColorAttachments}` - ); - t.skipIf( - pipelineAttachments.length > maxColorAttachments, - `num pipelineAttachments: ${pipelineAttachments.length} > maxColorAttachments for device: ${maxColorAttachments}` - ); + t.skipIf(encoderAttachments.length > maxColorAttachments); + t.skipIf(pipelineAttachments.length > maxColorAttachments); const colorTargets = pipelineAttachments.map(i => i ? ({ format: 'rgba8uint', writeMask: 0 } as GPUColorTargetState) : null 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]) ) From f1844b1e71b49acb25be06a410f5d06c8480834b Mon Sep 17 00:00:00 2001 From: petermcneeleychromium <96925679+petermcneeleychromium@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:43:10 -0500 Subject: [PATCH 6/6] Remove subgroups f16 enable from cts ("subgroups_f16") (#4083) * Full removal of subgroups_f16 enable * Subgroup f16 pass * Add back f16 enable for subgroup f16 tests tested locally with dawn node * minor formatting fix --------- Co-authored-by: Peter McNeeley --- .../call/builtin/quadBroadcast.spec.ts | 3 +-- .../expression/call/builtin/quadSwap.spec.ts | 3 +-- .../call/builtin/subgroupAdd.spec.ts | 4 +--- .../call/builtin/subgroupBroadcast.spec.ts | 3 +-- .../call/builtin/subgroupMul.spec.ts | 4 +--- .../call/builtin/subgroupShuffle.spec.ts | 3 +-- .../expression/call/builtin/subgroup_util.ts | 2 +- .../call/builtin/quadBroadcast.spec.ts | 6 ++---- .../expression/call/builtin/quadSwap.spec.ts | 6 ++---- .../call/builtin/subgroupAdd.spec.ts | 6 ++---- .../call/builtin/subgroupAnyAll.spec.ts | 6 ++---- .../call/builtin/subgroupBallot.spec.ts | 6 ++---- .../call/builtin/subgroupBitwise.spec.ts | 6 ++---- .../call/builtin/subgroupBroadcast.spec.ts | 6 ++---- .../builtin/subgroupBroadcastFirst.spec.ts | 6 ++---- .../call/builtin/subgroupElect.spec.ts | 6 ++---- .../call/builtin/subgroupMinMax.spec.ts | 6 ++---- .../call/builtin/subgroupMul.spec.ts | 6 ++---- .../call/builtin/subgroupShuffle.spec.ts | 9 +++----- .../shader/validation/parse/enable.spec.ts | 21 +++++++------------ 20 files changed, 39 insertions(+), 79 deletions(-) diff --git a/src/webgpu/shader/execution/expression/call/builtin/quadBroadcast.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/quadBroadcast.spec.ts index 521ae2925354..f8d9ec9a362b 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/quadBroadcast.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/quadBroadcast.spec.ts @@ -109,7 +109,6 @@ g.test('data_types') const features: GPUFeatureName[] = ['subgroups' as GPUFeatureName]; const type = kTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); @@ -119,7 +118,7 @@ g.test('data_types') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/execution/expression/call/builtin/quadSwap.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/quadSwap.spec.ts index 0985b331b903..7e754152c9b5 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/quadSwap.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/quadSwap.spec.ts @@ -131,7 +131,6 @@ g.test('data_types') const features: GPUFeatureName[] = ['subgroups' as GPUFeatureName]; const type = kTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); @@ -141,7 +140,7 @@ g.test('data_types') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/execution/expression/call/builtin/subgroupAdd.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/subgroupAdd.spec.ts index 86510fe87738..f2c1a1b2efa7 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/subgroupAdd.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/subgroupAdd.spec.ts @@ -65,7 +65,6 @@ and limit the number of permutations needed to calculate the final result.` const features: GPUFeatureName[] = ['subgroups' as GPUFeatureName]; if (t.params.type === 'f16') { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -170,7 +169,6 @@ TODO: support vec3 types. const type = kDataTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -183,7 +181,7 @@ TODO: support vec3 types. const scalarType = scalarTypeOf(type); let enables = 'enable subgroups;\n'; if (type.requiresF16()) { - enables += 'enable f16;\nenable subgroups_f16;\n'; + enables += 'enable f16;\n'; } const wgThreads = t.params.wgSize[0] * t.params.wgSize[1] * t.params.wgSize[2]; diff --git a/src/webgpu/shader/execution/expression/call/builtin/subgroupBroadcast.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/subgroupBroadcast.spec.ts index 50dac8c4d894..211cf1285340 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/subgroupBroadcast.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/subgroupBroadcast.spec.ts @@ -110,7 +110,6 @@ g.test('data_types') const type = kDataTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -119,7 +118,7 @@ g.test('data_types') const type = kDataTypes[t.params.type]; let enables = 'enable subgroups;\n'; if (type.requiresF16()) { - enables += 'enable f16;\nenable subgroups_f16;\n'; + enables += 'enable f16;\n'; } const broadcast = diff --git a/src/webgpu/shader/execution/expression/call/builtin/subgroupMul.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/subgroupMul.spec.ts index dfcaf481fcab..fdededc6e6ba 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/subgroupMul.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/subgroupMul.spec.ts @@ -65,7 +65,6 @@ and limit the number of permutations needed to calculate the final result.` const features: GPUFeatureName[] = ['subgroups' as GPUFeatureName]; if (t.params.type === 'f16') { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -188,7 +187,6 @@ TODO: support vec3 types. const type = kDataTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -201,7 +199,7 @@ TODO: support vec3 types. const scalarType = scalarTypeOf(type); let enables = 'enable subgroups;\n'; if (type.requiresF16()) { - enables += 'enable f16;\nenable subgroups_f16;\n'; + enables += 'enable f16;\n'; } const wgThreads = t.params.wgSize[0] * t.params.wgSize[1] * t.params.wgSize[2]; diff --git a/src/webgpu/shader/execution/expression/call/builtin/subgroupShuffle.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/subgroupShuffle.spec.ts index 84620b05d889..73e1fe6bcaa7 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/subgroupShuffle.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/subgroupShuffle.spec.ts @@ -738,7 +738,6 @@ g.test('data_types') const features: GPUFeatureName[] = ['subgroups' as GPUFeatureName]; const type = kTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); @@ -748,7 +747,7 @@ g.test('data_types') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/execution/expression/call/builtin/subgroup_util.ts b/src/webgpu/shader/execution/expression/call/builtin/subgroup_util.ts index 2d97eade1904..71852c6a315c 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/subgroup_util.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/subgroup_util.ts @@ -173,7 +173,7 @@ export async function runAccuracyTest( const val1 = range[prng.uniformInt(numVals)]; const val2 = range[prng.uniformInt(numVals)]; - const extraEnables = type === 'f16' ? `enable f16;\nenable subgroups_f16;` : ``; + const extraEnables = type === 'f16' ? `enable f16;` : ``; const wgsl = ` enable subgroups; ${extraEnables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/quadBroadcast.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/quadBroadcast.spec.ts index 80b1c2a38a69..3bfb61f66c18 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/quadBroadcast.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/quadBroadcast.spec.ts @@ -85,7 +85,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -94,7 +93,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -130,7 +129,6 @@ g.test('return_type') const dataType = kArgumentTypes[t.params.dataType]; const retType = kArgumentTypes[t.params.retType]; if (dataType.requiresF16() || retType.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -140,7 +138,7 @@ g.test('return_type') const retType = kArgumentTypes[t.params.retType]; let enables = `enable subgroups;\n`; if (dataType.requiresF16() || retType.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/quadSwap.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/quadSwap.spec.ts index af5c397c52ae..90e8f54e19ca 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/quadSwap.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/quadSwap.spec.ts @@ -94,7 +94,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -102,7 +101,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -134,7 +133,6 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; if (retType.requiresF16() || paramType.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -143,7 +141,7 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; let enables = `enable subgroups;\n`; if (retType.requiresF16() || paramType.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupAdd.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupAdd.spec.ts index 4f2a2af52197..a98712be76ce 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupAdd.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupAdd.spec.ts @@ -79,7 +79,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -88,7 +87,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -126,7 +125,6 @@ g.test('return_type') const dataType = kArgumentTypes[t.params.dataType]; const retType = kArgumentTypes[t.params.retType]; if (dataType.requiresF16() || retType.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -136,7 +134,7 @@ g.test('return_type') const retType = kArgumentTypes[t.params.retType]; let enables = `enable subgroups;\n`; if (dataType.requiresF16() || retType.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupAnyAll.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupAnyAll.spec.ts index eaee33e62cff..a944eab19ee0 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupAnyAll.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupAnyAll.spec.ts @@ -89,7 +89,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -97,7 +96,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -126,7 +125,6 @@ g.test('return_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -134,7 +132,7 @@ g.test('return_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupBallot.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupBallot.spec.ts index 5f53847be25c..2f461bedb8fd 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupBallot.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupBallot.spec.ts @@ -80,7 +80,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -89,7 +88,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -114,7 +113,6 @@ g.test('return_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -123,7 +121,7 @@ g.test('return_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupBitwise.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupBitwise.spec.ts index ca0dfb6fd719..348c857a0703 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupBitwise.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupBitwise.spec.ts @@ -94,7 +94,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -102,7 +101,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -135,7 +134,6 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; if (retType.requiresF16() || paramType.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -144,7 +142,7 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; let enables = `enable subgroups;\n`; if (retType.requiresF16() || paramType.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcast.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcast.spec.ts index 5feef1d2811b..522f11801a85 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcast.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcast.spec.ts @@ -85,7 +85,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -94,7 +93,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -130,7 +129,6 @@ g.test('return_type') const dataType = kArgumentTypes[t.params.dataType]; const retType = kArgumentTypes[t.params.retType]; if (dataType.requiresF16() || retType.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -140,7 +138,7 @@ g.test('return_type') const retType = kArgumentTypes[t.params.retType]; let enables = `enable subgroups;\n`; if (dataType.requiresF16() || retType.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcastFirst.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcastFirst.spec.ts index 6f35c3350e04..e43b0b2e1c99 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcastFirst.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupBroadcastFirst.spec.ts @@ -80,7 +80,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -89,7 +88,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -125,7 +124,6 @@ g.test('return_type') const dataType = kArgumentTypes[t.params.dataType]; const retType = kArgumentTypes[t.params.retType]; if (dataType.requiresF16() || retType.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -135,7 +133,7 @@ g.test('return_type') const retType = kArgumentTypes[t.params.retType]; let enables = `enable subgroups;\n`; if (dataType.requiresF16() || retType.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupElect.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupElect.spec.ts index 5637860c59ce..a74b07bf06a5 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupElect.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupElect.spec.ts @@ -81,7 +81,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -89,7 +88,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -115,7 +114,6 @@ g.test('return_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -123,7 +121,7 @@ g.test('return_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupMinMax.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupMinMax.spec.ts index 566fdc665ecc..648511c7746b 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupMinMax.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupMinMax.spec.ts @@ -94,7 +94,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -102,7 +101,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -134,7 +133,6 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; if (retType.requiresF16() || paramType.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -143,7 +141,7 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; let enables = `enable subgroups;\n`; if (retType.requiresF16() || paramType.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupMul.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupMul.spec.ts index 0b50d4c9df2d..2515c798ecb9 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupMul.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupMul.spec.ts @@ -79,7 +79,6 @@ g.test('data_type') const features = ['subgroups' as GPUFeatureName]; const type = kArgumentTypes[t.params.type]; if (type.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -88,7 +87,7 @@ g.test('data_type') const type = kArgumentTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -126,7 +125,6 @@ g.test('return_type') const dataType = kArgumentTypes[t.params.dataType]; const retType = kArgumentTypes[t.params.retType]; if (dataType.requiresF16() || retType.requiresF16()) { - features.push('subgroups-f16' as GPUFeatureName); features.push('shader-f16'); } t.selectDeviceOrSkipTestCase(features); @@ -136,7 +134,7 @@ g.test('return_type') const retType = kArgumentTypes[t.params.retType]; let enables = `enable subgroups;\n`; if (dataType.requiresF16() || retType.requiresF16()) { - enables += `enable subgroups_f16;\nenable f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/expression/call/builtin/subgroupShuffle.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/subgroupShuffle.spec.ts index 4f14503d579d..028f61d162a9 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/subgroupShuffle.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/subgroupShuffle.spec.ts @@ -153,7 +153,6 @@ g.test('data_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -161,7 +160,7 @@ g.test('data_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -193,7 +192,6 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; if (retType.requiresF16() || paramType.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -202,7 +200,7 @@ g.test('return_type') const paramType = kTypes[t.params.paramType]; let enables = `enable subgroups;\n`; if (retType.requiresF16() || paramType.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} @@ -232,7 +230,6 @@ g.test('param2_type') const type = kTypes[t.params.type]; if (type.requiresF16()) { features.push('shader-f16'); - features.push('subgroups-f16' as GPUFeatureName); } t.selectDeviceOrSkipTestCase(features); }) @@ -240,7 +237,7 @@ g.test('param2_type') const type = kTypes[t.params.type]; let enables = `enable subgroups;\n`; if (type.requiresF16()) { - enables += `enable f16;\nenable subgroups_f16;`; + enables += `enable f16;`; } const wgsl = ` ${enables} diff --git a/src/webgpu/shader/validation/parse/enable.spec.ts b/src/webgpu/shader/validation/parse/enable.spec.ts index 77311de71e2e..41e2a3842204 100644 --- a/src/webgpu/shader/validation/parse/enable.spec.ts +++ b/src/webgpu/shader/validation/parse/enable.spec.ts @@ -70,22 +70,16 @@ enable f16;`, code: `enable subgroups;`, pass: true, }, - subgroups_f16_fail: { - code: `enable subgroups_f16;`, - pass: false, - }, subgroups_f16_pass1: { code: ` - enable subgroups_f16; - enable subgroups; - enable f16;`, + enable f16; + enable subgroups;`, pass: true, }, subgroups_f16_pass2: { code: ` - enable f16; enable subgroups; - enable subgroups_f16;`, + enable f16;`, pass: true, }, }; @@ -95,12 +89,11 @@ g.test('enable') .beforeAllSubcases(t => { const features: GPUFeatureName[] = []; const name: string = t.params.case as string; - if (name.includes('subgroups_f16')) { - features.push('subgroups' as GPUFeatureName); - features.push('subgroups-f16' as GPUFeatureName); - features.push('shader-f16'); - } else if (name.includes('subgroups')) { + if (name.includes('subgroups')) { features.push('subgroups' as GPUFeatureName); + if (name.includes('f16')) { + features.push('shader-f16'); + } } else { features.push('shader-f16'); }