Basic control flow skeleton and jumps implemented.

A-train's trees draw right now!
Helps a bit with #473 but still need to implement loops.
This commit is contained in:
Ben Vanik
2015-12-06 11:44:22 -08:00
parent 934b0d5bbc
commit 280c0b35f6
5 changed files with 98 additions and 13 deletions

View File

@@ -74,6 +74,11 @@ class ShaderTranslator {
// Handles translation for control flow nop instructions.
virtual void ProcessControlFlowNopInstruction() {}
// Handles the start of a control flow instruction at the given address.
virtual void ProcessControlFlowInstructionBegin(uint32_t cf_index) {}
// Handles the end of a control flow instruction that began at the given
// address.
virtual void ProcessControlFlowInstructionEnd(uint32_t cf_index) {}
// Handles translation for control flow exec instructions prior to their
// contained ALU/fetch instructions.
virtual void ProcessExecInstructionBegin(const ParsedExecInstruction& instr) {
@@ -166,6 +171,9 @@ class ShaderTranslator {
// Accumulated translation errors.
std::vector<Shader::Error> errors_;
// Current control flow dword index.
uint32_t cf_index_ = 0;
// Microcode disassembly buffer, accumulated throughout the translation.
StringBuffer ucode_disasm_buffer_;
// Current line number in the disasm, which can be used for source annotation.