diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-20 23:38:25 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-20 23:38:25 +0200 |
commit | 11f4e739bd6d076606069420a38a5e8535fa9440 (patch) | |
tree | 75ad67e32ccef4081b1dbe64cdab416e720d195e /src/video_core/renderer_opengl | |
parent | Merge pull request #2693 from ReinUsesLisp/hsetp2 (diff) | |
download | yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar.gz yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar.bz2 yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar.lz yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar.xz yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.tar.zst yuzu-11f4e739bd6d076606069420a38a5e8535fa9440.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index e19d502bc..7e9251626 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1122,6 +1122,16 @@ private: Type::Float); } + std::string FCastHalf0(Operation operation) { + const std::string op_a = VisitOperand(operation, 0, Type::HalfFloat); + return fmt::format("({})[0]", op_a); + } + + std::string FCastHalf1(Operation operation) { + const std::string op_a = VisitOperand(operation, 0, Type::HalfFloat); + return fmt::format("({})[1]", op_a); + } + template <Type type> std::string Min(Operation operation) { return GenerateBinaryCall(operation, "min", type, type, type); @@ -1278,6 +1288,11 @@ private: return ApplyPrecise(operation, BitwiseCastResult(clamped, Type::HalfFloat)); } + std::string HCastFloat(Operation operation) { + const std::string op_a = VisitOperand(operation, 0, Type::Float); + return fmt::format("fromHalf2(vec2({}, 0.0f))", op_a); + } + std::string HUnpack(Operation operation) { const std::string operand{VisitOperand(operation, 0, Type::HalfFloat)}; const auto value = [&]() -> std::string { @@ -1718,6 +1733,8 @@ private: &GLSLDecompiler::Negate<Type::Float>, &GLSLDecompiler::Absolute<Type::Float>, &GLSLDecompiler::FClamp, + &GLSLDecompiler::FCastHalf0, + &GLSLDecompiler::FCastHalf1, &GLSLDecompiler::Min<Type::Float>, &GLSLDecompiler::Max<Type::Float>, &GLSLDecompiler::FCos, @@ -1778,6 +1795,7 @@ private: &GLSLDecompiler::Absolute<Type::HalfFloat>, &GLSLDecompiler::HNegate, &GLSLDecompiler::HClamp, + &GLSLDecompiler::HCastFloat, &GLSLDecompiler::HUnpack, &GLSLDecompiler::HMergeF32, &GLSLDecompiler::HMergeH0, |