diff options
author | Lioncash <mathew1800@gmail.com> | 2019-07-16 17:59:57 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-07-19 03:03:31 +0200 |
commit | c1c89411da173cf76de2a2ec19fd26247648cc3c (patch) | |
tree | 8a21edc62e7b92ee9723db6f4e38f09bafc2d031 /src | |
parent | video_core/control_flow: Prevent sign conversion in TryGetBlock() (diff) | |
download | yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.gz yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.bz2 yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.lz yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.xz yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.zst yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/shader/control_flow.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/video_core/shader/control_flow.h b/src/video_core/shader/control_flow.h index 728286d70..b0a5e4f8c 100644 --- a/src/video_core/shader/control_flow.h +++ b/src/video_core/shader/control_flow.h @@ -25,27 +25,44 @@ struct Condition { bool IsUnconditional() const { return predicate == Pred::UnusedIndex && cc == ConditionCode::T; } + bool operator==(const Condition& other) const { return std::tie(predicate, cc) == std::tie(other.predicate, other.cc); } + + bool operator!=(const Condition& other) const { + return !operator==(other); + } }; struct ShaderBlock { - u32 start{}; - u32 end{}; - bool ignore_branch{}; struct Branch { Condition cond{}; bool kills{}; s32 address{}; + bool operator==(const Branch& b) const { return std::tie(cond, kills, address) == std::tie(b.cond, b.kills, b.address); } - } branch{}; + + bool operator!=(const Branch& b) const { + return !operator==(b); + } + }; + + u32 start{}; + u32 end{}; + bool ignore_branch{}; + Branch branch{}; + bool operator==(const ShaderBlock& sb) const { return std::tie(start, end, ignore_branch, branch) == std::tie(sb.start, sb.end, sb.ignore_branch, sb.branch); } + + bool operator!=(const ShaderBlock& sb) const { + return !operator==(sb); + } }; struct ShaderCharacteristics { |