Skip to content

Commit

Permalink
Compat: remove select device for float16(32)-renderable features (#4166)
Browse files Browse the repository at this point in the history
* Compat: remove select device for float16(32)-renderable features

* rename skipIfMultisampleNotSupportedForFormat

* update skipIfColorRenderableNotSupportedForFormat

* fix

* color renderable: select -> skip
  • Loading branch information
shrekshao authored Jan 29, 2025
1 parent c10aba7 commit e9df678
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 97 deletions.
2 changes: 1 addition & 1 deletion src/webgpu/api/operation/render_pass/storeOp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ g.test('render_pass_store_op,color_attachment_only')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.colorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.colorFormat);
t.skipIfColorRenderableNotSupportedForFormat(t.params.colorFormat);
})
.fn(t => {
const colorAttachment = t.createTextureTracked({
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/operation/render_pipeline/overrides.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ g.test('precision')
])
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(kPrecisionTestFormat);
t.skipIfColorRenderableNotSupportedForFormat(kPrecisionTestFormat);
})
.fn(async t => {
const format = kPrecisionTestFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ g.test('color,attachments')
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -161,7 +161,7 @@ g.test('color,component_count')
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down
6 changes: 3 additions & 3 deletions src/webgpu/api/operation/rendering/color_target_state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ g.test('blending,GPUBlendComponent')
) {
t.selectDeviceOrSkipTestCase('dual-source-blending');
}
t.selectDeviceForRenderableColorFormatOrSkipTestCase(kBlendingGPUBlendComponentFormat);
t.skipIfColorRenderableNotSupportedForFormat(kBlendingGPUBlendComponentFormat);
})
.fn(t => {
const textureFormat: GPUTextureFormat = kBlendingGPUBlendComponentFormat;
Expand Down Expand Up @@ -395,7 +395,7 @@ g.test('blending,formats')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format } = t.params;
Expand Down Expand Up @@ -801,7 +801,7 @@ g.test('blending,clamping')
.combine('dstValue', [0.2, 0.4])
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format, srcValue, dstValue } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ g.test('uninitialized_texture_is_zero')
.params(kTestParams)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
t.selectDeviceOrSkipTestCase(kTextureFormatInfo[t.params.format].feature);
})
.fn(t => {
Expand Down
10 changes: 5 additions & 5 deletions src/webgpu/api/operation/sampling/filter_mode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ g.test('magFilter,nearest')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
if (kTextureFormatInfo[t.params.format].color.type === 'unfilterable-float') {
t.selectDeviceOrSkipTestCase('float32-filterable');
}
Expand Down Expand Up @@ -605,7 +605,7 @@ g.test('magFilter,linear')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
if (kTextureFormatInfo[t.params.format].color.type === 'unfilterable-float') {
t.selectDeviceOrSkipTestCase('float32-filterable');
}
Expand Down Expand Up @@ -741,7 +741,7 @@ g.test('minFilter,nearest')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
if (kTextureFormatInfo[t.params.format].color.type === 'unfilterable-float') {
t.selectDeviceOrSkipTestCase('float32-filterable');
}
Expand Down Expand Up @@ -875,7 +875,7 @@ g.test('minFilter,linear')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
if (kTextureFormatInfo[t.params.format].color.type === 'unfilterable-float') {
t.selectDeviceOrSkipTestCase('float32-filterable');
}
Expand Down Expand Up @@ -972,7 +972,7 @@ g.test('mipmapFilter')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
if (kTextureFormatInfo[t.params.format].color.type === 'unfilterable-float') {
t.selectDeviceOrSkipTestCase('float32-filterable');
}
Expand Down
4 changes: 2 additions & 2 deletions src/webgpu/api/operation/texture_view/write.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ TODO: Test rgb10a2uint when TexelRepresentation.numericRange is made per-compone
// Still need to filter again for compat mode.
t.skipIfTextureFormatNotUsableAsStorageTexture(format);
if (sampleCount > 1) {
t.skipIfMultisampleNotSupportedForFormatOrSelectDevice(format);
t.skipIfMultisampleNotSupportedForFormat(format);
}
break;
case 'render-pass-resolve':
case 'render-pass-store':
// Requires multisample in `writeTextureAndGetExpectedTexelView`
t.skipIfMultisampleNotSupportedForFormatOrSelectDevice(format);
t.skipIfMultisampleNotSupportedForFormat(format);
break;
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/validation/createBindGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ g.test('texture_binding_must_have_correct_usage')
})
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(kTestFormat);
t.skipIfColorRenderableNotSupportedForFormat(kTestFormat);
})
.fn(t => {
const { entry, usage } = t.params;
Expand Down
6 changes: 3 additions & 3 deletions src/webgpu/api/validation/createTexture.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ g.test('sampleCount,various_sampleCount_with_all_formats')
const { format } = t.params;
const info = kTextureFormatInfo[format];
t.skipIfTextureFormatNotSupported(format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -359,7 +359,7 @@ g.test('sampleCount,valid_sampleCount_with_other_parameter_varies')
const info = kTextureFormatInfo[format];
t.skipIfTextureFormatNotSupported(format);
t.selectDeviceOrSkipTestCase(info.feature);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
})
.fn(t => {
const { dimension, sampleCount, format, mipLevelCount, arrayLayerCount, usage } = t.params;
Expand Down Expand Up @@ -1053,7 +1053,7 @@ g.test('texture_usage')
const info = kTextureFormatInfo[format];
t.skipIfTextureFormatNotSupported(format);
t.selectDeviceOrSkipTestCase(info.feature);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
})
.fn(t => {
const { dimension, format, usage0, usage1 } = t.params;
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/validation/createView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ g.test('texture_view_usage')
t.skipIfTextureFormatNotUsableAsStorageTexture(format);
}
if (textureUsage & GPUTextureUsage.RENDER_ATTACHMENT) {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
}
})
.fn(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ g.test('attachment_state,limits,maxColorAttachmentBytesPerSample,aligned')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format, colorFormatCount } = t.params;
Expand Down Expand Up @@ -120,7 +120,7 @@ g.test('attachment_state,limits,maxColorAttachmentBytesPerSample,unaligned')
])
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { formats } = t.params;
Expand Down Expand Up @@ -172,7 +172,7 @@ g.test('valid_texture_formats')
.beforeAllSubcases(t => {
const { format } = t.params;
t.selectDeviceForTextureFormatOrSkipTestCase(format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
})
.fn(t => {
const { format, attachment } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ g.test('destination_texture,format')
const { format } = t.params;
t.skipIfTextureFormatNotSupported(format);
t.selectDeviceOrSkipTestCase(kTextureFormatInfo[format].feature);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
})
.fn(async t => {
const { format, copySize } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ g.test('color_attachments,limits,maxColorAttachmentBytesPerSample,aligned')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format, attachmentCount } = t.params;
Expand Down Expand Up @@ -269,7 +269,7 @@ g.test('color_attachments,limits,maxColorAttachmentBytesPerSample,unaligned')
])
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { formats } = t.params;
Expand Down Expand Up @@ -1174,7 +1174,7 @@ g.test('resolveTarget,format_supports_resolve')
.beforeAllSubcases(t => {
const { format } = t.params;
t.skipIfTextureFormatNotSupported(format);
t.skipIfMultisampleNotSupportedForFormatOrSelectDevice(format);
t.skipIfMultisampleNotSupportedForFormat(format);
})
.fn(t => {
const { format } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline that uses blending with any float32-format attachment.
if (t.params.enabled) {
t.selectDeviceOrSkipTestCase('float32-blendable');
}
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { isAsync, enabled, hasBlend, format } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ g.test('limits,maxColorAttachmentBytesPerSample,aligned')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format, attachmentCount, isAsync } = t.params;
Expand Down Expand Up @@ -230,7 +230,7 @@ g.test('limits,maxColorAttachmentBytesPerSample,unaligned')
.combine('isAsync', [false, true])
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { formats, isAsync } = t.params;
Expand Down Expand Up @@ -269,7 +269,7 @@ g.test('targets_format_filterable')
const { format } = t.params;
const info = kTextureFormatInfo[format];
t.skipIfTextureFormatNotSupported(format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(format);
t.skipIfColorRenderableNotSupportedForFormat(format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -399,7 +399,7 @@ g.test('pipeline_output_targets')
)
.beforeAllSubcases(t => {
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfColorRenderableNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { isAsync, format, writeMask, shaderOutput } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ g.test('subresources,color_attachments')
.unless(t => t.inSamePass && t.level0 !== t.level1)
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { layer0, level0, layer1, level1, inSamePass } = t.params;
Expand Down Expand Up @@ -197,7 +197,7 @@ g.test('subresources,color_attachment_and_bind_group')
t.params.bgLayerCount !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
}
})
.fn(t => {
Expand Down Expand Up @@ -476,7 +476,7 @@ g.test('subresources,multiple_bind_groups')
t.params.bg0Layers.count !== kTextureLayers || t.params.bg1Layers.count !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
}
})
.fn(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ g.test('subresources,texture_usages_in_copy_and_render_pass')
)
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
})
.fn(t => {
const { usage0, usage1 } = t.params;
Expand Down Expand Up @@ -620,7 +620,7 @@ g.test('subresources,texture_view_usages')
)
.beforeAllSubcases(t => {
if (t.params.bindingType === 'color-attachment') {
t.selectDeviceForRenderableColorFormatOrSkipTestCase('r32float');
t.skipIfColorRenderableNotSupportedForFormat('r32float');
}
})
.fn(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ g.test('multisample')
})
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.skipIfMultisampleNotSupportedForFormat(t.params.format);
})
.fn(t => {
const { format } = t.params;
Expand Down
Loading

0 comments on commit e9df678

Please sign in to comment.