From 64db1d9a9baa5b5fb1d4777d73f0dd8fd63a7f07 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Fri, 1 May 2020 19:05:43 +0000 Subject: [PATCH] Add mising computeboids casts. This CL adds in missing casts from i32 to f32 when using the count variables in computeboids to create vec3 values. Change-Id: I3e66e2db0fc626b94ae98142cd95a65feff7fc53 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20627 Reviewed-by: David Neto --- test/compute_boids.wgsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/compute_boids.wgsl b/test/compute_boids.wgsl index d6d8058973..4f2f44fd58 100644 --- a/test/compute_boids.wgsl +++ b/test/compute_boids.wgsl @@ -113,10 +113,11 @@ fn compute_main() -> void { } } if (cMassCount > 0) { - cMass = (cMass / vec2(cMassCount, cMassCount)) + vPos; + cMass = + (cMass / vec2(cast(cMassCount), cast(cMassCount))) + vPos; } if (cVelCount > 0) { - cVel = cVel / vec2(cVelCount, cVelCount); + cVel = cVel / vec2(cast(cVelCount), cast(cVelCount)); } vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) +