diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-02-13 02:14:39 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-02-14 08:25:07 +0100 |
commit | 10682ad7e055391757686e91252dabe2832d58cd (patch) | |
tree | db6f61bdaf8cd10ac943d38f639acdbe2d8e8453 /src/video_core/shader/decode/other.cpp | |
parent | Merge pull request #2115 from lioncash/local (diff) | |
download | yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar.gz yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar.bz2 yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar.lz yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar.xz yuzu-10682ad7e055391757686e91252dabe2832d58cd.tar.zst yuzu-10682ad7e055391757686e91252dabe2832d58cd.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/other.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index f9502e3d0..d750a2936 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp @@ -135,7 +135,18 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { instr.ipa.sample_mode.Value()}; const Node attr = GetInputAttribute(attribute.index, attribute.element, input_mode); - const Node value = GetSaturatedFloat(attr, instr.ipa.saturate); + Node value = attr; + const Tegra::Shader::Attribute::Index index = attribute.index.Value(); + if (index >= Tegra::Shader::Attribute::Index::Attribute_0 && + index <= Tegra::Shader::Attribute::Index::Attribute_31) { + // TODO(Blinkhawk): There are cases where a perspective attribute use PASS. + // In theory by setting them as perspective, OpenGL does the perspective correction. + // A way must figured to reverse the last step of it. + if (input_mode.interpolation_mode == Tegra::Shader::IpaInterpMode::Multiply) { + value = Operation(OperationCode::FMul, PRECISE, value, GetRegister(instr.gpr20)); + } + } + value = GetSaturatedFloat(value, instr.ipa.saturate); SetRegister(bb, instr.gpr0, value); break; @@ -175,4 +186,4 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { return pc; } -} // namespace VideoCommon::Shader
\ No newline at end of file +} // namespace VideoCommon::Shader |