summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/pred.h
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-01-09 03:30:07 -0300
committerGravatar ameerj2021-07-22 21:51:21 -0400
commit2d48a7b4d0666ad16d03a22d85712617a0849046 (patch)
treedd1069afca86f66e77e3438da77421a43adf5091 /src/shader_recompiler/frontend/ir/pred.h
parentthread_worker: Fix compile time error (diff)
downloadyuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.gz
yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.xz
yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.zip
shader: Initial recompiler work
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/pred.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/pred.h b/src/shader_recompiler/frontend/ir/pred.h
new file mode 100644
index 000000000..37cc53006
--- /dev/null
+++ b/src/shader_recompiler/frontend/ir/pred.h
@@ -0,0 +1,28 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <fmt/format.h>
8
9namespace Shader::IR {
10
11enum class Pred { P0, P1, P2, P3, P4, P5, P6, PT };
12
13} // namespace Shader::IR
14
15template <>
16struct fmt::formatter<Shader::IR::Pred> {
17 constexpr auto parse(format_parse_context& ctx) {
18 return ctx.begin();
19 }
20 template <typename FormatContext>
21 auto format(const Shader::IR::Pred& pred, FormatContext& ctx) {
22 if (pred == Shader::IR::Pred::PT) {
23 return fmt::format_to(ctx.out(), "PT");
24 } else {
25 return fmt::format_to(ctx.out(), "P{}", static_cast<int>(pred));
26 }
27 }
28};