diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-16 02:26:45 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-04-17 22:36:40 +0200 |
commit | 8d4899d6ead9413a6bf8f237508a1941dc12493d (patch) | |
tree | 9ce09038da050a59a0c6625d365f2103755b106a /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | gl_shader_decompiler: Implement IPA instruction. (diff) | |
download | yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar.gz yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar.bz2 yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar.lz yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar.xz yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.tar.zst yuzu-8d4899d6ead9413a6bf8f237508a1941dc12493d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 045ccdb0f..1d8057927 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -156,23 +156,27 @@ private: /// Generates code representing an input attribute register. std::string GetInputAttribute(Attribute::Index attribute) { - declr_input_attribute.insert(attribute); + switch (attribute) { + case Attribute::Index::Position: + return "position"; + default: + const u32 index{static_cast<u32>(attribute) - + static_cast<u32>(Attribute::Index::Attribute_0)}; + if (attribute >= Attribute::Index::Attribute_0) { + declr_input_attribute.insert(attribute); + return "input_attribute_" + std::to_string(index); + } - const u32 index{static_cast<u32>(attribute) - - static_cast<u32>(Attribute::Index::Attribute_0)}; - if (attribute >= Attribute::Index::Attribute_0) { - return "input_attribute_" + std::to_string(index); + LOG_CRITICAL(HW_GPU, "Unhandled input attribute: 0x%02x", index); + UNREACHABLE(); } - - LOG_CRITICAL(HW_GPU, "Unhandled input attribute: 0x%02x", index); - UNREACHABLE(); } /// Generates code representing an output attribute register. std::string GetOutputAttribute(Attribute::Index attribute) { switch (attribute) { case Attribute::Index::Position: - return "gl_Position"; + return "position"; default: const u32 index{static_cast<u32>(attribute) - static_cast<u32>(Attribute::Index::Attribute_0)}; @@ -381,12 +385,6 @@ private: } case OpCode::Id::IPA: { const auto& attribute = instr.attribute.fmt28; - - if (attribute.index == Attribute::Index::Position) { - LOG_CRITICAL(HW_GPU, "Unimplemented"); - break; - } - std::string dest = GetRegister(instr.gpr0); SetDest(attribute.element, dest, GetInputAttribute(attribute.index), 1, 4); break; |