mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
25
gpu/vk/eden/shader_recompiler/frontend/maxwell/opcodes.cpp
Normal file
25
gpu/vk/eden/shader_recompiler/frontend/maxwell/opcodes.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <string_view>
|
||||
|
||||
#include "shader_recompiler/exception.h"
|
||||
#include "shader_recompiler/frontend/maxwell/opcodes.h"
|
||||
|
||||
namespace Shader::Maxwell {
|
||||
|
||||
const char* NameOf(Opcode opcode) {
|
||||
constexpr const char* NAME_TABLE[] = {
|
||||
#define INST(name, cute, encode) cute,
|
||||
#include "maxwell.inc"
|
||||
#undef INST
|
||||
};
|
||||
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)];
|
||||
}
|
||||
|
||||
} // namespace Shader::Maxwell
|
||||
Reference in New Issue
Block a user