diff --git a/test/compute_boids.wgsl b/test/compute_boids.wgsl index 99c0549dfc..9b0059e7eb 100644 --- a/test/compute_boids.wgsl +++ b/test/compute_boids.wgsl @@ -1,18 +1,18 @@ -# Copyright 2020 The Tint Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -# vertex shader +// vertex shader [[location(0)]] var a_particlePos : vec2; [[location(1)]] var a_particleVel : vec2; @@ -28,7 +28,7 @@ fn vert_main() -> void { gl_Position = vec4(pos + a_particlePos, 0.0, 1.0); } -# fragment shader +// fragment shader [[location(0)]] var fragColor : vec4; [[stage(fragment)]] @@ -36,7 +36,7 @@ fn frag_main() -> void { fragColor = vec4(1.0, 1.0, 1.0, 1.0); } -# compute shader +// compute shader [[block]] struct Particle { [[offset(0)]] pos : vec2; [[offset(8)]] vel : vec2; @@ -62,7 +62,7 @@ fn frag_main() -> void { [[builtin(global_invocation_id)]] var gl_GlobalInvocationID : vec3; -# https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp +// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp [[stage(compute)]] fn comp_main() -> void { var index : u32 = gl_GlobalInvocationID.x; @@ -112,13 +112,13 @@ fn comp_main() -> void { vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) + (cVel * params.rule3Scale); - # clamp velocity for a more pleasing simulation + // clamp velocity for a more pleasing simulation vVel = normalize(vVel) * clamp(length(vVel), 0.0, 0.1); - # kinematic update + // kinematic update vPos = vPos + (vVel * params.deltaT); - # Wrap around boundary + // Wrap around boundary if (vPos.x < -1.0) { vPos.x = 1.0; } @@ -132,7 +132,7 @@ fn comp_main() -> void { vPos.y = -1.0; } - # Write back + // Write back particlesB.particles[index].pos = vPos; particlesB.particles[index].vel = vVel; } diff --git a/test/cube.wgsl b/test/cube.wgsl index ee2d2cb939..0e0377b7d6 100644 --- a/test/cube.wgsl +++ b/test/cube.wgsl @@ -1,18 +1,18 @@ -# Copyright 2020 The Tint Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -# Vertex shader +// Vertex shader [[block]] struct Uniforms { [[offset(0)]] modelViewProjectionMatrix : mat4x4; }; @@ -30,7 +30,7 @@ fn vtx_main() -> void { vtxFragColor = color; } -# Fragment shader +// Fragment shader [[location(0)]] var fragColor : vec4; [[location(0)]] var outColor : vec4; diff --git a/test/function.wgsl b/test/function.wgsl index 604b8ffef3..9016ba217c 100644 --- a/test/function.wgsl +++ b/test/function.wgsl @@ -1,16 +1,16 @@ -# Copyright 2020 The Tint Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. fn main() -> f32 { return ((2. * 3.) - 4.) / 5.; diff --git a/test/simple.wgsl b/test/simple.wgsl index 844bfcbbf4..e372d2db2e 100644 --- a/test/simple.wgsl +++ b/test/simple.wgsl @@ -1,16 +1,16 @@ -# Copyright 2020 The Tint Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. [[location(0)]] var gl_FragColor : vec4; diff --git a/test/triangle.wgsl b/test/triangle.wgsl index d612c94ee2..6a29c19c7e 100644 --- a/test/triangle.wgsl +++ b/test/triangle.wgsl @@ -1,18 +1,18 @@ -# Copyright 2020 The Tint Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -# Vertex shader +// Vertex shader const pos : array, 3> = array, 3>( vec2(0.0, 0.5), vec2(-0.5, -0.5), @@ -26,7 +26,7 @@ fn vtx_main() -> void { Position = vec4(pos[VertexIndex], 0.0, 1.0); } -# Fragment shader +// Fragment shader [[location(0)]] var outColor : vec4; [[stage(fragment)]]