mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[const-eval] evaluate BinaryOperator::Modulo correctly (use the truncated version instead of floored)
This commit is contained in:
@@ -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