Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev committed Aug 25, 2024
1 parent 233d160 commit 19f03dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions naga/tests/in/local-const.param.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
()
19 changes: 19 additions & 0 deletions naga/tests/in/local-const.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const ga = 4; // AbstractInt with a value of 4.
const gb: i32 = 4; // i32 with a value of 4.
const ge = vec3(ga, gb, ga);

fn const_in_fn(arg: f32) {
let _abba = 5;
const a = 4; // AbstractInt with a value of 4.
const b: i32 = 4; // i32 with a value of 4.
const c: u32 = 4u; // u32 with a value of 4.
const d: f32 = 4.; // f32 with a value of 4.
const e = vec3(a, b, a); // vec3 of AbstractInt with a value of (4, 4, 4).
const f = 2.0; // AbstractFloat with a value of 2.
// TODO: Make it per spec: https://gpuweb.github.io/gpuweb/wgsl/#const-decls
// currently not possible because naga does not support automatic conversions of Abstract types

//const fa = arg;
}

// TODO: Test for scopes (shadowing?), globals.

0 comments on commit 19f03dc

Please sign in to comment.