From e87a502da2d5a8356a639d53c0a16a77890de4c7 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Wed, 24 Feb 2021 05:21:30 -0300
Subject: shader: Fix control flow

---
 src/shader_recompiler/frontend/ir/value.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/shader_recompiler/frontend/ir/value.cpp')

diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index 718314213d..791ba26906 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -36,6 +36,10 @@ bool Value::IsIdentity() const noexcept {
     return type == Type::Opaque && inst->Opcode() == Opcode::Identity;
 }
 
+bool Value::IsPhi() const noexcept {
+    return type == Type::Opaque && inst->Opcode() == Opcode::Phi;
+}
+
 bool Value::IsEmpty() const noexcept {
     return type == Type::Void;
 }
@@ -52,7 +56,7 @@ bool Value::IsLabel() const noexcept {
 }
 
 IR::Type Value::Type() const noexcept {
-    if (IsIdentity()) {
+    if (IsIdentity() || IsPhi()) {
         return inst->Arg(0).Type();
     }
     if (type == Type::Opaque) {
-- 
cgit v1.2.3-70-g09d2