From 921a5107f9848f229dad20c78531e98b83050dd3 Mon Sep 17 00:00:00 2001 From: alan-baker Date: Thu, 1 Aug 2024 08:00:12 -0400 Subject: [PATCH] Use device subgroup limits in subgroup_size tests (#3885) --- .../shader_io/compute_builtins.spec.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/webgpu/shader/execution/shader_io/compute_builtins.spec.ts b/src/webgpu/shader/execution/shader_io/compute_builtins.spec.ts index 55e9d422999b..a08d6eb39533 100644 --- a/src/webgpu/shader/execution/shader_io/compute_builtins.spec.ts +++ b/src/webgpu/shader/execution/shader_io/compute_builtins.spec.ts @@ -398,9 +398,11 @@ g.test('subgroup_size') t.selectDeviceOrSkipTestCase('subgroups' as GPUFeatureName); }) .fn(async t => { - // Replace these with the limits when they are wired up. - const minSize = 4; - const maxSize = 128; + interface SubgroupLimits extends GPUSupportedLimits { + minSubgroupSize: number; + maxSubgroupSize: number; + } + const { minSubgroupSize, maxSubgroupSize } = t.device.limits as SubgroupLimits; const wgx = t.params.sizes[0]; const wgy = t.params.sizes[1]; @@ -512,7 +514,15 @@ fn main(@builtin(subgroup_size) size : u32, }); const compareData: Uint32Array = compareReadback.data; - t.expectOK(checkSubgroupSizeConsistency(sizesData, compareData, minSize, maxSize, wgThreads)); + t.expectOK( + checkSubgroupSizeConsistency( + sizesData, + compareData, + minSubgroupSize, + maxSubgroupSize, + wgThreads + ) + ); }); /**