summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm.cpp3
-rw-r--r--src/shader_recompiler/backend/glasm/reg_alloc.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
index 4aa3682c2..0e9dc06a6 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
@@ -271,6 +271,9 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) {
271 break; 271 break;
272 } 272 }
273 } 273 }
274 if (!ctx.reg_alloc.IsEmpty()) {
275 throw LogicError("Register allocator is not empty");
276 }
274} 277}
275 278
276void SetupOptions(const IR::Program& program, const Profile& profile, 279void SetupOptions(const IR::Program& program, const Profile& profile,
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.h b/src/shader_recompiler/backend/glasm/reg_alloc.h
index b97c84146..019e1bc0f 100644
--- a/src/shader_recompiler/backend/glasm/reg_alloc.h
+++ b/src/shader_recompiler/backend/glasm/reg_alloc.h
@@ -128,6 +128,10 @@ public:
128 return num_used_long_registers; 128 return num_used_long_registers;
129 } 129 }
130 130
131 [[nodiscard]] bool IsEmpty() const noexcept {
132 return register_use.none() && long_register_use.none();
133 }
134
131 /// Returns true if the instruction is expected to be aliased to another 135 /// Returns true if the instruction is expected to be aliased to another
132 static bool IsAliased(const IR::Inst& inst); 136 static bool IsAliased(const IR::Inst& inst);
133 137