aboutsummaryrefslogtreecommitdiff
path: root/tools/maxwell-spirv/main.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-05-24 01:05:07 +0200
committercrueter <crueter@eden-emu.dev>2026-05-24 01:05:07 +0200
commitd9067d85af1caf78da78f77e7ae20125212530ef (patch)
tree7c91373b15c091af9fb4768658c28a1931548013 /tools/maxwell-spirv/main.cpp
parent2aa2ac7d9ac8e47f59a2475384c3afee9d5c60bc (diff)
[tools] add separate maxwell disassembler, ir dumper, and spirv translator (#3453)
why not? Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3453 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'tools/maxwell-spirv/main.cpp')
-rw-r--r--tools/maxwell-spirv/main.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/maxwell-spirv/main.cpp b/tools/maxwell-spirv/main.cpp
new file mode 100644
index 0000000000..f9245d436e
--- /dev/null
+++ b/tools/maxwell-spirv/main.cpp
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+int SpirvReferenceImpl(int argc, char *argv[]);
+int SpirvShaderRecompilerImpl(int argc, char *argv[]);
+
+int main(int argc, char *argv[]) {
+ if (argc < 2) {
+ printf("usage: %s [input file]\n"
+ "Specify -n to use a recompiler that is NOT tied to the shader recompiler\n"
+ "aka. a reference recompiler\n"
+ "RAW SPIRV CODE WILL BE SENT TO STDOUT!\n", argv[0]);
+ return EXIT_FAILURE;
+ }
+ if (argc >= 3) {
+ if (::strcmp(argv[2], "-n") == 0
+ || ::strcmp(argv[2], "--new") == 0) {
+ return SpirvReferenceImpl(argc, argv);
+ }
+ }
+ return SpirvShaderRecompilerImpl(argc, argv);
+}