summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
index a8e53cf66..35dbe19ec 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
@@ -113,7 +113,7 @@ void PrecolorInst(IR::Inst& phi) {
if (arg.IsImmediate()) {
ir.PhiMove(phi, arg);
} else {
- ir.PhiMove(phi, IR::Value{&RegAlloc::AliasInst(*arg.Inst())});
+ ir.PhiMove(phi, IR::Value{&*arg.InstRecursive()});
}
}
for (size_t i = 0; i < num_args; ++i) {
@@ -157,7 +157,7 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) {
break;
case IR::AbstractSyntaxNode::Type::Return:
case IR::AbstractSyntaxNode::Type::Unreachable:
- ctx.Add("return;\n}}");
+ ctx.Add("return;");
break;
case IR::AbstractSyntaxNode::Type::Loop:
case IR::AbstractSyntaxNode::Type::Repeat:
@@ -175,6 +175,8 @@ std::string EmitGLSL(const Profile& profile, const RuntimeInfo&, IR::Program& pr
EmitContext ctx{program, bindings, profile};
Precolor(program);
EmitCode(ctx, program);
+ ctx.code += "}";
+ fmt::print("\n{}\n", ctx.code);
return ctx.code;
}