mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
[const-eval] evaluate BinaryOperator::Modulo correctly (use the truncated version instead of floored)
This commit is contained in:
1 parent
a9c28d47c3
commit
13a0ed4eae
1 file changed
+1
-1
@@ -1027,7 +1027,7 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
BinaryOperator::Subtract => a - b,
|
||||
BinaryOperator::Multiply => a * b,
|
||||
BinaryOperator::Divide => a / b,
|
||||
BinaryOperator::Modulo => a - b * (a / b).floor(),
|
||||
BinaryOperator::Modulo => a % b,
|
||||
_ => return Err(ConstantEvaluatorError::InvalidBinaryOpArgs),
|
||||
}),
|
||||
(Literal::Bool(a), Literal::Bool(b)) => Literal::Bool(match op {
|
||||
|
||||
Reference in new issue
Block a user