summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-07 04:21:29 +0200
committerbunnei <bunneidev@gmail.com>2018-06-07 04:21:29 +0200
commit128aeba0f3fc2477f91a00b1aba866f113a6945f (patch)
tree1022593280140fa23c14b78c7dfebf0b20ea1cfe /src/video_core/renderer_opengl
parentMerge pull request #537 from bunnei/misc-shader (diff)
downloadyuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar.gz
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar.bz2
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar.lz
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar.xz
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.tar.zst
yuzu-128aeba0f3fc2477f91a00b1aba866f113a6945f.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index f84cedc1d..8e249584f 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1056,10 +1056,27 @@ private:
break;
}
case OpCode::Id::F2F_R: {
- // TODO(Subv): Implement rounding operations.
- ASSERT_MSG(instr.conversion.f2f.rounding == 0, "Unimplemented rounding operation");
std::string op_a = regs.GetRegisterAsFloat(instr.gpr20);
+ switch (instr.conversion.f2f.rounding) {
+ case Tegra::Shader::F2fRoundingOp::None:
+ break;
+ case Tegra::Shader::F2fRoundingOp::Floor:
+ op_a = "floor(" + op_a + ')';
+ break;
+ case Tegra::Shader::F2fRoundingOp::Ceil:
+ op_a = "ceil(" + op_a + ')';
+ break;
+ case Tegra::Shader::F2fRoundingOp::Trunc:
+ op_a = "trunc(" + op_a + ')';
+ break;
+ default:
+ NGLOG_CRITICAL(HW_GPU, "Unimplemented f2f rounding mode {}",
+ static_cast<u32>(instr.conversion.f2f.rounding.Value()));
+ UNREACHABLE();
+ break;
+ }
+
if (instr.conversion.abs_a) {
op_a = "abs(" + op_a + ')';
}
@@ -1074,17 +1091,16 @@ private:
op_a = "abs(" + op_a + ')';
}
- using Tegra::Shader::FloatRoundingOp;
switch (instr.conversion.f2i.rounding) {
- case FloatRoundingOp::None:
+ case Tegra::Shader::F2iRoundingOp::None:
break;
- case FloatRoundingOp::Floor:
+ case Tegra::Shader::F2iRoundingOp::Floor:
op_a = "floor(" + op_a + ')';
break;
- case FloatRoundingOp::Ceil:
+ case Tegra::Shader::F2iRoundingOp::Ceil:
op_a = "ceil(" + op_a + ')';
break;
- case FloatRoundingOp::Trunc:
+ case Tegra::Shader::F2iRoundingOp::Trunc:
op_a = "trunc(" + op_a + ')';
break;
default: