2022-04-23 04:59:50 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2021-01-09 03:30:07 -03:00
|
|
|
|
|
|
|
#include <array>
|
2025-07-28 19:39:31 +01:00
|
|
|
#include <string_view>
|
2021-01-09 03:30:07 -03:00
|
|
|
|
|
|
|
#include "shader_recompiler/exception.h"
|
2021-02-05 23:11:23 -03:00
|
|
|
#include "shader_recompiler/frontend/maxwell/opcodes.h"
|
2021-01-09 03:30:07 -03:00
|
|
|
|
|
|
|
namespace Shader::Maxwell {
|
2025-07-28 19:39:31 +01:00
|
|
|
|
|
|
|
const char* NameOf(Opcode opcode) {
|
|
|
|
constexpr const char* NAME_TABLE[] = {
|
2021-05-27 17:51:00 -03:00
|
|
|
#define INST(name, cute, encode) cute,
|
2021-01-09 03:30:07 -03:00
|
|
|
#include "maxwell.inc"
|
|
|
|
#undef INST
|
2025-07-28 19:39:31 +01:00
|
|
|
};
|
|
|
|
if (size_t(opcode) >= sizeof(NAME_TABLE) / sizeof(NAME_TABLE[0]))
|
|
|
|
throw InvalidArgument("Invalid opcode with raw value {}", int(opcode));
|
|
|
|
return NAME_TABLE[size_t(opcode)];
|
2021-01-09 03:30:07 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Shader::Maxwell
|