summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-31 20:45:02 +0200
committerGitHub <noreply@github.com>2020-03-31 20:45:02 +0200
commitb03c0536ce24ab261e1ed99f2bd180a1b7825f2f (patch)
treeb985eb4a295a27fde19302dee625aba60eea46f6 /src
parentMerge pull request #3577 from ReinUsesLisp/lea (diff)
parentshader/conversion: Fix F2F rounding operations with different sizes (diff)
downloadyuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar.gz
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar.bz2
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar.lz
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar.xz
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.tar.zst
yuzu-b03c0536ce24ab261e1ed99f2bd180a1b7825f2f.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/conversion.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/shader/decode/conversion.cpp b/src/video_core/shader/decode/conversion.cpp
index 6ead42070..c72690b2b 100644
--- a/src/video_core/shader/decode/conversion.cpp
+++ b/src/video_core/shader/decode/conversion.cpp
@@ -138,18 +138,23 @@ u32 ShaderIR::DecodeConversion(NodeBlock& bb, u32 pc) {
value = GetOperandAbsNegFloat(value, instr.conversion.abs_a, instr.conversion.negate_a);
- value = [&]() {
+ value = [&] {
+ if (instr.conversion.src_size != instr.conversion.dst_size) {
+ // Rounding operations only matter when the source and destination conversion size
+ // is the same.
+ return value;
+ }
switch (instr.conversion.f2f.GetRoundingMode()) {
case Tegra::Shader::F2fRoundingOp::None:
return value;
case Tegra::Shader::F2fRoundingOp::Round:
- return Operation(OperationCode::FRoundEven, PRECISE, value);
+ return Operation(OperationCode::FRoundEven, value);
case Tegra::Shader::F2fRoundingOp::Floor:
- return Operation(OperationCode::FFloor, PRECISE, value);
+ return Operation(OperationCode::FFloor, value);
case Tegra::Shader::F2fRoundingOp::Ceil:
- return Operation(OperationCode::FCeil, PRECISE, value);
+ return Operation(OperationCode::FCeil, value);
case Tegra::Shader::F2fRoundingOp::Trunc:
- return Operation(OperationCode::FTrunc, PRECISE, value);
+ return Operation(OperationCode::FTrunc, value);
default:
UNIMPLEMENTED_MSG("Unimplemented F2F rounding mode {}",
static_cast<u32>(instr.conversion.f2f.rounding.Value()));