summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
-rw-r--r--src/shader_recompiler/frontend/maxwell/opcodes.cpp2
-rw-r--r--src/shader_recompiler/frontend/maxwell/program.cpp1
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/translate.cpp13
3 files changed, 11 insertions, 5 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/opcodes.cpp b/src/shader_recompiler/frontend/maxwell/opcodes.cpp
index 12ddf2ac9..ccc40c20c 100644
--- a/src/shader_recompiler/frontend/maxwell/opcodes.cpp
+++ b/src/shader_recompiler/frontend/maxwell/opcodes.cpp
@@ -10,7 +10,7 @@
10namespace Shader::Maxwell { 10namespace Shader::Maxwell {
11namespace { 11namespace {
12constexpr std::array NAME_TABLE{ 12constexpr std::array NAME_TABLE{
13#define INST(name, cute, encode) #cute, 13#define INST(name, cute, encode) cute,
14#include "maxwell.inc" 14#include "maxwell.inc"
15#undef INST 15#undef INST
16}; 16};
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp
index ccdab1dad..900fc7ab1 100644
--- a/src/shader_recompiler/frontend/maxwell/program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/program.cpp
@@ -7,6 +7,7 @@
7#include <ranges> 7#include <ranges>
8#include <vector> 8#include <vector>
9 9
10#include "shader_recompiler/exception.h"
10#include "shader_recompiler/frontend/ir/basic_block.h" 11#include "shader_recompiler/frontend/ir/basic_block.h"
11#include "shader_recompiler/frontend/ir/post_order.h" 12#include "shader_recompiler/frontend/ir/post_order.h"
12#include "shader_recompiler/frontend/maxwell/program.h" 13#include "shader_recompiler/frontend/maxwell/program.h"
diff --git a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
index 0f4e7a251..8e3c4c5d5 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/translate.cpp
@@ -30,16 +30,21 @@ void Translate(Environment& env, IR::Block* block, u32 location_begin, u32 locat
30 TranslatorVisitor visitor{env, *block}; 30 TranslatorVisitor visitor{env, *block};
31 for (Location pc = location_begin; pc != location_end; ++pc) { 31 for (Location pc = location_begin; pc != location_end; ++pc) {
32 const u64 insn{env.ReadInstruction(pc.Offset())}; 32 const u64 insn{env.ReadInstruction(pc.Offset())};
33 const Opcode opcode{Decode(insn)}; 33 try {
34 switch (opcode) { 34 const Opcode opcode{Decode(insn)};
35 switch (opcode) {
35#define INST(name, cute, mask) \ 36#define INST(name, cute, mask) \
36 case Opcode::name: \ 37 case Opcode::name: \
37 Invoke<&TranslatorVisitor::name>(visitor, pc, insn); \ 38 Invoke<&TranslatorVisitor::name>(visitor, pc, insn); \
38 break; 39 break;
39#include "shader_recompiler/frontend/maxwell/maxwell.inc" 40#include "shader_recompiler/frontend/maxwell/maxwell.inc"
40#undef OPCODE 41#undef OPCODE
41 default: 42 default:
42 throw LogicError("Invalid opcode {}", opcode); 43 throw LogicError("Invalid opcode {}", opcode);
44 }
45 } catch (Exception& exception) {
46 exception.Prepend(fmt::format("Translate {}: ", Decode(insn)));
47 throw;
43 } 48 }
44 } 49 }
45} 50}