Skip to content

Commit

Permalink
wgsl: Implement validation test for parsing f16 literal (#3059)
Browse files Browse the repository at this point in the history
This PR add missing validation test for parsing f16 literal.

Issue: #1192
  • Loading branch information
jiangzhaoming authored Oct 20, 2023
1 parent c78f0a4 commit e5e7ee1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/webgpu/shader/validation/parse/literal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,16 @@ const kAbstractFloat = new Set([
.desc(
`
Test that valid half floats are accepted, and invalid half floats are rejected
TODO: Need to inject the 'enable fp16' into the shader to enable the parsing.
`
)
.params(u => u.combine('val', new Set([...kValidF16, ...kInvalidF16])).beginSubcases())
.unimplemented();
.beforeAllSubcases(t => {
t.selectDeviceOrSkipTestCase('shader-f16');
})
.fn(t => {
const { val } = t.params;
const code = `var test: f16 = ${val};`;
const extensionList = ['f16'];
t.expectCompileResult(kValidF16.has(val), t.wrapInEntryPoint(code, extensionList));
});
}

0 comments on commit e5e7ee1

Please sign in to comment.