diff options
| author | 2019-10-26 16:56:13 -0300 | |
|---|---|---|
| committer | 2019-10-26 16:56:13 -0300 | |
| 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.gz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.xz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.zip | |
Merge pull request #2976 from FernandoS27/cache-fast-brx-rebased
Implement Fast BRX, fix TXQ and addapt the Shader Cache for it
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; | |||
| 17 | class ExprAnd; | 17 | class ExprAnd; |
| 18 | class ExprBoolean; | 18 | class ExprBoolean; |
| 19 | class ExprCondCode; | 19 | class ExprCondCode; |
| 20 | class ExprGprEqual; | ||
| 20 | class ExprNot; | 21 | class ExprNot; |
| 21 | class ExprOr; | 22 | class ExprOr; |
| 22 | class ExprPredicate; | 23 | class ExprPredicate; |
| 23 | class ExprVar; | 24 | class ExprVar; |
| 24 | 25 | ||
| 25 | using ExprData = | 26 | using ExprData = std::variant<ExprVar, ExprCondCode, ExprPredicate, ExprNot, ExprOr, ExprAnd, |
| 26 | std::variant<ExprVar, ExprCondCode, ExprPredicate, ExprNot, ExprOr, ExprAnd, ExprBoolean>; | 27 | ExprBoolean, ExprGprEqual>; |
| 27 | using Expr = std::shared_ptr<ExprData>; | 28 | using Expr = std::shared_ptr<ExprData>; |
| 28 | 29 | ||
| 29 | class ExprAnd final { | 30 | class ExprAnd final { |
| @@ -118,6 +119,22 @@ public: | |||
| 118 | bool value; | 119 | bool value; |
| 119 | }; | 120 | }; |
| 120 | 121 | ||
| 122 | class ExprGprEqual final { | ||
| 123 | public: | ||
| 124 | ExprGprEqual(u32 gpr, u32 value) : gpr{gpr}, value{value} {} | ||
| 125 | |||
| 126 | bool operator==(const ExprGprEqual& b) const { | ||
| 127 | return gpr == b.gpr && value == b.value; | ||
| 128 | } | ||
| 129 | |||
| 130 | bool operator!=(const ExprGprEqual& b) const { | ||
| 131 | return !operator==(b); | ||
| 132 | } | ||
| 133 | |||
| 134 | u32 gpr; | ||
| 135 | u32 value; | ||
| 136 | }; | ||
| 137 | |||
| 121 | template <typename T, typename... Args> | 138 | template <typename T, typename... Args> |
| 122 | Expr MakeExpr(Args&&... args) { | 139 | Expr MakeExpr(Args&&... args) { |
| 123 | static_assert(std::is_convertible_v<T, ExprData>); | 140 | static_assert(std::is_convertible_v<T, ExprData>); |