diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-10-26 21:56:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-26 21:56:13 +0200 |
commit | 26f3e18c5cb882d48af702aa33519f4a2c74fa75 (patch) | |
tree | f17b70de1e1bca10e67a4f1076691a580f717f56 /src/video_core/shader/expr.h | |
parent | Merge pull request #3027 from lioncash/lookup (diff) | |
parent | Shader_IR: Address Feedback. (diff) | |
download | yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.gz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.bz2 yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.lz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.xz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.zst yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.zip |
Diffstat (limited to 'src/video_core/shader/expr.h')
-rw-r--r-- | src/video_core/shader/expr.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h index d3dcd00ec..4e8264367 100644 --- a/src/video_core/shader/expr.h +++ b/src/video_core/shader/expr.h @@ -17,13 +17,14 @@ using Tegra::Shader::Pred; class ExprAnd; class ExprBoolean; class ExprCondCode; +class ExprGprEqual; class ExprNot; class ExprOr; class ExprPredicate; class ExprVar; -using ExprData = - std::variant<ExprVar, ExprCondCode, ExprPredicate, ExprNot, ExprOr, ExprAnd, ExprBoolean>; +using ExprData = std::variant<ExprVar, ExprCondCode, ExprPredicate, ExprNot, ExprOr, ExprAnd, + ExprBoolean, ExprGprEqual>; using Expr = std::shared_ptr<ExprData>; class ExprAnd final { @@ -118,6 +119,22 @@ public: bool value; }; +class ExprGprEqual final { +public: + ExprGprEqual(u32 gpr, u32 value) : gpr{gpr}, value{value} {} + + bool operator==(const ExprGprEqual& b) const { + return gpr == b.gpr && value == b.value; + } + + bool operator!=(const ExprGprEqual& b) const { + return !operator==(b); + } + + u32 gpr; + u32 value; +}; + template <typename T, typename... Args> Expr MakeExpr(Args&&... args) { static_assert(std::is_convertible_v<T, ExprData>); |