flow_test.h 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <string>
  5. #include <fmt/format.h>
  6. #include "common/common_types.h"
  7. namespace Shader::IR {
  8. enum class FlowTest : u64 {
  9. F,
  10. LT,
  11. EQ,
  12. LE,
  13. GT,
  14. NE,
  15. GE,
  16. NUM,
  17. NaN,
  18. LTU,
  19. EQU,
  20. LEU,
  21. GTU,
  22. NEU,
  23. GEU,
  24. T,
  25. OFF,
  26. LO,
  27. SFF,
  28. LS,
  29. HI,
  30. SFT,
  31. HS,
  32. OFT,
  33. CSM_TA,
  34. CSM_TR,
  35. CSM_MX,
  36. FCSM_TA,
  37. FCSM_TR,
  38. FCSM_MX,
  39. RLE,
  40. RGT,
  41. };
  42. [[nodiscard]] std::string NameOf(FlowTest flow_test);
  43. } // namespace Shader::IR
  44. template <>
  45. struct fmt::formatter<Shader::IR::FlowTest> {
  46. constexpr auto parse(format_parse_context& ctx) {
  47. return ctx.begin();
  48. }
  49. template <typename FormatContext>
  50. auto format(const Shader::IR::FlowTest& flow_test, FormatContext& ctx) {
  51. return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(flow_test));
  52. }
  53. };