Convert WGSL comments to //
This CL updates the tests with WGSL sources to use // for comments
instead of #. This matches the current WGSL spec.
Change-Id: I04e1a18630a16b794955cace7e55a89221c964fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37520
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp
index 2dfc628..4acc6aa 100644
--- a/examples/ComputeBoids.cpp
+++ b/examples/ComputeBoids.cpp
@@ -151,8 +151,7 @@
}
void initSim() {
- wgpu::ShaderModule module =
- utils::CreateShaderModuleFromWGSL(device, R"(
+ wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Particle {
[[offset(0)]] pos : vec2<f32>;
[[offset(8)]] vel : vec2<f32>;
@@ -175,7 +174,7 @@
[[binding(2), set(0)]] var<storage_buffer> particlesB : [[access(read_write)]] Particles;
[[builtin(global_invocation_id)]] var<in> GlobalInvocationID : vec3<u32>;
- # 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 main() -> void {
var index : u32 = GlobalInvocationID.x;
@@ -222,12 +221,12 @@
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;
}
@@ -241,7 +240,7 @@
vPos.y = -1.0;
}
- # Write back
+ // Write back
particlesB.particles[index].pos = vPos;
particlesB.particles[index].vel = vVel;
return;