Ensure WorkgroupSizeX never exceeds the maximum value in subgroup size control tests (#4655)
Issue: #4640
This commit is contained in:
parent
b507bd117e
commit
9964a05b4d
2 changed files with 6 additions and 0 deletions
|
|
@ -1193,6 +1193,9 @@ g.test('subgroup_size_attribute')
|
|||
|
||||
for (let subgroupSize = subgroupMinSize; subgroupSize <= subgroupMaxSize; subgroupSize *= 2) {
|
||||
const wgx = subgroupSize * numSubgroups;
|
||||
if (wgx > t.device.limits.maxComputeWorkgroupSizeX) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const wgsl = `
|
||||
enable subgroups;
|
||||
|
|
|
|||
|
|
@ -214,9 +214,11 @@ async function getValidSubgroupSizes(device: GPUDevice): Promise<number[]> {
|
|||
subgroupMaxSize: number;
|
||||
}
|
||||
const { subgroupMinSize, subgroupMaxSize } = device.adapterInfo as SubgroupProperties;
|
||||
const maxWorkgroupSizeX = device.limits.maxComputeWorkgroupSizeX;
|
||||
|
||||
const sizes: number[] = [];
|
||||
for (let subgroupSize = subgroupMinSize; subgroupSize <= subgroupMaxSize; subgroupSize *= 2) {
|
||||
if (subgroupSize > maxWorkgroupSizeX) break;
|
||||
const wgsl = `
|
||||
enable subgroups;
|
||||
enable subgroup_size_control;
|
||||
|
|
@ -294,6 +296,7 @@ g.test('workgroup_size_x_must_be_multiple_of_subgroup_size_at_pipeline_creation'
|
|||
for (const subgroupSize of validSubgroupSizes) {
|
||||
const workgroupSizeX = subgroupSize * multiplier + offset;
|
||||
if (workgroupSizeX <= 0) continue;
|
||||
if (workgroupSizeX > t.device.limits.maxComputeWorkgroupSizeX) continue;
|
||||
|
||||
const isMultiple = workgroupSizeX % subgroupSize === 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue