glsl: Fix non-immediate buffer access

and many other misc implementations
This commit is contained in:
ameerj
2021-05-27 00:26:16 -04:00
parent d171083d53
commit ed14d31f66
12 changed files with 133 additions and 72 deletions

View File

@ -50,15 +50,7 @@ void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value&
if (phi_reg == val_reg) {
return;
}
if (phi_type == value.Type()) {
ctx.Add("{}={}; // PHI MOVE", phi_reg, val_reg);
} else if (phi_type == IR::Type::U32 && value.Type() == IR::Type::F32) {
ctx.Add("{}=floatBitsToUint({}); // CAST PHI MOVE", phi_reg, val_reg);
} else {
throw NotImplementedException("{} to {} move", phi_type, value.Type());
const auto cast{ctx.reg_alloc.GetGlslType(phi_type)};
ctx.Add("{}={}({}); // CAST PHI MOVE", phi_reg, cast, val_reg);
}
ctx.Add("{}={};", phi_reg, val_reg);
}
void EmitBranch(EmitContext& ctx, std::string_view label) {
@ -245,7 +237,7 @@ void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_
}
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) {
NotImplemented();
ctx.AddU1("{}=false;", inst);
}
void EmitUndefU8(EmitContext& ctx, IR::Inst& inst) {