diff options
author | Lioncash <mathew1800@gmail.com> | 2018-04-20 02:05:42 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-04-20 02:09:27 +0200 |
commit | 412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0 (patch) | |
tree | ea7f14c48f6c053016c5552d7b0bda57d8c13da7 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | glsl_shader_decompiler: Add char overload for ShaderWriter's AddLine() (diff) | |
download | yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar.gz yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar.bz2 yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar.lz yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar.xz yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.tar.zst yuzu-412b31ad72da05c9b0e20c5c8e45354b6ff3a6b0.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 9e60c911c..c55febbfa 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -114,13 +114,19 @@ public: if (!text.empty()) { AppendIndentation(); } - shader_source += text + '\n'; + shader_source += text; + AddNewLine(); } void AddLine(char character) { DEBUG_ASSERT(scope >= 0); AppendIndentation(); shader_source += character; + AddNewLine(); + } + + void AddNewLine() { + DEBUG_ASSERT(scope >= 0); shader_source += '\n'; } @@ -475,7 +481,7 @@ private: for (const auto& subroutine : subroutines) { shader.AddLine("bool " + subroutine.GetName() + "();"); } - shader.AddLine(""); + shader.AddNewLine(); // Add the main entry point shader.AddLine("bool exec_shader() {"); @@ -552,7 +558,7 @@ private: for (const auto& reg : declr_register) { declarations.AddLine("float " + reg + " = 0.0;"); } - declarations.AddLine(""); + declarations.AddNewLine(); for (const auto& index : declr_input_attribute) { // TODO(bunnei): Use proper number of elements for these @@ -561,7 +567,7 @@ private: static_cast<u32>(Attribute::Index::Attribute_0)) + ") in vec4 " + GetInputAttribute(index) + ";"); } - declarations.AddLine(""); + declarations.AddNewLine(); for (const auto& index : declr_output_attribute) { // TODO(bunnei): Use proper number of elements for these @@ -570,7 +576,7 @@ private: static_cast<u32>(Attribute::Index::Attribute_0)) + ") out vec4 " + GetOutputAttribute(index) + ";"); } - declarations.AddLine(""); + declarations.AddNewLine(); unsigned const_buffer_layout = 0; for (const auto& entry : GetConstBuffersDeclarations()) { @@ -578,7 +584,7 @@ private: declarations.AddLine('{'); declarations.AddLine(" float c" + std::to_string(entry.GetIndex()) + "[];"); declarations.AddLine("};"); - declarations.AddLine(""); + declarations.AddNewLine(); ++const_buffer_layout; } } |