[wgsl-in] eagerly evaluate const-expressions

[wgsl-in] support const-expressions in attributes

allow `Splat` as an evaluated const-expression type
This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2023-10-12 13:13:26 +02:00
1 parent c5d884fca8
commit a730236b68
44 files changed
+2917 -2770

No files matched your search

+7 -3
View File
@@ -402,9 +402,8 @@ fn binary_expression_mixed_scalar_and_vector_operands() {
] {
let module = parse_str(&format!(
"
const some_vec = vec3<f32>(1.0, 1.0, 1.0);
@fragment
fn main() -> @location(0) vec4<f32> {{
fn main(@location(0) some_vec: vec3<f32>) -> @location(0) vec4<f32> {{
if (all(1.0 {operand} some_vec)) {{
return vec4(0.0);
}}
@@ -431,7 +430,12 @@ fn binary_expression_mixed_scalar_and_vector_operands() {
})
.count();
assert_eq!(found_expressions, 1);
assert_eq!(
found_expressions,
1,
"expected `{operand}` expression {} splat",
if expect_splat { "with" } else { "without" }
);
}
let module = parse_str(