diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-29 20:30:20 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-09 22:40:53 +0100 |
commit | b1061afed90db36c6b6d6cc19c6a4495bcef4fec (patch) | |
tree | 089d9cbd623f57b8708db56b233d7c74f7ea4aec /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | gl_shader_decompiler: Roll back to GLSL core 430 (diff) | |
download | yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar.gz yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar.bz2 yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar.lz yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar.xz yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.tar.zst yuzu-b1061afed90db36c6b6d6cc19c6a4495bcef4fec.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 0adb51629..cb89daba1 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -393,9 +393,9 @@ std::string FlowStackTopName(MetaStackClass stack) { class GLSLDecompiler final { public: explicit GLSLDecompiler(const Device& device, const ShaderIR& ir, const Registry& registry, - ShaderType stage, std::string_view suffix) - : device{device}, ir{ir}, registry{registry}, stage{stage}, suffix{suffix}, - header{ir.GetHeader()} {} + ShaderType stage, std::string_view identifier, std::string_view suffix) + : device{device}, ir{ir}, registry{registry}, stage{stage}, + identifier{identifier}, suffix{suffix}, header{ir.GetHeader()} {} void Decompile() { DeclareHeader(); @@ -478,6 +478,9 @@ private: void DecompileAST(); void DeclareHeader() { + if (!identifier.empty()) { + code.AddLine("// {}", identifier); + } code.AddLine("#version 430 core"); code.AddLine("#extension GL_ARB_separate_shader_objects : enable"); if (device.HasShaderBallot()) { @@ -2477,6 +2480,7 @@ private: const ShaderIR& ir; const Registry& registry; const ShaderType stage; + const std::string_view identifier; const std::string_view suffix; const Header header; @@ -2698,8 +2702,9 @@ ShaderEntries MakeEntries(const VideoCommon::Shader::ShaderIR& ir) { } std::string DecompileShader(const Device& device, const ShaderIR& ir, const Registry& registry, - ShaderType stage, std::string_view suffix) { - GLSLDecompiler decompiler(device, ir, registry, stage, suffix); + ShaderType stage, std::string_view identifier, + std::string_view suffix) { + GLSLDecompiler decompiler(device, ir, registry, stage, identifier, suffix); decompiler.Decompile(); return decompiler.GetResult(); } |