Skip to content

Commit bc0a023

Browse files
[naga] Ensure wgsl snapshot code is reachable from an entry point (#7674)
1 parent a95c69e commit bc0a023

File tree

151 files changed

+5468
-3057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+5468
-3057
lines changed

naga/tests/in/wgsl/6220-break-from-loop.wgsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ fn break_from_loop() {
4141
break;
4242
}
4343
}
44+
45+
@compute @workgroup_size(1)
46+
fn main() {
47+
break_from_loop();
48+
}

naga/tests/in/wgsl/7048-multiple-dynamic-1.wgsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@compute @workgroup_size(1)
12
fn f() {
23
let b = array<vec3f, 2>();
34
var poly = vec4f(0);

naga/tests/in/wgsl/7048-multiple-dynamic-3.wgsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ fn foobar(normals: array<vec3f, 12>, count: u32) -> QEFResult {
1414

1515
return QEFResult(0.0, vec3(0.0));
1616
}
17+
18+
@fragment
19+
fn main() {
20+
var arr: array<vec3f, 12>;
21+
foobar(arr, 1);
22+
}

naga/tests/in/wgsl/abstract-types-atomic.wgsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ fn test_atomic_u32() {
3232
_ = atomicMax(&atomic_u32, 1);
3333
_ = atomicExchange(&atomic_u32, 1);
3434
}
35+
36+
@compute @workgroup_size(1)
37+
fn main() {
38+
test_atomic_i32();
39+
test_atomic_u32();
40+
}

naga/tests/in/wgsl/abstract-types-builtins.wgsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@compute @workgroup_size(1)
12
fn f() {
23
// For calls that return abstract types, we can't write the type we
34
// actually expect, but we can at least require an automatic

naga/tests/in/wgsl/abstract-types-function-calls.wgsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const const_mat_af = mat2x2(vec2(0.0), vec2(0.0));
2222
const const_arr_af = array(0.0, 0.0);
2323
const const_arr_ai = array(0, 0);
2424

25+
@compute @workgroup_size(1)
2526
fn main() {
2627
func_f(0.0);
2728
func_f(0);

naga/tests/in/wgsl/abstract-types-let.wgsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,9 @@ fn mixed_constant_and_runtime_arguments() {
113113
let xvusu: vec2<u32> = vec2(u);
114114
let xvfsf: vec2<f32> = vec2(f);
115115
}
116+
117+
@compute @workgroup_size(1)
118+
fn main() {
119+
all_constant_arguments();
120+
mixed_constant_and_runtime_arguments();
121+
}

naga/tests/in/wgsl/abstract-types-operators.wgsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,10 @@ fn wgpu_4435() {
8484
let x = 1;
8585
let y = a[x-1];
8686
}
87+
88+
@compute @workgroup_size(1)
89+
fn main() {
90+
runtime_values();
91+
wgpu_4445();
92+
wgpu_4435();
93+
}

naga/tests/in/wgsl/abstract-types-return.wgsl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@compute @workgroup_size(1)
2-
fn main() {}
3-
41
fn return_i32_ai() -> i32 {
52
return 1;
63
}
@@ -34,3 +31,15 @@ fn return_vec2f32_const_ai() -> vec2<f32> {
3431
const vec_one = vec2(1);
3532
return vec_one;
3633
}
34+
35+
@compute @workgroup_size(1)
36+
fn main() {
37+
return_i32_ai();
38+
return_u32_ai();
39+
return_f32_ai();
40+
return_f32_af();
41+
return_vec2f32_ai();
42+
return_arrf32_ai();
43+
return_const_f32_const_ai();
44+
return_vec2f32_const_ai();
45+
}

naga/tests/in/wgsl/abstract-types-texture.wgsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ fn depth() {
2424
fn storage() {
2525
textureStore(st, vec2(0,1), vec4(2,3,4,5));
2626
}
27+
28+
@fragment
29+
fn main() {
30+
color();
31+
depth();
32+
storage();
33+
}

0 commit comments

Comments
 (0)