Add mising computeboids casts.
This CL adds in missing casts from i32 to f32 when using the count variables in computeboids to create vec3<f32> values. Change-Id: I3e66e2db0fc626b94ae98142cd95a65feff7fc53 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20627 Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
parent
cf3517812c
commit
64db1d9a9b
|
@ -113,10 +113,11 @@ fn compute_main() -> void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cMassCount > 0) {
|
if (cMassCount > 0) {
|
||||||
cMass = (cMass / vec2<f32>(cMassCount, cMassCount)) + vPos;
|
cMass =
|
||||||
|
(cMass / vec2<f32>(cast<f32>(cMassCount), cast<f32>(cMassCount))) + vPos;
|
||||||
}
|
}
|
||||||
if (cVelCount > 0) {
|
if (cVelCount > 0) {
|
||||||
cVel = cVel / vec2<f32>(cVelCount, cVelCount);
|
cVel = cVel / vec2<f32>(cast<f32>(cVelCount), cast<f32>(cVelCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) +
|
vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) +
|
||||||
|
|
Loading…
Reference in New Issue