From d7abd76deac8ff68e8cd952edd7679bf2e36a384 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 23 Sep 2020 14:40:54 +0000 Subject: [PATCH] Update computeboids typing. This Cl updates some of the literals and types in computeboids to be stricter. Bug: tint:248 Change-Id: I3bc42b8da7913677675d6e417b7f4ce19366eeb9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28840 Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- test/compute_boids.wgsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/compute_boids.wgsl b/test/compute_boids.wgsl index e3f015eb0f..2ddcae1cbb 100644 --- a/test/compute_boids.wgsl +++ b/test/compute_boids.wgsl @@ -68,7 +68,7 @@ type Particles = [[block]] struct { [[stage(compute)]] fn comp_main() -> void { var index : u32 = gl_GlobalInvocationID.x; - if (index >= 5) { + if (index >= 5u) { return; } @@ -83,9 +83,9 @@ fn comp_main() -> void { var pos : vec2; var vel : vec2; - var i : i32 = 0; + var i : u32 = 0u; loop { - if (i >= 5) { + if (i >= 5u) { break; } if (i == index) { @@ -108,7 +108,7 @@ fn comp_main() -> void { } continuing { - i = i + 1; + i = i + 1u; } } if (cMassCount > 0) {