flow_test.h 1002 B

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