From aa2aa708751e2ad29b02a3526577b6b104dd848f Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 8 Jan 2017 12:03:33 +0300 Subject: [PATCH] [rsx/wip] Dump raw shader, fix typo --- rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp | 4 +++- rpcs3/Emu/RSX/GL/GLVertexProgram.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp index 9e431910c8..6fd89e32dc 100644 --- a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp @@ -670,8 +670,9 @@ std::string VertexProgramDecompiler::Decompile() case RSX_SCA_OPCODE_COS: SetDSTSca("cos($s)"); break; case RSX_SCA_OPCODE_BRB: // works differently (BRB o[1].x !b0, L0;) + { LOG_ERROR(RSX, "Unimplemented sca_opcode BRB d0=0x%X, d1=0x%X, d2=0x%X, d3=0x%X", d0.HEX, d1.HEX, d2.HEX, d3.HEX); - + u32 jump_position = find_jump_lvl(GetAddr()); AddCode("$if (!$bconst) //BRB"); //If only the cond flags are set, we can just use $ifcond @@ -683,6 +684,7 @@ std::string VertexProgramDecompiler::Decompile() AddCode("}"); break; + } case RSX_SCA_OPCODE_CLB: break; // works same as BRB LOG_ERROR(RSX, "Unimplemented sca_opcode CLB"); diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index d33ec0c7df..10462f9d12 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -382,6 +382,9 @@ GLVertexProgram::~GLVertexProgram() void GLVertexProgram::Decompile(const RSXVertexProgram& prog) { + fs::create_path(fs::get_config_dir() + "/shaderlog"); + fs::file(fs::get_config_dir() + "shaderlog/VertexProgram.raw", fs::rewrite).write(prog.data.data(), prog.data.size() * sizeof(u32)); + GLVertexDecompilerThread decompiler(prog, shader, parr); decompiler.Task(); }