summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-02-16 23:49:24 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:22 +0200
commit3633e433774927681b02e1de665a608730f5582c (patch)
tree47ec548d43d72ae4bfd85c8052cca6fca29498b4
parentspirv: Implement EmitIdentity (diff)
downloadyuzu-3633e433774927681b02e1de665a608730f5582c.tar
yuzu-3633e433774927681b02e1de665a608730f5582c.tar.gz
yuzu-3633e433774927681b02e1de665a608730f5582c.tar.bz2
yuzu-3633e433774927681b02e1de665a608730f5582c.tar.lz
yuzu-3633e433774927681b02e1de665a608730f5582c.tar.xz
yuzu-3633e433774927681b02e1de665a608730f5582c.tar.zst
yuzu-3633e433774927681b02e1de665a608730f5582c.zip
-rw-r--r--src/shader_recompiler/frontend/ir/value.cpp7
-rw-r--r--src/shader_recompiler/frontend/ir/value.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index 9ea61813b..718314213 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -79,6 +79,13 @@ IR::Inst* Value::InstRecursive() const {
return inst;
}
+IR::Value Value::Resolve() const {
+ if (IsIdentity()) {
+ return inst->Arg(0).Resolve();
+ }
+ return *this;
+}
+
IR::Reg Value::Reg() const {
ValidateAccess(Type::Reg);
return reg;
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 2f3688c73..8aba0bbf6 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -41,6 +41,7 @@ public:
[[nodiscard]] IR::Inst* Inst() const;
[[nodiscard]] IR::Block* Label() const;
[[nodiscard]] IR::Inst* InstRecursive() const;
+ [[nodiscard]] IR::Value Resolve() const;
[[nodiscard]] IR::Reg Reg() const;
[[nodiscard]] IR::Pred Pred() const;
[[nodiscard]] IR::Attribute Attribute() const;