ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
acmxvk-source-manifest-cli.cpp
Go to the documentation of this file.
2
3#include <QCommandLineOption>
4#include <QCommandLineParser>
5#include <QCoreApplication>
6#include <QTextStream>
7
8int main(int argc, char **argv) {
9 QCoreApplication application(argc, argv);
10 QCoreApplication::setApplicationName(QStringLiteral("create_acmxvk_source_manifest"));
11 QCoreApplication::setApplicationVersion(QStringLiteral("1.0"));
12
13 QCommandLineParser parser;
14 parser.setApplicationDescription(QStringLiteral("Create an ACMXVK source library.json from Vulkan GLSL "
15 "fragment and compute sources."));
16 parser.addHelpOption();
17 parser.addVersionOption();
18 const QCommandLineOption rootOption(QStringList{QStringLiteral("r"), QStringLiteral("root")}, QStringLiteral("Shader source directory to scan recursively."), QStringLiteral("directory"));
19 const QCommandLineOption outputOption(QStringList{QStringLiteral("o"), QStringLiteral("output")}, QStringLiteral("Manifest path (defaults to ROOT/library.json)."), QStringLiteral("file"));
20 parser.addOption(rootOption);
21 parser.addOption(outputOption);
22 parser.process(application);
23
24 if (!parser.isSet(rootOption))
25 parser.showHelp(1);
26
28 QString error;
29 if (!acmx2::create_acmxvk_source_manifest(parser.value(rootOption), parser.value(outputOption), result, error)) {
30 QTextStream(stderr) << "Error: " << error << '\n';
31 return 1;
32 }
33
34 QTextStream(stdout) << "Wrote " << result.outputPath << '\n' << result.fragmentCount << " fragment shader(s), " << result.computeCount << " compute shader(s), " << result.customUniformCount << " custom-uniform slot(s)\n";
35 return 0;
36}
int main(int argc, char **argv)
Application entry point.
bool create_acmxvk_source_manifest(const QString &rootDirectory, const QString &outputPath, AcmxvkSourceManifestResult &result, QString &error)
Scan an ACMXVK source tree and atomically generate its library.json.