diff options
| author | 2019-07-16 11:59:57 -0400 | |
|---|---|---|
| committer | 2019-07-18 21:03:31 -0400 | |
| commit | c1c89411da173cf76de2a2ec19fd26247648cc3c (patch) | |
| tree | 8a21edc62e7b92ee9723db6f4e38f09bafc2d031 | |
| parent | video_core/control_flow: Prevent sign conversion in TryGetBlock() (diff) | |
| download | yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.gz yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.tar.xz yuzu-c1c89411da173cf76de2a2ec19fd26247648cc3c.zip | |
video_core/control_flow: Provide operator!= for types with operator==
Provides operational symmetry for the respective structures.
| -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 { | |||
| 25 | bool IsUnconditional() const { | 25 | bool IsUnconditional() const { |
| 26 | return predicate == Pred::UnusedIndex && cc == ConditionCode::T; | 26 | return predicate == Pred::UnusedIndex && cc == ConditionCode::T; |
| 27 | } | 27 | } |
| 28 | |||
| 28 | bool operator==(const Condition& other) const { | 29 | bool operator==(const Condition& other) const { |
| 29 | return std::tie(predicate, cc) == std::tie(other.predicate, other.cc); | 30 | return std::tie(predicate, cc) == std::tie(other.predicate, other.cc); |
| 30 | } | 31 | } |
| 32 | |||
| 33 | bool operator!=(const Condition& other) const { | ||
| 34 | return !operator==(other); | ||
| 35 | } | ||
| 31 | }; | 36 | }; |
| 32 | 37 | ||
| 33 | struct ShaderBlock { | 38 | struct ShaderBlock { |
| 34 | u32 start{}; | ||
| 35 | u32 end{}; | ||
| 36 | bool ignore_branch{}; | ||
| 37 | struct Branch { | 39 | struct Branch { |
| 38 | Condition cond{}; | 40 | Condition cond{}; |
| 39 | bool kills{}; | 41 | bool kills{}; |
| 40 | s32 address{}; | 42 | s32 address{}; |
| 43 | |||
| 41 | bool operator==(const Branch& b) const { | 44 | bool operator==(const Branch& b) const { |
| 42 | return std::tie(cond, kills, address) == std::tie(b.cond, b.kills, b.address); | 45 | return std::tie(cond, kills, address) == std::tie(b.cond, b.kills, b.address); |
| 43 | } | 46 | } |
| 44 | } branch{}; | 47 | |
| 48 | bool operator!=(const Branch& b) const { | ||
| 49 | return !operator==(b); | ||
| 50 | } | ||
| 51 | }; | ||
| 52 | |||
| 53 | u32 start{}; | ||
| 54 | u32 end{}; | ||
| 55 | bool ignore_branch{}; | ||
| 56 | Branch branch{}; | ||
| 57 | |||
| 45 | bool operator==(const ShaderBlock& sb) const { | 58 | bool operator==(const ShaderBlock& sb) const { |
| 46 | return std::tie(start, end, ignore_branch, branch) == | 59 | return std::tie(start, end, ignore_branch, branch) == |
| 47 | std::tie(sb.start, sb.end, sb.ignore_branch, sb.branch); | 60 | std::tie(sb.start, sb.end, sb.ignore_branch, sb.branch); |
| 48 | } | 61 | } |
| 62 | |||
| 63 | bool operator!=(const ShaderBlock& sb) const { | ||
| 64 | return !operator==(sb); | ||
| 65 | } | ||
| 49 | }; | 66 | }; |
| 50 | 67 | ||
| 51 | struct ShaderCharacteristics { | 68 | struct ShaderCharacteristics { |