glasm: Rework control flow introducing a syntax list

This commit regresses VertexA shaders, their transformation pass has to
be adapted to the new control flow.
This commit is contained in:
ReinUsesLisp 2021-05-14 00:40:54 -03:00 committed by ameerj
parent 7ff5851608
commit d54d7de40e
33 changed files with 437 additions and 505 deletions

View file

@ -23,13 +23,12 @@ static void Invoke(TranslatorVisitor& visitor, Location pc, u64 insn) {
}
}
void Translate(Environment& env, IR::Block* block) {
if (block->IsVirtual()) {
void Translate(Environment& env, IR::Block* block, u32 location_begin, u32 location_end) {
if (location_begin == location_end) {
return;
}
TranslatorVisitor visitor{env, *block};
const Location pc_end{block->LocationEnd()};
for (Location pc = block->LocationBegin(); pc != pc_end; ++pc) {
for (Location pc = location_begin; pc != location_end; ++pc) {
const u64 insn{env.ReadInstruction(pc.Offset())};
const Opcode opcode{Decode(insn)};
switch (opcode) {

View file

@ -9,6 +9,6 @@
namespace Shader::Maxwell {
void Translate(Environment& env, IR::Block* block);
void Translate(Environment& env, IR::Block* block, u32 location_begin, u32 location_end);
} // namespace Shader::Maxwell