From d8bef46c2afd444e72a4cb1af43de3f38575c754 Mon Sep 17 00:00:00 2001 From: DHrpcs3 Date: Mon, 21 Dec 2015 05:35:56 +0200 Subject: [PATCH] Do not use global static variables in headers --- rpcs3/Emu/RSX/CgBinaryProgram.h | 12 +++- .../RSX/Common/FragmentProgramDecompiler.h | 5 ++ .../Emu/RSX/Common/VertexProgramDecompiler.h | 6 ++ rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp | 2 +- rpcs3/Emu/RSX/GL/GLCommonDecompiler.h | 2 +- rpcs3/Emu/RSX/GL/rsx_gl_texture.cpp | 2 +- rpcs3/Emu/RSX/GL/rsx_gl_texture.h | 2 +- rpcs3/Emu/RSX/RSXFragmentProgram.h | 16 ++--- rpcs3/Emu/RSX/RSXVertexProgram.h | 20 +++--- rpcs3/GLGSRender.vcxproj.filters | 61 +++++-------------- 10 files changed, 58 insertions(+), 70 deletions(-) diff --git a/rpcs3/Emu/RSX/CgBinaryProgram.h b/rpcs3/Emu/RSX/CgBinaryProgram.h index 5d357e47dd..4029c5d273 100644 --- a/rpcs3/Emu/RSX/CgBinaryProgram.h +++ b/rpcs3/Emu/RSX/CgBinaryProgram.h @@ -110,7 +110,17 @@ struct CgBinaryProgram class CgBinaryDisasm { -private: + OPDEST dst; + SRC0 src0; + SRC1 src1; + SRC2 src2; + + D0 d0; + D1 d1; + D2 d2; + D3 d3; + SRC src[3]; + std::string m_path; // used for FP decompiler thread, delete this later u8* m_buffer; diff --git a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.h b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.h index 6294db0e5f..edaec9ae2d 100644 --- a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.h +++ b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.h @@ -19,6 +19,11 @@ */ class FragmentProgramDecompiler { + OPDEST dst; + SRC0 src0; + SRC1 src1; + SRC2 src2; + std::string main; u32 m_addr; u32& m_size; diff --git a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h index 24daff2979..ab4aac0d01 100644 --- a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h +++ b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h @@ -19,6 +19,12 @@ */ struct VertexProgramDecompiler { + D0 d0; + D1 d1; + D2 d2; + D3 d3; + SRC src[3]; + struct FuncInfo { u32 offset; diff --git a/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp index afa7be3b7c..24a6167c0f 100644 --- a/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp +++ b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp @@ -72,4 +72,4 @@ std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::st case COMPARE::FUNCTION_SNE: return "notEqual(" + Op0 + ", " + Op1 + ")"; } -} \ No newline at end of file +} diff --git a/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h index 6ae1d5065a..cee0d9b11c 100644 --- a/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h +++ b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h @@ -3,4 +3,4 @@ std::string getFloatTypeNameImpl(size_t elementCount); std::string getFunctionImpl(FUNCTION f); -std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1); \ No newline at end of file +std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1); diff --git a/rpcs3/Emu/RSX/GL/rsx_gl_texture.cpp b/rpcs3/Emu/RSX/GL/rsx_gl_texture.cpp index b50d7a1d33..217e24d99e 100644 --- a/rpcs3/Emu/RSX/GL/rsx_gl_texture.cpp +++ b/rpcs3/Emu/RSX/GL/rsx_gl_texture.cpp @@ -466,4 +466,4 @@ namespace rsx return m_id; } } -} \ No newline at end of file +} diff --git a/rpcs3/Emu/RSX/GL/rsx_gl_texture.h b/rpcs3/Emu/RSX/GL/rsx_gl_texture.h index df6fe0c3ce..ace0b86c2e 100644 --- a/rpcs3/Emu/RSX/GL/rsx_gl_texture.h +++ b/rpcs3/Emu/RSX/GL/rsx_gl_texture.h @@ -42,4 +42,4 @@ namespace rsx u32 id() const; }; } -} \ No newline at end of file +} diff --git a/rpcs3/Emu/RSX/RSXFragmentProgram.h b/rpcs3/Emu/RSX/RSXFragmentProgram.h index 1bde687d92..6ef842d959 100644 --- a/rpcs3/Emu/RSX/RSXFragmentProgram.h +++ b/rpcs3/Emu/RSX/RSXFragmentProgram.h @@ -71,7 +71,7 @@ enum RSX_FP_OPCODE_RET = 0x45 // Return }; -static union OPDEST +union OPDEST { u32 HEX; @@ -93,9 +93,9 @@ static union OPDEST u32 no_dest : 1; u32 saturate : 1; // _sat }; -} dst; +}; -static union SRC0 +union SRC0 { u32 HEX; @@ -120,9 +120,9 @@ static union SRC0 u32 cond_mod_reg_index : 1; u32 cond_reg_index : 1; }; -} src0; +}; -static union SRC1 +union SRC1 { u32 HEX; @@ -158,9 +158,9 @@ static union SRC1 u32 : 1; u32 increment : 8; // Increment value for LOOP }; -} src1; +}; -static union SRC2 +union SRC2 { u32 HEX; @@ -181,7 +181,7 @@ static union SRC2 u32 use_index_reg : 1; u32 perspective_corr : 1; }; -} src2; +}; static const char* rsx_fp_input_attr_regs[] = { diff --git a/rpcs3/Emu/RSX/RSXVertexProgram.h b/rpcs3/Emu/RSX/RSXVertexProgram.h index f05a05749f..f16d811011 100644 --- a/rpcs3/Emu/RSX/RSXVertexProgram.h +++ b/rpcs3/Emu/RSX/RSXVertexProgram.h @@ -53,7 +53,7 @@ enum vec_opcode RSX_VEC_OPCODE_TXL = 0x19 }; -static union D0 +union D0 { u32 HEX; @@ -80,9 +80,9 @@ static union D0 u32 vec_result : 1; u32 : 1; }; -} d0; +}; -static union D1 +union D1 { u32 HEX; @@ -94,9 +94,9 @@ static union D1 u32 vec_opcode : 5; u32 sca_opcode : 5; }; -} d1; +}; -static union D2 +union D2 { u32 HEX; @@ -111,9 +111,9 @@ static union D2 u32 iaddrh : 6; u32 : 26; }; -} d2; +}; -static union D3 +union D3 { u32 HEX; @@ -138,9 +138,9 @@ static union D3 u32 : 29; u32 iaddrl : 3; }; -} d3; +}; -static union SRC +union SRC { union { @@ -174,7 +174,7 @@ static union SRC u32 swz_x : 2; u32 neg : 1; }; -} src[3]; +}; static const std::string rsx_vp_sca_op_names[] = { diff --git a/rpcs3/GLGSRender.vcxproj.filters b/rpcs3/GLGSRender.vcxproj.filters index b955e42804..6d782a3eae 100644 --- a/rpcs3/GLGSRender.vcxproj.filters +++ b/rpcs3/GLGSRender.vcxproj.filters @@ -1,56 +1,23 @@  - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - + + + + + + - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - {f2f80d8a-5c1d-461d-963f-5de8c8fdf860} - + + + + + + + + \ No newline at end of file