Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add float32-blendable feature validation tests #4003

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@types/w3c-image-capture": "^1.0.10",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@webgpu/types": "^0.1.48",
"@webgpu/types": "^0.1.49",
"ansi-colors": "4.1.3",
"babel-plugin-add-header-comment": "^1.0.3",
"babel-plugin-const-enum": "^1.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export const description = `
Tests for capabilities added by float32-blendable flag.
`;

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { ColorTextureFormat } from '../../../format_info.js';

import { CreateRenderPipelineValidationTest } from './common.js';

export const g = makeTestGroup(CreateRenderPipelineValidationTest);

const kFloat32Formats: ColorTextureFormat[] = ['r32float', 'rg32float', 'rgba32float'];

g.test('create_render_pipeline')
.desc(
`
Tests that the float32-blendable feature is required to create a render
pipeline that uses blending with any float32-format attachment.
`
)
.params(u =>
u
.combine('isAsync', [false, true])
.combine('enabled', [true, false] as const)
.beginSubcases()
.combine('hasBlend', [true, false] as const)
.combine('format', kFloat32Formats)
)
.beforeAllSubcases(t => {
if (t.params.enabled) {
t.selectDeviceOrSkipTestCase('float32-blendable');
}
})
.fn(t => {
const { isAsync, enabled, hasBlend, format } = t.params;

const descriptor = t.getDescriptor({
targets: [
{
format,
blend: hasBlend ? { color: {}, alpha: {} } : undefined,
},
],
});

t.doCreateRenderPipelineTest(isAsync, enabled || !hasBlend, descriptor);
});
1 change: 1 addition & 0 deletions src/webgpu/capability_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ export const kFeatureNameInfo: {
'shader-f16': {},
'rg11b10ufloat-renderable': {},
'float32-filterable': {},
'float32-blendable': {},
'clip-distances': {},
'dual-source-blending': {},
};
Expand Down
Loading