mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
shader: Add utility to resolve identities on a value
This commit is contained in:
parent
3a59fffaa1
commit
3633e43377
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue