diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-29 06:37:29 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-08-29 06:37:29 +0200 |
commit | b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b (patch) | |
tree | 12fe797d8597eab090085a46d34eb51acb9f1bc1 /src/video_core/renderer_opengl | |
parent | Merge pull request #1193 from lioncash/priv (diff) | |
download | yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar.gz yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar.bz2 yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar.lz yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar.xz yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.tar.zst yuzu-b1ccd8843467e43838e19c50dcfcbc2ff0b3bc0b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 94e318966..c9fe37f74 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -2039,7 +2039,39 @@ private: } case OpCode::Id::IPA: { const auto& attribute = instr.attribute.fmt28; - regs.SetRegisterToInputAttibute(instr.gpr0, attribute.element, attribute.index); + const auto& reg = instr.gpr0; + switch (instr.ipa.mode) { + case Tegra::Shader::IpaMode::Pass: + if (stage == Maxwell3D::Regs::ShaderStage::Fragment && + attribute.index == Attribute::Index::Position) { + switch (attribute.element) { + case 0: + shader.AddLine(regs.GetRegisterAsFloat(reg) + " = gl_FragCoord.x;"); + break; + case 1: + shader.AddLine(regs.GetRegisterAsFloat(reg) + " = gl_FragCoord.y;"); + break; + case 2: + shader.AddLine(regs.GetRegisterAsFloat(reg) + " = gl_FragCoord.z;"); + break; + case 3: + shader.AddLine(regs.GetRegisterAsFloat(reg) + " = 1.0;"); + break; + } + } else { + regs.SetRegisterToInputAttibute(reg, attribute.element, attribute.index); + } + break; + case Tegra::Shader::IpaMode::None: + regs.SetRegisterToInputAttibute(reg, attribute.element, attribute.index); + break; + default: + LOG_CRITICAL(HW_GPU, "Unhandled IPA mode: {}", + static_cast<u32>(instr.ipa.mode.Value())); + UNREACHABLE(); + regs.SetRegisterToInputAttibute(reg, attribute.element, attribute.index); + } + break; } case OpCode::Id::SSY: { |