mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-17 19:00:48 +02:00
Records presents, GPU waits, submits, ETC2 decode, and pipeline and shader creation for ui.perfetto.dev. Adds a benchmark guide and a trace summary script.
67 lines
2.3 KiB
C++
67 lines
2.3 KiB
C++
#ifndef MOCKTAIL_RUNTIME_COMMAND_LINE_H_
|
|
#define MOCKTAIL_RUNTIME_COMMAND_LINE_H_
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace mocktail {
|
|
namespace runtime {
|
|
|
|
enum class CommandMode {
|
|
kRun,
|
|
kHelp,
|
|
};
|
|
|
|
enum class WindowMode {
|
|
kUnspecified,
|
|
kHeadless,
|
|
kWindowed,
|
|
};
|
|
|
|
struct CommandLineOptions {
|
|
CommandMode mode = CommandMode::kRun;
|
|
WindowMode window_mode = WindowMode::kUnspecified;
|
|
std::string program_name = "mocktail";
|
|
std::string roblox_library_path;
|
|
std::string graphics_backend;
|
|
// Raw browser/internal input exists only until the composition root creates
|
|
// safe re-exec arguments, then it is overwritten in this string and argv.
|
|
std::string raw_launch_argument;
|
|
std::string launch_request_json;
|
|
int launch_argument_index = -1;
|
|
bool allow_unverified_build = false;
|
|
// Requests one explicit launch of the provider latest without promoting it
|
|
// into the managed payload state.
|
|
bool force_run_latest = false;
|
|
// Chrome trace file the Vulkan adapter writes; empty when not profiling.
|
|
std::string profile_trace_path;
|
|
};
|
|
|
|
struct CommandLineParseResult {
|
|
CommandLineOptions options;
|
|
std::string error;
|
|
|
|
explicit operator bool() const { return error.empty(); }
|
|
};
|
|
|
|
CommandLineParseResult ParseCommandLine(int argc, const char* const argv[]);
|
|
// Produces argv[1..] for a possible cgroup re-exec. A raw website URI is
|
|
// replaced with the already-normalized internal request, so browser gameinfo
|
|
// tickets do not cross the exec boundary.
|
|
bool BuildCommandLineReexecArguments(const CommandLineOptions& options,
|
|
int argc, const char* const argv[],
|
|
std::vector<std::string>* arguments,
|
|
std::string* error);
|
|
// Overwrites the original raw launch argument and both owned launch strings
|
|
// after the request and sanitized re-exec argv have been created.
|
|
void ScrubCommandLineLaunchArguments(CommandLineOptions* options, int argc,
|
|
char* argv[]);
|
|
bool ApplyCommandLineEnvironment(const CommandLineOptions& options,
|
|
std::string* error);
|
|
std::string CommandLineUsage(const std::string& program_name);
|
|
|
|
} // namespace runtime
|
|
} // namespace mocktail
|
|
|
|
#endif // MOCKTAIL_RUNTIME_COMMAND_LINE_H_
|