Do not use global static variables in headers

This commit is contained in:
DHrpcs3 2015-12-21 05:35:56 +02:00
parent ae83ab5436
commit d8bef46c2a
10 changed files with 58 additions and 70 deletions

View File

@ -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;

View File

@ -19,6 +19,11 @@
*/
class FragmentProgramDecompiler
{
OPDEST dst;
SRC0 src0;
SRC1 src1;
SRC2 src2;
std::string main;
u32 m_addr;
u32& m_size;

View File

@ -19,6 +19,12 @@
*/
struct VertexProgramDecompiler
{
D0 d0;
D1 d1;
D2 d2;
D3 d3;
SRC src[3];
struct FuncInfo
{
u32 offset;

View File

@ -72,4 +72,4 @@ std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::st
case COMPARE::FUNCTION_SNE:
return "notEqual(" + Op0 + ", " + Op1 + ")";
}
}
}

View File

@ -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);
std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1);

View File

@ -466,4 +466,4 @@ namespace rsx
return m_id;
}
}
}
}

View File

@ -42,4 +42,4 @@ namespace rsx
u32 id() const;
};
}
}
}

View File

@ -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[] =
{

View File

@ -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[] =
{

View File

@ -1,56 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="Emu\RSX\GL\gl_helpers.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\GLCommonDecompiler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\GLFragmentProgram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\GLGSRender.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\GLVertexProgram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\OpenGL.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\GL\rsx_gl_texture.cpp" />
<ClCompile Include="Emu\RSX\GL\gl_helpers.cpp" />
<ClCompile Include="Emu\RSX\GL\GLCommonDecompiler.cpp" />
<ClCompile Include="Emu\RSX\GL\GLFragmentProgram.cpp" />
<ClCompile Include="Emu\RSX\GL\GLGSRender.cpp" />
<ClCompile Include="Emu\RSX\GL\GLVertexProgram.cpp" />
<ClCompile Include="Emu\RSX\GL\OpenGL.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Emu\RSX\GL\gl_helpers.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLCommonDecompiler.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLFragmentProgram.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLGSRender.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLProcTable.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLProgramBuffer.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\GLVertexProgram.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\OpenGL.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\GL\rsx_gl_texture.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{f2f80d8a-5c1d-461d-963f-5de8c8fdf860}</UniqueIdentifier>
</Filter>
<ClInclude Include="Emu\RSX\GL\gl_helpers.h" />
<ClInclude Include="Emu\RSX\GL\GLCommonDecompiler.h" />
<ClInclude Include="Emu\RSX\GL\GLFragmentProgram.h" />
<ClInclude Include="Emu\RSX\GL\GLGSRender.h" />
<ClInclude Include="Emu\RSX\GL\GLProcTable.h" />
<ClInclude Include="Emu\RSX\GL\GLProgramBuffer.h" />
<ClInclude Include="Emu\RSX\GL\GLVertexProgram.h" />
<ClInclude Include="Emu\RSX\GL\OpenGL.h" />
</ItemGroup>
</Project>