-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,346 additions
and
1,224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
( | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
struct Foo { | ||
a: vec4<f32>, | ||
b: i32, | ||
} | ||
|
||
// const const1 = vec3<f32>(0.0); // TODO: this is now a splat and we need to const eval it | ||
const const2 = vec3(0.0, 0.0, 0.0); | ||
const const3 = mat2x2<f32>(0.0, 0.0, 0.0, 0.0); | ||
const const4 = array<mat2x2<f32>, 1>(mat2x2<f32>(0.0, 0.0, 0.0, 0.0)); | ||
|
||
// zero value constructors | ||
const cz0 = bool(); | ||
const cz1 = i32(); | ||
const cz2 = u32(); | ||
const cz3 = f32(); | ||
const cz4 = vec2<u32>(); | ||
const cz5 = mat2x2<f32>(); | ||
const cz6 = array<Foo, 3>(); | ||
const cz7 = Foo(); | ||
|
||
// constructors that infer their type from their parameters | ||
// TODO: these also contain splats | ||
// const cp1 = vec2(0u); | ||
// const cp2 = mat2x2(vec2(0.), vec2(0.)); | ||
const cp3 = array(0, 1, 2, 3); | ||
|
||
@compute @workgroup_size(1) | ||
fn main() { | ||
var foo: Foo; | ||
foo = Foo(vec4<f32>(1.0), 1); | ||
|
||
_ = mat2x2<f32>( | ||
1.0, 0.0, | ||
0.0, 1.0, | ||
); | ||
_ = mat4x4<f32>( | ||
1.0, 0.0, 0.0, 0.0, | ||
0.0, 1.0, 0.0, 0.0, | ||
0.0, 0.0, 1.0, 0.0, | ||
0.0, 0.0, 0.0, 1.0, | ||
); | ||
|
||
// zero value constructors | ||
_ = bool(); | ||
_ = i32(); | ||
_ = u32(); | ||
_ = f32(); | ||
_ = vec2<u32>(); | ||
_ = mat2x2<f32>(); | ||
_ = array<Foo, 3>(); | ||
_ = Foo(); | ||
|
||
// constructors that infer their type from their parameters | ||
_ = vec2(0u); | ||
_ = mat2x2(vec2(0.), vec2(0.)); | ||
_ = array(0, 1, 2, 3); | ||
|
||
// identity constructors | ||
_ = bool(bool()); | ||
_ = i32(i32()); | ||
_ = u32(u32()); | ||
_ = f32(f32()); | ||
_ = vec2<u32>(vec2<u32>()); | ||
_ = mat2x3<f32>(mat2x3<f32>()); | ||
_ = vec2(vec2<u32>()); | ||
_ = mat2x3(mat2x3<f32>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#version 310 es | ||
|
||
precision highp float; | ||
precision highp int; | ||
|
||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
const vec3 const2_ = vec3(0.0, 0.0, 0.0); | ||
const mat2x2 const3_ = mat2x2(vec2(0.0, 0.0), vec2(0.0, 0.0)); | ||
const mat2x2 const4_ = mat2x2[1](mat2x2(vec2(0.0, 0.0), vec2(0.0, 0.0))); | ||
const bool cz0_ = false; | ||
const int cz1_ = 0; | ||
const uint cz2_ = 0u; | ||
const float cz3_ = 0.0; | ||
const uvec2 cz4_ = uvec2(0u); | ||
const mat2x2 cz5_ = mat2x2(0.0); | ||
const Foo cz6_ = Foo[3](Foo(vec4(0.0), 0), Foo(vec4(0.0), 0), Foo(vec4(0.0), 0)); | ||
const Foo cz7_ = Foo(vec4(0.0), 0); | ||
const int cp3_ = int[4](0, 1, 2, 3); | ||
|
||
struct Foo { | ||
vec4 a; | ||
int b; | ||
}; | ||
|
||
void main() { | ||
Foo foo = Foo(vec4(0.0), 0); | ||
foo = Foo(vec4(1.0), 1); | ||
mat2x2 unnamed = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); | ||
mat4x4 unnamed_1 = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); | ||
uvec2 unnamed_2 = uvec2(0u); | ||
mat2x2 unnamed_3 = mat2x2(vec2(0.0), vec2(0.0)); | ||
int unnamed_4[4] = int[4](0, 1, 2, 3); | ||
bool unnamed_5 = bool(false); | ||
int unnamed_6 = int(0); | ||
uint unnamed_7 = uint(0u); | ||
float unnamed_8 = float(0.0); | ||
uvec2 unnamed_9 = uvec2(uvec2(0u)); | ||
mat2x3 unnamed_10 = mat2x3(mat2x3(0.0)); | ||
uvec2 unnamed_11 = uvec2(0u); | ||
mat2x3 unnamed_12 = mat2x3(0.0); | ||
} | ||
|
Oops, something went wrong.