diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2018-09-09 03:54:11 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2018-09-17 23:42:43 +0200 |
commit | aac77bbd18f2b943b7259d8099241c4ec697b8f4 (patch) | |
tree | bfe66b24714d358f9486c5f6115ff1d25bfe8dfc /src/video_core/renderer_opengl | |
parent | Merge pull request #1311 from FernandoS27/fast-swizzle (diff) | |
download | yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar.gz yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar.bz2 yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar.lz yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar.xz yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.tar.zst yuzu-aac77bbd18f2b943b7259d8099241c4ec697b8f4.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 15 |
1 files changed, 15 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 252ff18fc..34f9e57d4 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -351,6 +351,15 @@ public: shader.AddLine(dest + " = " + src + ';'); } + std::string GetControlCode(const Tegra::Shader::ControlCode cc) { + u32 code = static_cast<u32>(cc); + return "controlCode_" + std::to_string(code); + } + + void SetControlCode(const Tegra::Shader::ControlCode cc, const std::string& value) { + shader.AddLine(GetControlCode(cc) + " = " + value + ';'); + } + /** * Writes code that does a output attribute assignment to register operation. Output attributes * are stored as floats, so this may require conversion. @@ -414,6 +423,12 @@ public: } declarations.AddNewLine(); + for (u32 cc = 0; cc < 32; cc++) { + Tegra::Shader::ControlCode code = static_cast<Tegra::Shader::ControlCode>(cc); + declarations.AddLine("bool " + GetControlCode(code) + " = false;"); + } + declarations.AddNewLine(); + for (const auto element : declr_input_attribute) { // TODO(bunnei): Use proper number of elements for these u32 idx = |