diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/pred.h | 28 |
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 | |||
| 9 | namespace Shader::IR { | ||
| 10 | |||
| 11 | enum class Pred { P0, P1, P2, P3, P4, P5, P6, PT }; | ||
| 12 | |||
| 13 | } // namespace Shader::IR | ||
| 14 | |||
| 15 | template <> | ||
| 16 | struct 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 | }; | ||