summaryrefslogtreecommitdiff
path: root/src/video_core/shader/expr.h
diff options
context:
space:
mode:
authorGravatar Lioncash2019-10-05 08:17:32 -0400
committerGravatar Lioncash2019-10-05 09:14:23 -0400
commit8eb1398f8d90fb2813f438b9fffac716b6ec51d2 (patch)
tree39a270023b64af2dce85e3d4a13484c95243b2b3 /src/video_core/shader/expr.h
parentvideo_core/ast: Supply const accessors for data where applicable (diff)
downloadyuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.tar.gz
yuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.tar.xz
yuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.zip
video_core/{ast, expr}: Use std::move where applicable
Avoids unnecessary atomic reference count increments and decrements.
Diffstat (limited to 'src/video_core/shader/expr.h')
-rw-r--r--src/video_core/shader/expr.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h
index 4c399cef9..1f1638520 100644
--- a/src/video_core/shader/expr.h
+++ b/src/video_core/shader/expr.h
@@ -28,7 +28,7 @@ using Expr = std::shared_ptr<ExprData>;
28 28
29class ExprAnd final { 29class ExprAnd final {
30public: 30public:
31 explicit ExprAnd(Expr a, Expr b) : operand1{a}, operand2{b} {} 31 explicit ExprAnd(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {}
32 32
33 bool operator==(const ExprAnd& b) const; 33 bool operator==(const ExprAnd& b) const;
34 34
@@ -38,7 +38,7 @@ public:
38 38
39class ExprOr final { 39class ExprOr final {
40public: 40public:
41 explicit ExprOr(Expr a, Expr b) : operand1{a}, operand2{b} {} 41 explicit ExprOr(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {}
42 42
43 bool operator==(const ExprOr& b) const; 43 bool operator==(const ExprOr& b) const;
44 44
@@ -48,7 +48,7 @@ public:
48 48
49class ExprNot final { 49class ExprNot final {
50public: 50public:
51 explicit ExprNot(Expr a) : operand1{a} {} 51 explicit ExprNot(Expr a) : operand1{std::move(a)} {}
52 52
53 bool operator==(const ExprNot& b) const; 53 bool operator==(const ExprNot& b) const;
54 54
@@ -105,9 +105,9 @@ Expr MakeExpr(Args&&... args) {
105 return std::make_shared<ExprData>(T(std::forward<Args>(args)...)); 105 return std::make_shared<ExprData>(T(std::forward<Args>(args)...));
106} 106}
107 107
108bool ExprAreEqual(Expr first, Expr second); 108bool ExprAreEqual(const Expr& first, const Expr& second);
109 109
110bool ExprAreOpposite(Expr first, Expr second); 110bool ExprAreOpposite(const Expr& first, const Expr& second);
111 111
112Expr MakeExprNot(Expr first); 112Expr MakeExprNot(Expr first);
113 113
@@ -115,6 +115,6 @@ Expr MakeExprAnd(Expr first, Expr second);
115 115
116Expr MakeExprOr(Expr first, Expr second); 116Expr MakeExprOr(Expr first, Expr second);
117 117
118bool ExprIsTrue(Expr first); 118bool ExprIsTrue(const Expr& first);
119 119
120} // namespace VideoCommon::Shader 120} // namespace VideoCommon::Shader