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