summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-10 04:07:30 +0200
committerbunnei <bunneidev@gmail.com>2018-04-14 22:01:39 +0200
commit50023bdae790a607b3a6e6279465c2520279f70b (patch)
tree206660dd76c36ba9433489f862cec58ca31e970e /src/video_core/renderer_opengl/gl_shader_decompiler.cpp
parentrenderer_opengl: Fix Morton copy byteswap, etc. (diff)
downloadyuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar.gz
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar.bz2
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar.lz
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar.xz
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.tar.zst
yuzu-50023bdae790a607b3a6e6279465c2520279f70b.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 60857c623..704b24307 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -128,8 +128,9 @@ private:
class GLSLGenerator {
public:
GLSLGenerator(const std::set<Subroutine>& subroutines, const ProgramCode& program_code,
- u32 main_offset)
- : subroutines(subroutines), program_code(program_code), main_offset(main_offset) {
+ u32 main_offset, Maxwell3D::Regs::ShaderStage stage)
+ : subroutines(subroutines), program_code(program_code), main_offset(main_offset),
+ stage(stage) {
Generate();
}
@@ -429,6 +430,7 @@ private:
const std::set<Subroutine>& subroutines;
const ProgramCode& program_code;
const u32 main_offset;
+ Maxwell3D::Regs::ShaderStage stage;
ShaderWriter shader;
ShaderWriter declarations;
@@ -443,10 +445,11 @@ std::string GetCommonDeclarations() {
return "bool exec_shader();";
}
-boost::optional<std::string> DecompileProgram(const ProgramCode& program_code, u32 main_offset) {
+boost::optional<std::string> DecompileProgram(const ProgramCode& program_code, u32 main_offset,
+ Maxwell3D::Regs::ShaderStage stage) {
try {
auto subroutines = ControlFlowAnalyzer(program_code, main_offset).GetSubroutines();
- GLSLGenerator generator(subroutines, program_code, main_offset);
+ GLSLGenerator generator(subroutines, program_code, main_offset, stage);
return generator.GetShaderCode();
} catch (const DecompileFail& exception) {
LOG_ERROR(HW_GPU, "Shader decompilation failed: %s", exception.what());