From 6c5381b7179c483df4cf01e4b59a1f2798f4f7c1 Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Mon, 18 May 2026 14:54:49 +0800 Subject: [PATCH] Add API validation tests on the extension `subgroup-size-control` This patch adds the API validation tests on the extension `subgroup-size-control`: - Enabling subgroup-size-control on the creation of device should also enable subgroups. --- .../features/subgroup_size_control.spec.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/webgpu/api/validation/capability_checks/features/subgroup_size_control.spec.ts diff --git a/src/webgpu/api/validation/capability_checks/features/subgroup_size_control.spec.ts b/src/webgpu/api/validation/capability_checks/features/subgroup_size_control.spec.ts new file mode 100644 index 000000000000..debb9267bc5f --- /dev/null +++ b/src/webgpu/api/validation/capability_checks/features/subgroup_size_control.spec.ts @@ -0,0 +1,22 @@ +export const description = ` +Tests for capability checking for the 'subgroup-size-control' feature. + +Test that enabling the 'subgroup-size-control' feature also enables the 'subgroups' feature. +`; + +import { makeTestGroup } from '../../../../../common/framework/test_group.js'; +import { hasFeature } from '../../../../../common/util/util.js'; +import { UniqueFeaturesOrLimitsGPUTest } from '../../../../gpu_test.js'; + +export const g = makeTestGroup(UniqueFeaturesOrLimitsGPUTest); + +g.test('enables_subgroups') + .desc( + ` + Test that enabling the 'subgroup-size-control' feature also enables the 'subgroups' feature. + ` + ) + .beforeAllSubcases(t => t.selectDeviceOrSkipTestCase('subgroup-size-control' as GPUFeatureName)) + .fn(t => { + t.expect(() => hasFeature(t.device.features, 'subgroups')); + });