mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
[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:
1 parent
c5d884fca8
commit
a730236b68
44 files changed
+2917
-2770
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user