Shader_Ir: Refactor Decompilation process and allow multiple decompilation modes.

This commit is contained in:
Fernando Sahmkow
2019-08-16 16:25:02 -04:00
committed by FernandoS27
parent 38fc995f6c
commit 47e4f6a52c
15 changed files with 338 additions and 82 deletions

View File

@ -16,6 +16,7 @@
#include "video_core/engines/shader_bytecode.h"
#include "video_core/engines/shader_header.h"
#include "video_core/shader/ast.h"
#include "video_core/shader/compiler_settings.h"
#include "video_core/shader/node.h"
namespace VideoCommon::Shader {
@ -65,7 +66,8 @@ struct GlobalMemoryUsage {
class ShaderIR final {
public:
explicit ShaderIR(const ProgramCode& program_code, u32 main_offset, std::size_t size);
explicit ShaderIR(const ProgramCode& program_code, u32 main_offset, std::size_t size,
CompilerSettings settings);
~ShaderIR();
const std::map<u32, NodeBlock>& GetBasicBlocks() const {
@ -141,6 +143,10 @@ public:
return header;
}
bool IsFlowStackDisabled() const {
return disable_flow_stack;
}
bool IsDecompiled() const {
return decompiled;
}
@ -368,6 +374,7 @@ private:
const u32 main_offset;
const std::size_t program_size;
bool decompiled{};
bool disable_flow_stack{};
u32 coverage_begin{};
u32 coverage_end{};
@ -375,6 +382,7 @@ private:
std::map<u32, NodeBlock> basic_blocks;
NodeBlock global_code;
ASTManager program_manager;
CompilerSettings settings{};
std::set<u32> used_registers;
std::set<Tegra::Shader::Pred> used_predicates;