opcodes.h 695 B

123456789101112131415161718192021222324252627282930
  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 <fmt/format.h>
  6. namespace Shader::Maxwell {
  7. enum class Opcode {
  8. #define INST(name, cute, encode) name,
  9. #include "maxwell.inc"
  10. #undef INST
  11. };
  12. const char* NameOf(Opcode opcode);
  13. } // namespace Shader::Maxwell
  14. template <>
  15. struct fmt::formatter<Shader::Maxwell::Opcode> {
  16. constexpr auto parse(format_parse_context& ctx) {
  17. return ctx.begin();
  18. }
  19. template <typename FormatContext>
  20. auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) {
  21. return format_to(ctx.out(), "{}", NameOf(opcode));
  22. }
  23. };