diff options
| author | 2019-09-23 22:55:25 -0400 | |
|---|---|---|
| committer | 2019-10-25 09:01:30 -0400 | |
| commit | 8909f52166bf9c27d52b5a722efbd46d1a11e876 (patch) | |
| tree | 2e21bbc3c3f5422325d8003d72cdb4bb120a26e5 /src/video_core/shader/expr.h | |
| parent | Shader_Cache: setup connection of ConstBufferLocker (diff) | |
| download | yuzu-8909f52166bf9c27d52b5a722efbd46d1a11e876.tar.gz yuzu-8909f52166bf9c27d52b5a722efbd46d1a11e876.tar.xz yuzu-8909f52166bf9c27d52b5a722efbd46d1a11e876.zip | |
Shader_IR: Implement Fast BRX and allow multi-branches in the CFG.
Diffstat (limited to 'src/video_core/shader/expr.h')
| -rw-r--r-- | src/video_core/shader/expr.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h index d3dcd00ec..e41d23e93 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,18 @@ 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 | u32 gpr; | ||
| 131 | u32 value; | ||
| 132 | }; | ||
| 133 | |||
| 121 | template <typename T, typename... Args> | 134 | template <typename T, typename... Args> |
| 122 | Expr MakeExpr(Args&&... args) { | 135 | Expr MakeExpr(Args&&... args) { |
| 123 | static_assert(std::is_convertible_v<T, ExprData>); | 136 | static_assert(std::is_convertible_v<T, ExprData>); |