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

@@ -40,6 +40,8 @@ class GlslShaderTranslator : public ShaderTranslator {
void ProcessLabel(uint32_t cf_index) override;
void ProcessControlFlowNopInstruction() override;
void ProcessControlFlowInstructionBegin(uint32_t cf_index) override;
void ProcessControlFlowInstructionEnd(uint32_t cf_index) override;
void ProcessExecInstructionBegin(const ParsedExecInstruction& instr) override;
void ProcessExecInstructionEnd(const ParsedExecInstruction& instr) override;
void ProcessLoopStartInstruction(
@@ -70,6 +72,7 @@ class GlslShaderTranslator : public ShaderTranslator {
StringBuffer source_;
int depth_ = 0;
char depth_prefix_[16] = {0};
bool cf_wrote_pc_ = false;
void ProcessVectorAluInstruction(const ParsedAluInstruction& instr);
void ProcessScalarAluInstruction(const ParsedAluInstruction& instr);