Fix wgsl remainder definition (#1979)

This commit is contained in:
Nathaniel Simard 2024-07-08 15:26:10 -04:00 committed by GitHub
parent e8b915a2da
commit e7a3cc4fba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -268,9 +268,9 @@ impl Display for Instruction {
Instruction::Modulo { lhs, rhs, out } => {
f.write_fmt(format_args!("{out} = {lhs} % {rhs};\n"))
}
Instruction::Remainder { lhs, rhs, out } => {
f.write_fmt(format_args!("{out} = (({lhs} % {rhs}) + {rhs}) % {rhs};\n"))
}
Instruction::Remainder { lhs, rhs, out } => f.write_fmt(format_args!(
"{out} = {lhs} - {rhs} * floor({lhs} / {rhs});\n"
)),
Instruction::Sub { lhs, rhs, out } => {
f.write_fmt(format_args!("{out} = {lhs} - {rhs};\n"))
}