diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-26 06:31:05 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-26 06:31:05 +0200 |
commit | f6f0383b49e70eb9cc534fc5b283371f29189108 (patch) | |
tree | 4a0f19e08e0c19f6ed6ef48430c6949ebd9f06ce | |
parent | Merge pull request #6697 from ameerj/fps-cap (diff) | |
download | yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar.gz yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar.bz2 yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar.lz yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar.xz yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.tar.zst yuzu-f6f0383b49e70eb9cc534fc5b283371f29189108.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/frontend/ir/value.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h index 0c6bf684d..dbea20115 100644 --- a/src/shader_recompiler/frontend/ir/value.h +++ b/src/shader_recompiler/frontend/ir/value.h @@ -57,6 +57,7 @@ public: [[nodiscard]] IR::Inst* Inst() const; [[nodiscard]] IR::Inst* InstRecursive() const; + [[nodiscard]] IR::Inst* TryInstRecursive() const; [[nodiscard]] IR::Value Resolve() const; [[nodiscard]] IR::Reg Reg() const; [[nodiscard]] IR::Pred Pred() const; @@ -308,6 +309,13 @@ inline IR::Inst* Value::InstRecursive() const { return inst; } +inline IR::Inst* Value::TryInstRecursive() const { + if (IsIdentity()) { + return inst->Arg(0).TryInstRecursive(); + } + return type == Type::Opaque ? inst : nullptr; +} + inline IR::Value Value::Resolve() const { if (IsIdentity()) { return inst->Arg(0).Resolve(); |