aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/wgsl/basic.wgsl
blob: ccf29a3605a21c4dfb89a087985707c644e00c1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
struct Vertex {
  @location(0) position: vec3<f32>,
  @location(1) color: vec4<f32>,
};

@vertex
fn vertex(vertex: Vertex) -> VertexOutput {
  var out: VertexOutput;
  out.a = 1;
  if (1) {
    out.a = 3;
  }
  if (2) {
    dsa;
  }

  loop {
    if (i >= 4) { break; }
  }
  out.b = 2;
  return out;
}

@vertex
fn vertex(vertex: Vertex,
  foo: dso,
  foo: dsa
) -> VertexOutput {
  var out: VertexOutput;
  out.a = 1;
  out.b = 2;
  return out;
}

@vertex
fn vertex(vertex: Vertex,
  foo: dso,
  foo: dsa) -> VertexOutput {
  var out: VertexOutput;
  out.a = 1;
  out.b = 2;
  return out;
}

fn foo(
  a: u32,
  b: u32,
) {
  return a;
}

fn bar(
) {}

fn baz(
  a: u32,
) {}

fn qux(
)