summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2020-12-07 16:09:29 -0500
committerGravatar Lioncash2020-12-07 16:15:28 -0500
commit45c5b084fde190336d07c01368699a6129214bdf (patch)
treea1222e922b05249f925c7e77c8a4ab850dea8c85 /src
parentMerge pull request #5149 from comex/xx-map-interval (diff)
downloadyuzu-45c5b084fde190336d07c01368699a6129214bdf.tar.gz
yuzu-45c5b084fde190336d07c01368699a6129214bdf.tar.xz
yuzu-45c5b084fde190336d07c01368699a6129214bdf.zip
ast: Improve string concat readability in operator()
Provides an in-place format string to make it more pleasant to read.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/ast.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp
index cc2dbe36c..db11144c7 100644
--- a/src/video_core/shader/ast.cpp
+++ b/src/video_core/shader/ast.cpp
@@ -212,16 +212,15 @@ public:
212 } 212 }
213 213
214 void operator()(const ExprPredicate& expr) { 214 void operator()(const ExprPredicate& expr) {
215 inner += "P" + std::to_string(expr.predicate); 215 inner += fmt::format("P{}", expr.predicate);
216 } 216 }
217 217
218 void operator()(const ExprCondCode& expr) { 218 void operator()(const ExprCondCode& expr) {
219 u32 cc = static_cast<u32>(expr.cc); 219 inner += fmt::format("CC{}", expr.cc);
220 inner += "CC" + std::to_string(cc);
221 } 220 }
222 221
223 void operator()(const ExprVar& expr) { 222 void operator()(const ExprVar& expr) {
224 inner += "V" + std::to_string(expr.var_index); 223 inner += fmt::format("V{}", expr.var_index);
225 } 224 }
226 225
227 void operator()(const ExprBoolean& expr) { 226 void operator()(const ExprBoolean& expr) {
@@ -229,7 +228,7 @@ public:
229 } 228 }
230 229
231 void operator()(const ExprGprEqual& expr) { 230 void operator()(const ExprGprEqual& expr) {
232 inner += "( gpr_" + std::to_string(expr.gpr) + " == " + std::to_string(expr.value) + ')'; 231 inner += fmt::format("(gpr_{} == {})", expr.gpr, expr.value);
233 } 232 }
234 233
235 const std::string& GetResult() const { 234 const std::string& GetResult() const {