Lines Matching refs:Options
40 struct Options {
47 bool ParseOptions(int argc, char* argv[], Options* options) {
51 options->instance = true;
53 options->device_index = 0;
62 int result = sscanf(arg2.c_str(), "%u", &options->device_index);
64 options->device_index = -1;
69 options->device_name = arg2;
71 options->output_file = arg2;
78 if (options->instance && (options->device_index != unsignedNegOne ||
79 !options->device_name.empty())) {
84 if (options->device_index != unsignedNegOne && !options->device_name.empty()) {
89 if (options->instance && options->output_file.empty()) {
94 if (!options->output_file.empty() && !options->instance &&
95 options->device_index == unsignedNegOne && options->device_name.empty()) {
104 bool Dump(const VkJsonInstance& instance, const Options& options) {
106 if (options.device_index != unsignedNegOne) {
107 if (static_cast<uint32_t>(options.device_index) >=
109 std::cerr << "Error: device " << options.device_index
114 out_device = &instance.devices[options.device_index];
115 } else if (!options.device_name.empty()) {
117 if (device.properties.deviceName == options.device_name) {
122 std::cerr << "Error: device '" << options.device_name
129 if (options.output_file.empty()) {
134 output_file = options.output_file;
163 Options options;
164 if (!ParseOptions(argc, argv, &options))
168 if (options.instance || options.device_index != unsignedNegOne ||
169 !options.device_name.empty()) {
170 Dump(instance, options);
173 options.device_index = i;
174 Dump(instance, options);