Skip to content

Commit b07fa2f

Browse files
authored
Add test for compound assignment with swizzle (#4581)
1 parent f4cda20 commit b07fa2f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/webgpu/shader/validation/decl/assignment_statement.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@ g.test('vector_swizzle_assignment')
8080
}`;
8181
t.expectCompileResult(kSwizzleTests[t.params.case].pass, wgsl);
8282
});
83+
84+
g.test('compound_assignment_with_swizzle')
85+
.desc('Test compound assignment of a vector with a swizzle on the rhs.')
86+
.fn(t => {
87+
const code = `
88+
@fragment
89+
fn main() {
90+
var v: vec3<i32> = vec3(1, 2, 3);
91+
var w: vec4<i32> = vec4(10);
92+
v *= w.xyz;
93+
}
94+
`;
95+
t.expectCompileResult(true, code);
96+
});

0 commit comments

Comments
 (0)