diff options
| author | 2021-05-10 03:55:09 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | 3b6a632237e2f8388f2591d54fb31bebdc2a0ade (patch) | |
| tree | 7c7c1c4ca32f986bae1fc8f23330a21551bf5086 /src/shader_recompiler/frontend/maxwell | |
| parent | glasm: Properly clamp Fp64 on GLASM (diff) | |
| download | yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.gz yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.xz yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.zip | |
shader: Add floating-point rounding to I2F
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp index 3c233597f..d6224d5cc 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp | |||
| @@ -99,7 +99,12 @@ void I2F(TranslatorVisitor& v, u64 insn, IR::U32U64 src) { | |||
| 99 | } | 99 | } |
| 100 | const int conversion_src_bitsize{i2f.int_format == IntFormat::U64 ? 64 : 32}; | 100 | const int conversion_src_bitsize{i2f.int_format == IntFormat::U64 ? 64 : 32}; |
| 101 | const int dst_bitsize{BitSize(i2f.float_format)}; | 101 | const int dst_bitsize{BitSize(i2f.float_format)}; |
| 102 | IR::F16F32F64 value{v.ir.ConvertIToF(dst_bitsize, conversion_src_bitsize, is_signed, src)}; | 102 | const IR::FpControl fp_control{ |
| 103 | .no_contraction = false, | ||
| 104 | .rounding = CastFpRounding(i2f.fp_rounding), | ||
| 105 | .fmz_mode = IR::FmzMode::DontCare, | ||
| 106 | }; | ||
| 107 | auto value{v.ir.ConvertIToF(dst_bitsize, conversion_src_bitsize, is_signed, src, fp_control)}; | ||
| 103 | if (i2f.neg != 0) { | 108 | if (i2f.neg != 0) { |
| 104 | if (i2f.abs != 0 || !is_signed) { | 109 | if (i2f.abs != 0 || !is_signed) { |
| 105 | // We know the value is positive | 110 | // We know the value is positive |