Skip to content

Commit 7df4583

Browse files
committed
address review comments
1 parent 74e5db6 commit 7df4583

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

src/webgpu/api/validation/createBindGroup.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,17 @@ g.test('texture_binding_must_have_correct_usage')
206206
})
207207
)
208208
.beforeAllSubcases(t => {
209-
t.skipIf(
210-
t.isCompatibility,
211-
"The test requires 'r32float' renderable and multisampled support which compat mode doesn't guarantee."
212-
);
209+
t.selectDeviceForRenderableColorFormatOrSkipTestCase(kTestFormat);
213210
})
214211
.fn(t => {
215212
const { entry, usage } = t.params;
216213
const info = texBindingTypeInfo(entry);
217214

215+
t.skipIf(
216+
t.isCompatibility && info.resource === 'sampledTexMS',
217+
"The test requires 'r32float' multisampled support which compat mode doesn't guarantee."
218+
);
219+
218220
const bindGroupLayout = t.device.createBindGroupLayout({
219221
entries: [{ binding: 0, visibility: GPUShaderStage.COMPUTE, ...entry }],
220222
});

src/webgpu/api/validation/createTexture.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
viewCompatible,
1717
textureDimensionAndFormatCompatible,
1818
isTextureFormatUsableAsStorageFormat,
19-
is32Float,
2019
} from '../../format_info.js';
2120
import { maxMipLevelCount } from '../../util/texture/base.js';
2221

@@ -362,10 +361,9 @@ g.test('sampleCount,valid_sampleCount_with_other_parameter_varies')
362361
const { dimension, sampleCount, format, mipLevelCount, arrayLayerCount, usage } = t.params;
363362
const { blockWidth, blockHeight } = kTextureFormatInfo[format];
364363

365-
t.skipIf(
366-
sampleCount === 4 && t.isCompatibility && (format === 'rgba16float' || is32Float(format)),
367-
'Multisample support for this format is not guaranteed in comapt mode'
368-
);
364+
if (sampleCount > 1) {
365+
t.skipIfMultisampleNotSupportedForFormat(format);
366+
}
369367

370368
const size =
371369
dimension === '1d'

src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { getDefaultLimits, kQueryTypes } from '../../../capability_info.js';
1111
import { GPUConst } from '../../../constants.js';
1212
import {
1313
computeBytesPerSampleFromFormats,
14-
is32Float,
1514
kDepthStencilFormats,
1615
kRenderableColorTextureFormats,
1716
kTextureFormatInfo,
@@ -1175,11 +1174,8 @@ g.test('resolveTarget,format_supports_resolve')
11751174
.beforeAllSubcases(t => {
11761175
const { format } = t.params;
11771176
t.skipIfTextureFormatNotSupported(format);
1177+
t.skipIfMultisampleNotSupportedForFormat(format);
11781178
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
1179-
t.skipIf(
1180-
t.isCompatibility && (format === 'rgba16float' || is32Float(format)),
1181-
'Multisample support for this format is not guaranteed in comapt mode'
1182-
);
11831179
})
11841180
.fn(t => {
11851181
const { format } = t.params;

src/webgpu/gpu_test.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
isTextureFormatUsableAsStorageFormat,
3535
is32Float,
3636
is16Float,
37+
isMultisampledTextureFormat,
3738
} from './format_info.js';
3839
import { checkElementsEqual, checkElementsBetween } from './util/check_contents.js';
3940
import { CommandBufferMaker, EncoderType } from './util/command_buffer_maker.js';
@@ -288,6 +289,26 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
288289
}
289290
}
290291

292+
skipIfMultisampleNotSupportedForFormat(...formats: (GPUTextureFormat | undefined)[]) {
293+
if (this.isCompatibility) {
294+
for (const format of formats) {
295+
if (format === undefined) continue;
296+
if (format === 'rgba16float' || is32Float(format)) {
297+
this.skip(
298+
`texture format '${format} is not guaranteed to be multisampled support in compat mode`
299+
);
300+
}
301+
}
302+
}
303+
304+
for (const format of formats) {
305+
if (format === undefined) continue;
306+
if (!isMultisampledTextureFormat(format)) {
307+
this.skip(`texture format '${format} is not supported to be multisampled`);
308+
}
309+
}
310+
}
311+
291312
getFloatTextureFormatColorRenderableFeatures(...formats: (GPUTextureFormat | undefined)[]) {
292313
const requiredFeatures: GPUFeatureName[] = [];
293314
if (this.isCompatibility) {
@@ -543,6 +564,26 @@ export class GPUTestBase extends Fixture<GPUTestSubcaseBatchState> {
543564
}
544565
}
545566

567+
skipIfMultisampleNotSupportedForFormat(...formats: (GPUTextureFormat | undefined)[]) {
568+
if (this.isCompatibility) {
569+
for (const format of formats) {
570+
if (format === undefined) continue;
571+
if (format === 'rgba16float' || is32Float(format)) {
572+
this.skip(
573+
`texture format '${format} is not guaranteed to be multisampled support in compat mode`
574+
);
575+
}
576+
}
577+
}
578+
579+
for (const format of formats) {
580+
if (format === undefined) continue;
581+
if (!isMultisampledTextureFormat(format)) {
582+
this.skip(`texture format '${format} is not supported to be multisampled`);
583+
}
584+
}
585+
}
586+
546587
skipIfTextureViewDimensionNotSupported(...dimensions: (GPUTextureViewDimension | undefined)[]) {
547588
if (this.isCompatibility) {
548589
for (const dimension of dimensions) {

0 commit comments

Comments
 (0)