mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-16 04:09:07 +00:00
rsx/asm: Stub out register annotation and dependency passes
This commit is contained in:
parent
aff645272f
commit
e20bae3cd7
@ -517,6 +517,8 @@ target_sources(rpcs3_emu PRIVATE
|
|||||||
RSX/Overlays/Shaders/shader_loading_dialog.cpp
|
RSX/Overlays/Shaders/shader_loading_dialog.cpp
|
||||||
RSX/Overlays/Shaders/shader_loading_dialog_native.cpp
|
RSX/Overlays/Shaders/shader_loading_dialog_native.cpp
|
||||||
RSX/Program/Assembler/FPToCFG.cpp
|
RSX/Program/Assembler/FPToCFG.cpp
|
||||||
|
RSX/Program/Assembler/Passes/RegisterAnnotationPass.cpp
|
||||||
|
RSX/Program/Assembler/Passes/RegisterDependencyPass.cpp
|
||||||
RSX/Program/CgBinaryProgram.cpp
|
RSX/Program/CgBinaryProgram.cpp
|
||||||
RSX/Program/CgBinaryFragmentProgram.cpp
|
RSX/Program/CgBinaryFragmentProgram.cpp
|
||||||
RSX/Program/CgBinaryVertexProgram.cpp
|
RSX/Program/CgBinaryVertexProgram.cpp
|
||||||
|
|||||||
@ -34,6 +34,11 @@ namespace rsx::assembler
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CFGPass
|
||||||
|
{
|
||||||
|
virtual void run(FlowGraph& graph) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
FlowGraph deconstruct_fragment_program(const RSXFragmentProgram& prog);
|
FlowGraph deconstruct_fragment_program(const RSXFragmentProgram& prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "RegisterAnnotationPass.h"
|
||||||
|
|
||||||
|
namespace rsx::assembler
|
||||||
|
{
|
||||||
|
void RegisterAnnotationPass::run(FlowGraph& graph)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../CFG.h"
|
||||||
|
|
||||||
|
namespace rsx::assembler
|
||||||
|
{
|
||||||
|
// The annotation pass annotates each basic block with 2 pieces of information:
|
||||||
|
// 1. The "input" register list for a block.
|
||||||
|
// 2. The "output" register list for a block (clobber list).
|
||||||
|
// The information can be used by other passes to set up prologue/epilogue on each block.
|
||||||
|
class RegisterAnnotationPass : public CFGPass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void run(FlowGraph& graph) override;
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "RegisterDependencyPass.h"
|
||||||
|
|
||||||
|
namespace rsx::assembler
|
||||||
|
{
|
||||||
|
void RegisterDependencyPass::run(FlowGraph& graph)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../CFG.h"
|
||||||
|
|
||||||
|
namespace rsx::assembler
|
||||||
|
{
|
||||||
|
// The register dependency pass identifies data hazards for each basic block and injects barrier instructions.
|
||||||
|
// Real PS3 does not have explicit barriers, but does instead often use delay slots or fence instructions to stall until a specific hardware unit clears the fence to advance.
|
||||||
|
// For decompiled shaders, we have the problem that aliasing is not real and is instead simulated. We do not have access to unions on the GPU without really nasty tricks.
|
||||||
|
class RegisterDependencyPass : public CFGPass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void run(FlowGraph& graph) override;
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -157,6 +157,8 @@
|
|||||||
<ClCompile Include="Emu\RSX\Overlays\Shaders\shader_loading_dialog_native.cpp" />
|
<ClCompile Include="Emu\RSX\Overlays\Shaders\shader_loading_dialog_native.cpp" />
|
||||||
<ClCompile Include="Emu\RSX\Overlays\Trophies\overlay_trophy_list_dialog.cpp" />
|
<ClCompile Include="Emu\RSX\Overlays\Trophies\overlay_trophy_list_dialog.cpp" />
|
||||||
<ClCompile Include="Emu\RSX\Program\Assembler\FPToCFG.cpp" />
|
<ClCompile Include="Emu\RSX\Program\Assembler\FPToCFG.cpp" />
|
||||||
|
<ClCompile Include="Emu\RSX\Program\Assembler\Passes\RegisterAnnotationPass.cpp" />
|
||||||
|
<ClCompile Include="Emu\RSX\Program\Assembler\Passes\RegisterDependencyPass.cpp" />
|
||||||
<ClCompile Include="Emu\RSX\Program\FragmentProgramRegister.cpp" />
|
<ClCompile Include="Emu\RSX\Program\FragmentProgramRegister.cpp" />
|
||||||
<ClCompile Include="Emu\RSX\Program\ProgramStateCache.cpp" />
|
<ClCompile Include="Emu\RSX\Program\ProgramStateCache.cpp" />
|
||||||
<ClCompile Include="Emu\RSX\Program\program_util.cpp" />
|
<ClCompile Include="Emu\RSX\Program\program_util.cpp" />
|
||||||
@ -702,6 +704,8 @@
|
|||||||
<ClInclude Include="Emu\RSX\Overlays\Trophies\overlay_trophy_list_dialog.h" />
|
<ClInclude Include="Emu\RSX\Overlays\Trophies\overlay_trophy_list_dialog.h" />
|
||||||
<ClInclude Include="Emu\RSX\Program\Assembler\CFG.h" />
|
<ClInclude Include="Emu\RSX\Program\Assembler\CFG.h" />
|
||||||
<ClInclude Include="Emu\RSX\Program\Assembler\IR.h" />
|
<ClInclude Include="Emu\RSX\Program\Assembler\IR.h" />
|
||||||
|
<ClInclude Include="Emu\RSX\Program\Assembler\Passes\RegisterAnnotationPass.h" />
|
||||||
|
<ClInclude Include="Emu\RSX\Program\Assembler\Passes\RegisterDependencyPass.h" />
|
||||||
<ClInclude Include="Emu\RSX\Program\FragmentProgramRegister.h" />
|
<ClInclude Include="Emu\RSX\Program\FragmentProgramRegister.h" />
|
||||||
<ClInclude Include="Emu\RSX\Program\GLSLTypes.h" />
|
<ClInclude Include="Emu\RSX\Program\GLSLTypes.h" />
|
||||||
<ClInclude Include="Emu\RSX\Program\ProgramStateCache.h" />
|
<ClInclude Include="Emu\RSX\Program\ProgramStateCache.h" />
|
||||||
|
|||||||
@ -136,6 +136,9 @@
|
|||||||
<Filter Include="Emu\GPU\RSX\Program\Assembler">
|
<Filter Include="Emu\GPU\RSX\Program\Assembler">
|
||||||
<UniqueIdentifier>{d99df916-8a99-428b-869a-9f14ac0ab411}</UniqueIdentifier>
|
<UniqueIdentifier>{d99df916-8a99-428b-869a-9f14ac0ab411}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Emu\GPU\RSX\Program\Assembler\Passes">
|
||||||
|
<UniqueIdentifier>{d13db076-47e4-45b9-bb8a-6b711ea40622}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Crypto\aes.cpp">
|
<ClCompile Include="Crypto\aes.cpp">
|
||||||
@ -1378,6 +1381,12 @@
|
|||||||
<ClCompile Include="Emu\RSX\Program\Assembler\FPToCFG.cpp">
|
<ClCompile Include="Emu\RSX\Program\Assembler\FPToCFG.cpp">
|
||||||
<Filter>Emu\GPU\RSX\Program\Assembler</Filter>
|
<Filter>Emu\GPU\RSX\Program\Assembler</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\RSX\Program\Assembler\Passes\RegisterAnnotationPass.cpp">
|
||||||
|
<Filter>Emu\GPU\RSX\Program\Assembler\Passes</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\RSX\Program\Assembler\Passes\RegisterDependencyPass.cpp">
|
||||||
|
<Filter>Emu\GPU\RSX\Program\Assembler\Passes</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Crypto\aes.h">
|
<ClInclude Include="Crypto\aes.h">
|
||||||
@ -2776,6 +2785,12 @@
|
|||||||
<ClInclude Include="Emu\RSX\Program\Assembler\IR.h">
|
<ClInclude Include="Emu\RSX\Program\Assembler\IR.h">
|
||||||
<Filter>Emu\GPU\RSX\Program\Assembler</Filter>
|
<Filter>Emu\GPU\RSX\Program\Assembler</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Emu\RSX\Program\Assembler\Passes\RegisterAnnotationPass.h">
|
||||||
|
<Filter>Emu\GPU\RSX\Program\Assembler\Passes</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Emu\RSX\Program\Assembler\Passes\RegisterDependencyPass.h">
|
||||||
|
<Filter>Emu\GPU\RSX\Program\Assembler\Passes</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Emu\RSX\Program\GLSLSnippets\GPUDeswizzle.glsl">
|
<None Include="Emu\RSX\Program\GLSLSnippets\GPUDeswizzle.glsl">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user